-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add infrastructure to filter command events to get alternate command history #351
Conversation
Ensure that cmd_events from a local scenario file are treated the same as those from a Google sheet. When writing a Google sheet to a local scenario file, do not do any filtering first.
b22500f
to
c0290c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
The only thing overall that I note is that "filter" as a verb always feels very ambiguous to me in that it isn't clear from the outset if the filter condition is the thing you want or the thing you don't want. Here you've gone with setting the filter conditions to get the items you don't want (the "filter out" strategy) which is fine. I think all the labeling, method names, and docstrings line up with this, but I note that for me it is easy to get tripped up by the verb. |
Noted. Hopefully the docs are clear enough that the filter function returns a mask of the events that you are keeping. This is consistent with the kadi events "filter()" method. Maybe the |
Description
This PR adds infrastructure to filter command events to get alternate command history:
event_filter
kwarg inget_cmds
,get_states
,get_continuity
,get_observations
,get_starcats
,get_starcats_as_table
functions.event_filter
is a function that takes a command events table (e.g. from the google sheet) andreturns a boolean mask that selects events to keep.
filter_scs107_events
that removesevents normally associated with an SCS-107 run.
Adding this event filtering was not initially compatible with the caching mechanism for recent commands (within the last 30 days). Previously the cache key was just the
scenario
, but this did not account for changes to:CXOTIME_NOW
current time mockingconf.default_lookback
).So the cache key was changed to include those along with the
event_filter
.These changes ended up challenging my ability to keep straight the flow and dependencies in the core commands code, so I ended up improving the code:
get_default_stop
->get_cxotime_now
).Interface impacts
State
column in a local scenario command events file was being ignored. Now it behaves like the google sheet and (if that column is present), events are filtered accordingly. I.e. onlyPredictive
andDefinitive
are allowed.event_filter
kwarg toget_cmds
,get_states
,get_continuity
,get_observations
,get_starcats
,get_starcats_as_table
functions.Testing
Unit tests
Independent check of unit tests by Jean
Functional tests
No functional testing.