-
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
Improve command states with better transition infrastructure #340
Conversation
I'm surprised that this ended up with conflicts. |
Overall, this feels like a large change so I'm just trying to puzzle out if we need any additional functional testing or if the module tests are more than enough. |
I agree this PR has a large footprint. However, I think the unit testing for states is really solid. In particular the regression testing has good coverage along with all the other unit tests of odd situations.
I think that the new state classes that were added (which are not part of the "standard states" list) all had unit testing in the respective PR's. At least I assume that you would not have approved a new state class without a unit test? |
And like you, I just ran the tests with coverage reporting. Overall the uncovered code seems unlikely to be impacted by this PR, but I guess that is the question to be answered. |
bfea926
to
1a6f5b5
Compare
Ugh, had to squash and rebase and fix a couple of unexpected merge conflicts. It seems OK now... 🤞 |
"At least I assume that you would not have approved a new state class without a unit test?" - there are no guarantees because of the evolution of code and us, but I think I always at least try to check to see "are the code changes introduced in this PR supported with unit tests, and if not, is there a good reason for that, and if that reason is valid are any such changes at least functionally tested". I think for this PR I also want to review the states diffs basically for the mission. |
This may be time consuming, but sure. If you are doing this, then make sure to check every possible state, not just the "standard" states. You should be comparing the outputs to current master, not the release since there will be state change outputs in master vs release. |
And of course as the reviewer you are free to ask me to do that validation. |
45ba7a1
to
29aa3d7
Compare
And update some docs / comments
29aa3d7
to
c40f3b4
Compare
With the new notebook from 02ca6b2, the diffs are below. They are all expected as a result of the fix to not include transitions from a schedule NMAN maneuver after the safe mode transition.
|
I did look further back, and one thing that may or may not be interesting is the NPNT transition for obsid 60399 in 2004. It looks like the maneuver to that ER was segmented. The new transitions infrastructure puts the NPNT transition 10 minutes later than the old transitions:
And from kadi events it looks like the old answer was better
I just looked back until 2004:001 and was a bit surprised by this change. |
This is the result of commands from this maneuver-only load not being included in the 2004 commands: Basically that missing maneuver sets off a chain of issues because kadi is predicting the wrong maneuver time. Commanded states (both in master and with this PR) are just wrong, but e.g. in master you find the pitch changing rapidly while in NPNT. With the new code things are different for the subsequent segmented manuever you highlighted because it refuses to apply attitude updates in NPNT, so those maneuvering-in-NPNT commands are dropped. Anyway, after 2.5 hours of investigation I can confirm that this is not interesting. |
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.
Looks good to me - with solid testing. And thanks for looking into the one historical oddity I ran into that turned out to be a cmds error and not a regression.
Description
Improve code and processing of state transitions.
In particular provide the infrastructure to allow state-dependent filtering of scheduled callback transitions. The real-life test case here is a safe mode that occurred during a maneuver. The current code ends up applying all the scheduled transitions so that the attitude bounces around and there is a transition to
pcad_mode = NPNT
in the safe mode. This PR fixes that.Details:
Transition
class which is used for every transition. This inherits fromdict
and includesdate
andstate_constraints
attributes.TransitionCallback
class for callbacks. Previously this was handled by setting the state value to a function.This sometimes required use of
functools.partial
and things got a bit awkward.__init_subclasses__
method instead of a metaclass to populate the global states registries.Interface impacts
Testing
Unit tests
Independent check of unit tests by Jean
Functional tests
No functional testing.