Skip to content

Update Query version latest filtering#319

Open
pleasant-menlo wants to merge 2 commits into
IMAP-Science-Operations-Center:mainfrom
pleasant-menlo:version-latest-considers-instrument-data-level-descriptor-repoint
Open

Update Query version latest filtering#319
pleasant-menlo wants to merge 2 commits into
IMAP-Science-Operations-Center:mainfrom
pleasant-menlo:version-latest-considers-instrument-data-level-descriptor-repoint

Conversation

@pleasant-menlo
Copy link
Copy Markdown
Contributor

Change Summary

Before this change, querying with version=latest only returned one file per start date. The desired behavior is that this should return multiple files for each day if the query returns files with multiple descriptors, or if there are multiple repointings in a single day.

Querying with version latest now only excludes a file if there is a higher-version file with matching instrument, data level, descriptor, start_date, and repointing.

imap-data-access query --instrument glows --data-level l3e --descriptor survival-probability-hi-45 --version latest --start-date 20260407 --end-date 20260408

Used to return

 imap_glows_l3e_survival-probability-hi-45_20260407-repoint00209_v006.cdf
 imap_glows_l3e_survival-probability-hi-45_20260408-repoint00212_v006.cdf 

And now returns

imap_glows_l3e_survival-probability-hi-45_20260407-repoint00209_v006.cdf
imap_glows_l3e_survival-probability-hi-45_20260407-repoint00210_v001.cdf
imap_glows_l3e_survival-probability-hi-45_20260407-repoint00211_v001.cdf
imap_glows_l3e_survival-probability-hi-45_20260408-repoint00212_v006.cdf

We believe this closes #289

…_level, descriptor, start_date, and repointing matching but a lower version
Copy link
Copy Markdown
Contributor

@tmplummer tmplummer left a comment

Choose a reason for hiding this comment

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

Thanks for putting up this PR. Looks good to me, but I am going to add some reviewers to get a second set of eyes on this.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates version="latest" query filtering so results keep the latest file per instrument/descriptor/data level/start date/repointing combination instead of only one file per start date.

Changes:

  • Replaces start-date-only latest filtering with a composite key.
  • Adds parametrized tests covering repointing, descriptor/data-level separation, multi-day filtering, ancillary data, and non-latest passthrough.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
imap_data_access/io.py Updates client-side latest-version filtering logic.
tests/test_io.py Adds regression coverage for the new latest filtering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imap_data_access/io.py
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.

BUG - latest version flag does not return all expected files

3 participants