Repository navigation
fix(scale_linetype): report default palette capacity clearly - #1139
senanurcetin wants to merge 3 commits into
Conversation
|
Hi Plotnine maintainers, I've submitted a focused fix to provide a clearer error when the default discrete linetype scale exceeds its four-category limit. The PR also includes regression tests covering the default palette limit, the error message, and the manual linetype workaround. I noticed that the build workflow is marked as AI assistance was used in preparing this contribution. Thank you for considering the PR! |
Raise an actionable PlotnineError when the built-in palette is asked for more than four categories, and cover the boundary and manual linetype workaround with regression tests.
0dee7fb to
a6c3c54
Compare
Preserve the existing three-file PR patch unchanged while absorbing upstream compatibility and CI fixes. Both parents retained; no force-push. Verified upstream main passed all seven CI jobs. Latest upstream commits did not modify any of the three files changed by this PR. Full branch CI awaits this merge commit; no tests claimed as locally run.
|
Closing this to keep my open pull requests to a number I can follow up on properly. The branch stays on my fork, so if this change is still wanted I'm happy to reopen it. Thanks for your time. |
|
This PR will get in sometime before the upcoming v0.16.0 release. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1139 +/- ##
=======================================
Coverage 88.92% 88.92%
=======================================
Files 229 229
Lines 17320 17326 +6
Branches 2204 2205 +1
=======================================
+ Hits 15402 15408 +6
Misses 1289 1289
Partials 629 629 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for reopening this. I'll keep the branch up to date and am happy to make any changes you'd like before v0.16.0. |
Summary
Related to #351.
The default discrete linetype scale has only four patterns. With more than four categories it produced missing values and eventually failed with the unhelpful
ValueError: Unrecognized linestyle: nan. It now raises aPlotnineErrorthat explains the four-category limit and points toscale_linetype_manual().Changes
PlotnineErrorwhen the default linetype palette's capacity is exceeded (plotnine/scales/scale_linetype.py).tests/test_scale_internals.pyto expect the new error.Testing
Windows / Python 3.13: 59 tests passed across
test_scale_internals.pyandtest_scale_linetype.py; Ruff lint/format clean. The original error was reproduced before the fix. The full test suite was not run locally.AI assistance
AI assistance (ChatGPT) was used during implementation, regression testing, and validation.