-
Notifications
You must be signed in to change notification settings - Fork 18
Handle non homogeneous arrays #318
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
Handle non homogeneous arrays #318
Conversation
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 adds support for handling non-homogeneous arrays in violin and box plots by implementing graceful fallback to dtype=object when numpy.atleast_1d() fails. This addresses issue #317 where arrays with different dimensions couldn't be processed.
- Modified
_to_numpy_arrayto catch exceptions and fallback to object dtype for non-homogeneous data - Added comprehensive test coverage for various data type scenarios
- Added specific test for inhomogeneous violin plots
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ultraplot/internals/inputs.py | Implements try-except block to handle non-homogeneous arrays with object dtype fallback |
| ultraplot/tests/test_inputs.py | Adds parametrized tests for _to_numpy_array function with various data types |
| ultraplot/tests/test_plot.py | Adds test for inhomogeneous violin plot functionality |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR will attempt to parse the data inputs as a
dtype=objectif the input has different dimensions as was the case in #317. This would allow for more flexible parsing in violin and boxplots.