-
Notifications
You must be signed in to change notification settings - Fork 11
Fix unused parameters being passed to pie chart #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Not entirely sure why for dataframes the code is forwarding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that unused legend and colorbar parameters are not passed to pie charts (fixing #259) and adds a test to verify DataFrame index labels appear correctly on pie slices.
- Extract legend and colorbar label values early in
_parse_1d_format
- Pop
legend_kw
andcolorbar_kw
inpie
before calling the native implementation - Add a test case for labeled DataFrame input to
pie
- Include an example script demonstrating pie usage with DataFrames
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
ultraplot/tests/test_plot.py | Add test_pie_labeled_series_in_dataframes to cover #259 edge case |
ultraplot/axes/plot.py | Extract and remove unused legend/colorbar kwargs in parser and pie |
test.py | Add demo script for pie-chart with DataFrame indices |
Comments suppressed due to low confidence (3)
ultraplot/axes/plot.py:2291
- The variable name
colorbar_kw_labels
is misleading since it holds the 'values' popped fromcolorbar_kw
. Consider renaming it tocolorbar_kw_values
to match its purpose and the downstream parameter name.
colorbar_kw_labels = _not_none(
test.py:31
- The call to
uplt.subplot()
likely should beuplt.subplots()
to match the API used elsewhere (subplots
returns both figure and axes). This typo can cause a runtime error.
fig, ax = uplt.subplot()
test.py:1
- [nitpick] This demo script in the project root (
test.py
) could be moved to anexamples/
directory to avoid confusion with actual test files and keep the repo organized.
# %%
Addresses #259
Will need to check this later today or tomorrow as I don't have time to check this now.