New Attribute: speciesType#38
Merged
Merged
Conversation
Check if the optional `speciesType` attribute in the `SpeciesType` extension is a string and uses only allowed characters (e.g. no spaces).
6 tasks
Member
Author
|
@RemiLehe shall I push the updates to the example creator, writing the update: pushed. I skipped adding |
Add `speciesType` attributes to some records.
DavidSagan
approved these changes
Apr 3, 2018
ax3l
commented
Apr 3, 2018
|
|
||
| # optional but required for extensions | ||
| result_array += test_attr(f, v, "optional", "openPMDextension", np.string_, "^[a-zA-Z0-9-;]+$") | ||
| result_array += test_attr(f, v, "optional", "openPMDextension", np.string_, "^[a-zA-Z0-9\-;]+$") |
Member
Author
There was a problem hiding this comment.
note: this is a bug-fix for extension names from the last PR. The - needs an escape, otherwise it's a regex range.
(\ is not allowed, would also need an escape.)
Member
There was a problem hiding this comment.
Since regex can sometimes be cryptic, would you add a comment explaining what it does? Like
# Check that openPMDextension contains only letters, or digits, or the characters `-` and `;`
RemiLehe
requested changes
Apr 3, 2018
|
|
||
| # optional but required for extensions | ||
| result_array += test_attr(f, v, "optional", "openPMDextension", np.string_, "^[a-zA-Z0-9-;]+$") | ||
| result_array += test_attr(f, v, "optional", "openPMDextension", np.string_, "^[a-zA-Z0-9\-;]+$") |
Member
There was a problem hiding this comment.
Since regex can sometimes be cryptic, would you add a comment explaining what it does? Like
# Check that openPMDextension contains only letters, or digits, or the characters `-` and `;`
RemiLehe
approved these changes
Apr 3, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check if the optional
speciesTypeattribute in theSpeciesTypeextension is a string and uses only allowed characters (e.g. no spaces).Introduced in openPMD 2.0.0: openPMD/openPMD-standard#180