ScienceFilePath release version format#324
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the ScienceFilePath filename/version handling to support the new vRRR.MMM schema (release + data version) while maintaining backward compatibility with the deprecated vXXX format, and adapts query “latest” resolution and tests accordingly.
Changes:
- Extend science filename parsing/validation to accept
vRRR.MMMand extractrelease_number/data_versioncomponents. - Update query parameter validation and “latest version” selection logic to account for the new version format.
- Adjust and add tests to cover the new version format and backward compatibility behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
imap_data_access/file_validation.py |
Adds parsing/validation support for vRRR.MMM and exposes release_number / data_version. |
imap_data_access/io.py |
Validates version differently for science queries and updates “latest” selection to use a version sort key. |
tests/test_io.py |
Updates version-related expectations and adds coverage for version=latest with new format. |
tests/test_file_validation.py |
Updates filename parsing tests for vRRR.MMM and adds deprecated-format coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tech3371
left a comment
There was a problem hiding this comment.
I had couple comments but overall looks good to me!
52c0b22 to
2561259
Compare
tech3371
left a comment
There was a problem hiding this comment.
looks good to me. Thank you for looking at all places and finding holes to fill! I forgot about webpoda and nice find!
205c67f to
8ef22a0
Compare
tech3371
left a comment
There was a problem hiding this comment.
I made minor suggestions for new major and minor outcomes. This PR still applies nicely.
|
@lacoak21 - I'm enumerating all the places in
Given these (assuming I haven't missed any), I think it would be nice for this PR to provide functionality for:
Perhaps introducing a Of course this functionality is not a must-have, but then we'll be duplicating a lot of this versioning logic in |
Thanks! Yep I outlined what needed to be changed during the meeting. |
Thanks Vineet for those thoughts! That is a great idea. I will go through these and see where they fit within this PR. |
|
@vineetbansal looks like a lot of those could use ScienceFilePath.is_valid_version() which is already implemented in this PR. It uses the VALID_VERSION_PATTERN so seems like 5 and 6 are taken care of unless i am mistaken. I will try to capture the rest in more functions. What gets tricky is that this new version format is only used for science files and NOT ancillary or spice files so we have to be aware of that in imap_processing. |
|
@lacoak21 - yes -
should cover most use cases.
The whole concept of major/minor can be hidden from callers by using a new EDIT: The functions should probably just return well-formatted-and-padded |
OK this sounds good! I dont think its so overkill here. |
ba8e747 to
7d00569
Compare
| ) | ||
|
|
||
|
|
||
| class Version: |
There was a problem hiding this comment.
@vineetbansal can you take a look at this class? Is there anything else its missing?
|
Thanks @lacoak21. Let me do a deep-dive into this PR and get back to you by tomorrow morning. |
|
This is cool! I'm wondering what you think about the following changes, which are incremental over what you've already done here: Right now So Everything else like Sorry to keep suggesting more changes, but I think this will make it super useful for callers. If you're understandably busy with other stuff but generally agree that this is useful, we can merge this (its usable already) and I can send another PR tomorrow on top of this (since then my work with |
Ah I see. I was wondering about this! I had assumed from your earlier message you wanted it stateless but I can make these updates! |
|
This is great and looks very clean. Thanks! I think the last thing to think about is that Jon mentioned in a meeting (and he has also outlined this in his detailed google doc), that existing files should be interpreted as having version 1, or "v001." (He mentions "SPDF requires start at 1"). I don't know what the plan was to regenerate version 1 files - i.e. does the version reported by |
|
@lacoak21 - I noticed that Also, |
I think we are good here? @tech3371 please let me know if that is not true in this case. Do we have a definite plan for this? |
I talked to tenzin and nothing needs to change here. |
|
40e6e6a
into
IMAP-Science-Operations-Center:main
Change Summary
closes #320
Overview
Update the ScienceFilePath version to contain release number information. Add backwards compatibility for old version format while we transition.
File changes
Testing
Fix tests and add new ones for new version format.