Repository navigation
Fix NumPy array handling for plot limits - #2000
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughChangesNumPy plot limits
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change fixes NumPy plot-limit handling and adds regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, the implementation, the affected functions, the regression test, issue reference, validation results, AI assistance, and checklist status. It also clearly reports the three environment-related test failures and explains their cause.
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
I noticed after opening this PR that @BHARATH0153 had already described a fix for item 1 in #1978. I’m sorry I missed that comment. I couldn’t find a linked PR or public branch for the change, so could you confirm whether that work is still active? |
|
Hi @dhruvb2028 , thanks for the PR. Please follow our contribution guidelines and first comment under an issue to signal you want to work on it. this will avoid duplicate work like you already noticed with the existing comment by @BHARATH0153. And it will help us maintainers to coordinate work and distribute our resources in a sustainable way. Please also disclose whether you used AI to create this fix (see contribution guidelines). The early line breaks in the PR description look like a typical Claude Code artifact. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2000 +/- ##
=======================================
Coverage 89.43% 89.43%
=======================================
Files 140 140
Lines 14312 14312
=======================================
Hits 12800 12800
Misses 1512 1512
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
@janfb Thanks for the feedback, and sorry for not commenting on the issue before opening the PR. I have now updated the description to disclose the AI assistance used. |
janfb
left a comment
There was a problem hiding this comment.
Thanks for this fix @dhruvb2028 and the concise PR. LGTM!
What does this PR do?
prepare_for_plot()currently checks for empty limits usinglimits == [].For NumPy arrays, this performs an element-wise comparison and can raise a
broadcasting error.
This PR replaces that comparison with a length check, updates the
pairplot()and
marginal_plot()type hints to include NumPy arrays, and adds a regressiontest verifying that NumPy limits are applied to the correct plot axes.
Does this close any issues?
Addresses the NumPy limits item in #1978.
Anything else we should know?
Validation performed:
uv run pytest tests/plot_test.py: 496 passed, 9 xfailed.uv run pyright sbi: 0 errors.xfailed, and three environment-related PyTensor failures. Those three tests
passed when rerun using PyTensor's Python fallback instead of the incompatible
local MinGW compiler.
AI assistance was used for implementation and test preparation, I reviewed and
validated the final change.
Checklist
uv run pytest -n auto -m "not slow and not gpu"passes.uv run pre-commit run --all-filespasses (ruff and formatting).uv run pyright sbipasses.with
pytest.mark.slow.