Skip to content

BUG - Enable querying by filename - #362

Merged
leowerneck merged 3 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:355-bug----query---filename-filename--does-not-work
Oct 13, 2026
Merged

leowerneck merged 3 commits into
IMAP-Science-Operations-Center:mainfrom
leowerneck:355-bug----query---filename-filename--does-not-work

Conversation

@leowerneck

Copy link
Copy Markdown
Contributor

Change Summary

Closes #355.

Overview

This PR introduces the following syntax:

imap-data-access query FILENAME

in addition to the standard (and still supported)

imap-data-access query [options]

Note that passing any querying options after (or before) FILENAME will result in an error, since all query parameters are extracted from FILENAME.

File changes

  • imap_data_access/cli.py: changed how the CLI parses command line arguments.
  • tests/test_cli.py: added tests for the new CLI syntax.
  • examples/api_demo.ipynb: added new syntax example

Testing

Running:

uv sync --extra test
uv run pytest tests

results in 148 tests passing.

@leowerneck
leowerneck requested a balanced review from Copilot October 12, 2026 20:03
@leowerneck leowerneck self-assigned this Oct 12, 2026
@leowerneck leowerneck added the bug Something isn't working label Oct 12, 2026
@leowerneck leowerneck added this to IMAP Oct 12, 2026
@leowerneck leowerneck moved this to PR Open in IMAP Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Legacy science filenames can return no results, and explicit default-valued query options bypass conflict validation.

2 open findings
What changed in this PR

Adds positional filename querying while retaining option-based queries.

Changes:

  • Derives query parameters from science, ancillary, and SPICE filenames.
  • Rejects filenames combined with query options.
  • Adds tests and updates the API demo.
File Description
imap_data_access/​cli.py Implements filename-based query parsing and filtering.
tests/​test_cli.py Tests supported filename types and conflicting options.
examples/​api_demo.ipynb Updates the filename-query example.

🧠 Review effort: 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/cli.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation addresses the reported query failures and is adequately covered by focused tests.

0 open findings

2 resolved since last review

🧠 Review effort: 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.

Looks good to me!

@leowerneck
leowerneck merged commit 4161d0f into IMAP-Science-Operations-Center:main Oct 13, 2026
16 checks passed
@leowerneck
leowerneck deleted the 355-bug----query---filename-filename--does-not-work branch October 13, 2026 16:54
@github-project-automation github-project-automation Bot moved this from PR Open to Done in IMAP Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

BUG - query --filename FILENAME does not work

3 participants