Skip to content

Support repointing field for ancillary files - #353

Merged
leowerneck merged 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:3386-glows---handle-repoint-number-in-filenames
Sep 14, 2026
Merged

leowerneck merged 2 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:3386-glows---handle-repoint-number-in-filenames

Conversation

@leowerneck

@leowerneck leowerneck commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR is required to close imap_processing:#3386 and imap_L3_processing:#126.

Summary

This PR adds repointing field to ancillary files, so that e.g.:

imap_glows_survival-probability-hi-45-raw_20241007-repoint00020_v012.dat

is now a valid ancillary file name.

The new ancillary file name grammar is:

<mission>_<instrument>_<descriptor>_<start_date>(_<end_date>)(-<repointing>)_<version>.<extension>

with <end_date> and <repointing> being optional and mutually exclusive.

Changes

  • AncillaryFilePath (imap_data_access/file_validation.py)
    • FILENAME_CONVENTION and the class docstring document the new optional -repointNNNNN field and its mutual exclusivity with end_date.
    • extract_filename_components parses the repointing into an int (or None). The end_date/repointing pair is expressed as a single alternation group in the regex, so a filename carrying both is rejected as invalid rather than silently accepted.
    • generate_from_inputs gained a repointing: int | str | None = None argument (accepts 12345 or "repoint12345"), appended last to stay positional-compatible. It raises InvalidImapFileError if both end_time and repointing are supplied, matching the existing CR/repointing guard on the science generator.
    • validate_filename reports a non-integer repointing (parity with the science validator).
  • cli.py: the ancillary --filename query dict now includes repointing.
  • Tests (tests/test_file_validation.py): added test_ancillary_file_path_repointing: int and "repointXXXXX" parsing, round-trip generation + construct_path, mutual-exclusivity rejection (both in the parser and the generator), and malformed-repointing rejection.

Coordinated rollout

One of three coordinated PRs for imap_processing:#3386. This PR should be merged first (1/3):

  1. imap-data-access:#353
  2. sds-data-manager:#1637
  3. imap_L3_processing:#196

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Filename-based CLI queries remain unusable, and integer repointing zero is incorrectly omitted.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds repointing-aware ancillary filenames to distinguish same-day GLOWS outputs.

Changes:

  • Parses and generates optional repointXXXXX fields.
  • Forwards repointing in CLI filename queries.
  • Adds ancillary filename validation tests.
File summaries
File Description
imap_data_access/file_validation.py Adds ancillary repointing support and validation.
imap_data_access/cli.py Adds repointing to ancillary query parameters.
tests/test_file_validation.py Tests parsing, generation, and invalid combinations.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread imap_data_access/cli.py
Comment thread imap_data_access/file_validation.py Outdated
@leowerneck
leowerneck requested a balanced review from Copilot September 10, 2026 16:28
@leowerneck leowerneck self-assigned this Sep 10, 2026
@leowerneck leowerneck added the enhancement New feature or request label Sep 10, 2026
@leowerneck leowerneck added this to IMAP Sep 10, 2026
@leowerneck leowerneck moved this to PR Open in IMAP Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation matches the documented filename grammar and covers key validation and round-trip cases.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@bryan-harter bryan-harter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me!

@leowerneck

Copy link
Copy Markdown
Contributor Author

Any objections to merging this? I need this one merged for tests to pass on the other 2 PRs.

@leowerneck
leowerneck merged commit 613470d into IMAP-Science-Operations-Center:main Sep 14, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from PR Open to Done in IMAP Sep 14, 2026
@leowerneck
leowerneck deleted the 3386-glows---handle-repoint-number-in-filenames branch September 14, 2026 16:24
@leowerneck leowerneck mentioned this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

GLOWS - Handle repoint number in filenames

3 participants