Skip to content

ASB-36065: Adding validation for CCSP and MCCM filenames#36

Open
astrojimig wants to merge 7 commits intodevfrom
ASB-36065_pit_filenames
Open

ASB-36065: Adding validation for CCSP and MCCM filenames#36
astrojimig wants to merge 7 commits intodevfrom
ASB-36065_pit_filenames

Conversation

@astrojimig
Copy link
Copy Markdown
Collaborator

@astrojimig astrojimig commented May 4, 2026

Adding support for validating CCSP and MCCM filenames!

Overview of changes:

  • Moderate refactor: splitting the previous hlsp_filename.py module into two files: filename_fields.py and filename_classes.py to make things a little more modular
  • New CCSPFilename and MCCMFilename classes in filename_classes.py, along with the old HLSPFilename - where the order of fields for each is defined. The type is determined by the prefix: If a file starts with hlsp_, it gets routed to the HLSPFilename validator, etc.
  • HlspField has been renamed to PrefixField and now accepts hlsp, ccsp, and mccm.
  • New field object "StringLiteralField" for matching a literal string in specific cases (for the _thumb exceptions in CCSP/MCCM filenames)
  • Some misc. variable re-naming to make things more generic (for example: "hlsp_name" -> "collection_name"
  • Adding Roman filters to oif.yaml
  • Updating/adding tests for everything

The entry point is identical to what it was before, for example:

mct check_filename ccsp_rapid_wfi_mwc560-r003_f062_v1_img.asdf
mct check_filenames <collection_name> --directory=<directory name>

Try it out yourself and let me know what you find! If you have any suggestions for more test cases (specific edge cases or weird things that should fail), that would be especially helpful.

Still to do:

  • Updating readme/documentation to indicate that CCSP/MCCM filenames are supported: do this after Adding sqlite tutorial #31 is merged to avoid conflicts!

@adrianlucy
Copy link
Copy Markdown
Collaborator

Thanks Julie, this is sounding great!! I'll aim to provide any initial high-level feedback before I go on vacation Friday, and do more detailed checks when I get back later in May.

@AlexReedy
Copy link
Copy Markdown
Collaborator

Agreed with Adrian Julie this is looking great! The commands are working for me and returning what I would expect for various HLPS.
I have attempted:

  • ccsp_rapid_wfi_mwc560-r003_f062_v1_img.asdf (pass)
  • hlsp_smiles_jwst_miri_goodss_f1000w_v1.0_drz.fits (pass)
  • hlsp_pie_hst_wfc3-uvis_field01_f336w_v1_model-psf.fits (needs review)
  • hlsp_pie_hst_wfc3-uvis_field01_f336w_v1_driz.fits (needs review)
  • hlsp_pie_hst_wfc3-uvis_field01_f336w_v1_drz.fits (needs review)
  • hlsp_pie_hst_wfc3_field01_f336w_v1_drz.fits (pass)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants