Repository navigation
Make date filtering for get_observations more inclusive - #381
Merged
Merged
Conversation
javierggt
reviewed
Mar 9, 2026
Contributor
There was a problem hiding this comment.
I totally agree with this change.
I wonder about the commands v2/v3 update. I think this change should work with commands v2, right? If I use KADI_CMDS_VERSION=2 I get a failure:
___________________________________________ test_get_observations_start_stop_inclusion ___________________________________________
def test_get_observations_start_stop_inclusion():
# Covers time from the middle of obsid 8008 to the middle of obsid 8009
obss = get_observations("2007:002:05:00:00", "2007:002:20:00:01", scenario="flight")
assert len(obss) == 2
# One second in the middle of obsid 8008
obss = get_observations("2007:002:05:00:00", "2007:002:05:00:01", scenario="flight")
assert len(obss) == 1
# During a maneuver
obss = get_observations("2007:002:18:05:00", "2007:002:18:08:00", scenario="flight")
> assert len(obss) == 0
E AssertionError: assert 1 == 0
E + where 1 = len([{'manvr_start': '2007:002:18:04:39.216', 'npnt_enab': True, 'obs_start': '2007:002:18:08:39.216', 'obs_stop': '2007:003:07:12:50.440', ...}])
kadi/commands/tests/test_commands_v2.py:1056: AssertionError
==================================================== short test summary info =====================================================
FAILED kadi/commands/tests/test_commands_v2.py::test_get_observations_start_stop_inclusion - AssertionError: assert 1 == 0
I'm guessing it's just that the test needs to be updated as well.
2 tasks done
Member
Author
|
@javierggt - I fixed the test and documented the v2 testing. |
javierggt
approved these changes
Mar 9, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently the date filtering for
get_observationsandget_starcatsis the intersection of the suppliedstartandstopinterval with the intervalsobs_starttoobs_stopfor each observation. Theobs_start/stoprepresent the time in nominally in Kalman tracking stars. This definition is not so convenient in practice, for instance something this gives a surprising and unhelpful result:This PR changes the filtering to go from
manvr_starttoobs_stop. This is going to return observations that are more in line with intuition in which the maneuver leading up to a NPNT dwell is all part of the observation.Interface impacts
Date-based queries that start or end within a maneuver may return additional observations relative to the previous version.
Testing
Unit tests
Commands v2
Independent check of unit tests by Javier
Functional tests
No functional testing.