Fixing loading ASDF files from a directory#503
Merged
Cadair merged 13 commits intoDKISTDC:mainfrom Jan 28, 2025
Merged
Conversation
6a0d149 to
ce6e6fa
Compare
a36da67 to
211e99d
Compare
9a36da8 to
3ba67b1
Compare
eigenbrot
approved these changes
Jan 27, 2025
Contributor
eigenbrot
left a comment
There was a problem hiding this comment.
IMO, what the parsing lacks in concision it makes up for in clarity (the good comments help, too!).
| if len(candidates) == 1: | ||
| asdfs_to_load += candidates | ||
| else: | ||
| # Now we group by prefix |
Contributor
There was a problem hiding this comment.
Small thing, but I think "prefix" in the follow context just means "everything that isn't the suffix", which confused me a bit. Would stem be a better name (taking a hint from pathlib.Path)?
Member
Author
There was a problem hiding this comment.
stem also feels overloaded because it's everything in the filename which isn't .asdf.
Contributor
There was a problem hiding this comment.
Yeah, good point. I'm fine with whatever.
Member
Author
There was a problem hiding this comment.
I can not think of a good word.
Hyzerputt
approved these changes
Jan 27, 2025
fraserwatson
approved these changes
Jan 27, 2025
Cadair
added a commit
that referenced
this pull request
Jan 29, 2025
* Add a regression test and docs for new path loader [ci skip] * Oh god what have I done * Better ordering invariance * Add a partial match test * Add a warning for any skipped files * Add changelog * This should never be hit * Add more test cases of multiple patterns * DKIST dataset IDs are 5 or more uppercase letters * Dataset IDs must be at least 5 characters * Add a regex test for <5 char dataset ids * More review comments --------- Co-authored-by: Fraser Watson <[email protected]>
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.
fixes #496
I am not super happy with the parsing code, so if anyone has any suggestions for making it better I am very open to improving it.