-
Notifications
You must be signed in to change notification settings - Fork 26
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
Warn when adding ragged arrays to DynamicTable without index argument #1066
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1066 +/- ##
==========================================
+ Coverage 88.53% 88.55% +0.01%
==========================================
Files 45 45
Lines 9605 9616 +11
Branches 2732 2738 +6
==========================================
+ Hits 8504 8515 +11
Misses 778 778
Partials 323 323 ☔ View full report in Codecov by Sentry. |
Yes, please correct me if I am wrong - it looks like we are iterating over every element in the array to check for raggedness. That could incur performance issues. I think we should add a flag I don't know how we would get around checking every element... Note that this issue should only come up if 1) the Related to 1), I suggest limiting the Related to 2), it looks like adding a check for
It seems like numpy uses "ragged" internally. I wonder why they chose to use "inhomogeneous shape" publicly. Perhaps "inhomogeneous shape" is more clear to the non-programmer, but I feel like both terms are poor. Maybe we could say "data has elements that have different lengths and therefore data cannot be coerced into an N-dimensional array"? |
Sounds like a good option!
Yes I wasn't sure how often people added arrays that were an object type but since it would still error when writing I think limiting this check make sense.
I had a check in
I agree, I think the phrasing you suggested is good. |
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.
Looks great!
Ah, I missed that. |
Motivation
Fix #1065. When a user tries to add a ragged array to a DynamicTable using
add_row
oradd_column
, a warning will occur prompting the user to use theindex
argument.I had some questions about these potential changes.
How to test the behavior?
Checklist
CHANGELOG.md
with your changes?