Skip to content

Support for type=spin/repoint/thruster/kernels for the spice-query api - #1552

Open
leowerneck wants to merge 6 commits into
IMAP-Science-Operations-Center:devfrom
leowerneck:lw/issue911
Open

Support for type=spin/repoint/thruster/kernels for the spice-query api#1552
leowerneck wants to merge 6 commits into
IMAP-Science-Operations-Center:devfrom
leowerneck:lw/issue911

Conversation

@leowerneck

Copy link
Copy Markdown

This is a slight rewrite of #1250 by @vineetbansal, which splits some of the new tests for better granularity and introduces a helper function to ensure consistent formatting of the response output.


Change Summary

Fixes issue #911

Added support to query non-SPICE tables (spin/repoint/thruster) using the /spice-query endpoint.

The type parameter decides which table to query - kernels searches through the spice table. Other possible values are spin, thruster, or repoint, which delegate to the existing lambda in non_spice_table_api.py.

When the type parameter is not set, it is assumed to be kernels, preserving legacy behavior. A type parameter set to a specific kernel type like spacecraft_clock still works as before.

Parameters like file_name, start_time and end_time that the SPICE api already supports are now mapped to the non-SPICE API, so the caller has to go through minimal changes to start using these.

File changes

  • Main functionality added to spice_query_api.py that internally calls non_spice_tables_api.
  • I had to move an import in spice_metakernel_api.py to where it is used to get around a circular import issue (spice_utilities.py imports spice_metakernel_api and spice_metakernel_api.py imports spice_utilities).

Testing

  • Added a test to test_spice_query_api.py to ensure that type parameter is interpreted correctly for SPICE tables.
  • Added tests to test_spin_api.py to ensure that calls made through spice_query.api return expected responses. Existing tests left intact, so the old API endpoints work as well.

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.

1 participant