-
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
Fix continuity issue related to transitions beyond continuity time #126
Conversation
@taldcroft I think I'm following this (what the problem was and how you've addressed it), but if you have time, some more text in the PR description would be helpful. Thanks! |
@jeanconn - that's an excellent request. I have updated the description. |
BTW I am happy that the infrastructure in kadi commands states lends itself to this solution which is completely general for any possible dynamic states. In particular there is no need for any kind of ad-hoc solutions like backing up to the previous NPM, which is not enough here because you have other states ( |
Since it is so tiny I tossed in a fix for #127 here. |
I note that this is the first fix we've had in a while that will go into both ska2 and ska3. |
Could this be a driver to finally:
This is all infrastructure and might take more time than just installing [1], but you were saying you wanted to spend some effort on infrastructure now that sparkles/proseco is wrapping up. [1] - though I wonder when you count the GRETA network. |
Regarding the bullets in #126 (comment) Do you mean the fact that we still need to install this in ska2 is a driver to do the rest? I somewhat see where you are going, but think it is easier to just install kadi 3.16.4 in ska2 now and deal with the rest as it comes. You've noted the validate_states update that would also be required for the Ska3 transition. Meaning I do want to fix some things that are broken in infrastructure but still think we have higher-priority elements than this. (And I had a starcheck concern related to the fact that we're still using sybase star histories... not because the star histories are in sybase but because I thought the code that updates the star histories was using sybase cmd_states, but it looks like it isn't using cmds or cmd_states at this time). And I don't know what MTA is using. Do we need to set /proj/sot/ska/bin/get_cmd_states (ska2) to warn about sybase being deprecated? Is there a get_cmd_states somewhere for ska3? And I am also not clear about which version Larry is using. |
@@ -1159,13 +1167,22 @@ def get_states(start=None, stop=None, state_keys=None, cmds=None, continuity=Non | |||
# reference the last state in the list. | |||
state = states[0] | |||
|
|||
# List of transitions that occur *after* the ``stop`` date but are needed for |
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.
This comment would be less confusing to me if it mentioned that these transitions are all from the commands (cmds
) still in the continuity ranges (all before stop
).
stop
is also a confusing name for me here (date
-> stop
and really it is just the reference time for continuity, not a start
-> stop
range, but that's neither here nor there).
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.
When get_continuity() calls get_states(), it always supplies continuity={} so that there is no circularity.
It still feels circular, or at least bootstrap-py, but makes sense, is simple overall, and seems to work. The added tests also look good, but I haven't spent enough time in here to comment much on how sufficient the coverage really is.
This is a critical bug fix that should be released ASAP.
This adds explicit handling in continuity for the list of transitions that occur after the
stop
date but are needed for continuity. The classic example is for maneuvers if starting in the middle of a maneuver, but this also occurs for SPMEnableTransition which puts commands into the future.The flow is as follows. It might seem a bit circular at first but is not:
get_states()
collects all such "future" transitions and puts them intostates.meta['continuity_transitions']
.get_states()
that has no "future" or "leftover" transitions, this is an empty list.get_states()
looks for a__transitions__
key in the suppliedcontinuity
, and if it exists uses that to initialize thetransitions
dict that gets assembled in dynamic state processing.get_continuity()
collects any "future" transitions from its internal calls toget_states()
into a list and stores them in the__transitions__
key in the continuity dict.get_continuity()
callsget_states()
, it always suppliescontinuity={}
so that there is no circularity.Fixes #125
Fixes #127