-
Notifications
You must be signed in to change notification settings - Fork 591
Fix empty input behavior for extract_values
and remove redundant scalar validation
#7001
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 ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7001 +/- ##
=======================================
Coverage 97.50% 97.51%
=======================================
Files 144 144
Lines 28554 28556 +2
=======================================
+ Hits 27843 27845 +2
Misses 711 711 |
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.
LGTM. Just a minor suggestion: The variable split
is accessed globally from outside the function, which made the code slightly harder to follow. It might be a good idea to modularize the internal functions for better readability. It is another PR anyway.
I'm not sure I follow, def extract_values(split):
...
if split:
... |
I meant my comment in the sense that I was a bit confused because |
Oh I understand now, the variable scope is not local. Yes that can be confusing (and buggy). |
Overview
extract_values
returnsself.copy()
for empty inputs. But the return type should beMultiBlock
orUnstructuredGrid
. This PR fixes this.The scalar array validation is also redundant and is simplified - it raises the same errors which are otherwise raised automatically by
set_default_active_scalars
andget_array
.