Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Validate axes types v0.4 #124
Validate axes types v0.4 #124
Changes from 10 commits
9250136
6557b26
19a320c
a2b3b3e
02342b6
939295c
789b95b
4097ece
bd16dfd
9f75ae3
18608d9
a580788
7147bbd
8e37f31
3037b33
5607786
d9a44f7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What's the main implication of not setting a default value here?
For 0.1/0.2 data, this means, the
node.metadata["axes"]
might beNone
as opposed to["t", "c", "z", "y", "x"]
previously i.e. we are preserving the value stored in the metadata? Is there an impact on clients relying onnode.metadata["axes"]
?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.
Since we are not consuming the return values of
validate_axes
, the goal here is "only" to validate anaxes
but not modify it ?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.
Ah - good point. Looking at this again, I realise that
validate_axes(None, axes, fmt)
is really designed for writing. So, what's returned will be valid, even if what it's passed isn't valid. E.g. it will convert "tczyx" to an axis array, and will allow v0.3 to haveNone
if 2D or 5D.What we really want here is
Axes(axes, fmt).validate()
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.
At least I find the following lines
clarifies a lot of the logic happening here. It brings the question of whether additional logic should be moved to the constructor. Said otherwise, what is the added value of calling the
validate_axes
API vs the two-liner: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.
What's the outcome of #124 (comment). Should the name of the method be updated to reflect this is a writer/constructor rather than a validator? Since this API is moved to be a public API, this is increasingly important. Alternatively, we can keep it prefixed with
_
for now.