Skip to content

stubs(ROOT): add SetMaxTheta, nrOfDP, IsEqual, mnstat#1256

Open
olantwin wants to merge 1 commit into
masterfrom
stubs/pyroot-extras
Open

stubs(ROOT): add SetMaxTheta, nrOfDP, IsEqual, mnstat#1256
olantwin wants to merge 1 commit into
masterfrom
stubs/pyroot-extras

Conversation

@olantwin

Copy link
Copy Markdown
Contributor

Summary

Three real PyROOT/ROOT methods used in-tree but missing from the hand-curated stubs:

Symbol Used in Notes
Pythia8Generator.SetMaxTheta macro/run_simScript.py:618 defined on C++ base SHiP::Generator (shipgen/Generator.h:51); hoist to Pythia8Generator stub so HNLPythia8Generator / DPPythia8Generator inherit
Pythia8Generator.nrOfDP macro/run_simScript.py:986 defined on DPPythia8Generator (shipgen/DPPythia8Generator.h:88); base stub keeps subclass call sites typed
TH1.IsEqual python/experimental/compare_histograms.py:17 bin-content comparison
TMinuit.mnstat python/shipVertex.py:286 fit-status accessor for migrad-convergence reporting

Test plan

  • pyrefly check --output-format=full-text python macro drops from 128 → 125 errors
  • No new findings introduced; the remaining SetMaxTheta site is a NoneType narrowing (will be resolved by PR-D2)

Surface-minimal per the stubs file's own guidance.

Three real PyROOT/ROOT methods used in-tree but missing from the
hand-curated stubs:

* Pythia8Generator.SetMaxTheta and .nrOfDP — actually defined on the
  C++ base SHiP::Generator (SetMaxTheta in shipgen/Generator.h:51) and
  DPPythia8Generator (nrOfDP in shipgen/DPPythia8Generator.h:88).
  Hoisting both to the Pythia8Generator stub means HNLPythia8Generator
  and DPPythia8Generator inherit them transparently, matching the
  PyROOT-exposed behaviour.
* TH1.IsEqual — bin-content comparison used by
  python/experimental/compare_histograms.py.
* TMinuit.mnstat — fit-status accessor used by python/shipVertex.py
  for migrad-convergence reporting.

Drops 3 pyrefly missing-attribute errors (128 → 125).
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@olantwin, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 22 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3f07586c-5b88-4f44-b24a-ec37482280a8

📥 Commits

Reviewing files that changed from the base of the PR and between 7be7505 and e50a206.

📒 Files selected for processing (1)
  • stubs/ROOT/__init__.pyi
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stubs/pyroot-extras

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

olantwin added a commit that referenced this pull request Jun 16, 2026
Per-site narrowing for the residual NoneType / uninitialized findings:

* configGenieGenerator.py — assert top.FindNode result not None
* SBTDetector.py — guard self.MCdet.push_back with is not None
* compare_histograms.py — bind TClass.GetClass and skip when None
* convertEvtCalc.py — parse_file now returns None on error; caller bails
* eventDisplay.py — DrawVetoDigi.Targetz class attr, fRun asserts, one
  pyrefly:ignore for tkinter Checkbutton.var dynamic attach
* pythia8darkphoton_conf.py — initialise hname before the parser loop
* shipStrawTracking.py — rebuild hits dict comprehension-style,
  guard None pos after extrapolateToPlane, lambda for dict-max key

Pyrefly errors drop from 128 to 109 (19 fewer; 1 suppression).

The remaining mypy attr-defined complaint on TH1.IsEqual is fixed by
the companion stubs PR (#1256); mypy hook locally skipped while that
lands.
@github-actions

Copy link
Copy Markdown
Contributor

CI Plots

View all plots

fixed-target

pixi

PlaneHA20011 PlaneHA21011 PlaneHA22011 PlaneHA10011 PlaneHA11011 PlaneHA12011 PlaneHA20012 PlaneHA21012 PlaneHA22012 PlaneHA10012 PlaneHA11012 PlaneHA12012 PlaneHA20013 PlaneHA21013 PlaneHA22013 PlaneHA10013 PlaneHA11013 PlaneHA12013 PlaneHA20014 PlaneHA21014 PlaneHA22014 PlaneHA10014 PlaneHA11014 PlaneHA12014 PlaneHA20015 PlaneHA21015 PlaneHA22015 PlaneHA10015 PlaneHA11015 PlaneHA12015 PlaneHA20016 PlaneHA21016 PlaneHA22016 PlaneHA10016 PlaneHA11016 PlaneHA12016 PlaneHA20017 PlaneHA21017 PlaneHA22017 PlaneHA10017 PlaneHA11017 PlaneHA12017 PlaneHA10022 PlaneHA11022 PlaneHA12022 PlaneHA10111 PlaneHA11111 PlaneHA12111 PlaneHA10221 PlaneHA11221 PlaneHA12221 PlaneHA10223 PlaneHA11223 PlaneHA12223 PlaneHA10331 PlaneHA11331 PlaneHA12331

sim-chain

helium-all-TRY_2025

distu distv disty nmeas chi2 delPOverP pullPOverPx pullPOverPy pullPOverPz delPOverP2 delPOverPz delPOverP2z chi2 prob IP Vzresol Vxresol Vyresol Vzpull Vxpull Vypull Doca IP0 HNL IP0_pi0 HNL_pi0 HNLw meas meas2 measVSchi2 distu distv disty meanhits extrapTimeDetX extrapTimeDetY oa nrtracks nrSBT pi0Mass delPOverPz_py delPOverP2z_py pullPOverPx_py pullPOverPy_py pullPOverPz_py

vacuums-all-TRY_2025

distu distv disty nmeas chi2 delPOverP pullPOverPx pullPOverPy pullPOverPz delPOverP2 delPOverPz delPOverP2z chi2 prob IP Vzresol Vxresol Vyresol Vzpull Vxpull Vypull Doca IP0 HNL IP0_pi0 HNL_pi0 HNLw meas meas2 measVSchi2 distu distv disty meanhits extrapTimeDetX extrapTimeDetY oa nrtracks nrSBT pi0Mass delPOverPz_py delPOverP2z_py pullPOverPx_py pullPOverPy_py pullPOverPz_py

tracking-benchmark

pixi

h_dp_over_p h_dp_vs_p h_dx h_dy h_dtx h_dty h_hit_residual h_hit_pull h_chi2ndf h_p_truth h_p_matched

@olantwin

Copy link
Copy Markdown
Contributor Author

@coderabbitai rate limit

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Your plan includes PR reviews subject to rate limits. More reviews will be available in 27 minutes and 17 seconds.

@olantwin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant