-
Notifications
You must be signed in to change notification settings - Fork 0
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
DM-46179 Extend TCS readiness check to other image types beyond OBJECT #170
Conversation
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.
It mostly look ok but I do have some comments about how you did the unit tests.
tests/test_generic_camera.py
Outdated
fake_tcs.fail = False | ||
methods = self.image_types.get(img_type) | ||
if not methods: | ||
self.fail( |
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.
Why not just raise an exception? You could do something like
assert not methods, f"Image type '{img_type}' not found in image_types mapping."
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.
ok, let me try that, I was trying to get around a mypy issue, that was thrown on the method signature type.
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.
Ok, by changing the assertion to specifically check for the None type quieted mypy.
tests/test_generic_camera.py
Outdated
|
||
assert_take_method = getattr(self, assert_method_name, None) | ||
if assert_take_method is None: | ||
self.fail( |
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.
See comment above.
tests/test_generic_camera.py
Outdated
with self.subTest(image_type=img_type): | ||
methods = self.image_types.get(img_type) | ||
if not methods: | ||
self.fail( |
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.
See comment above.
tests/test_generic_camera.py
Outdated
with self.subTest(image_type=img_type): | ||
methods = self.image_types.get(img_type) | ||
if not methods: | ||
self.fail( |
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.
See comment above
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.
I only have a few inline comments. Also, please add a second news fragment for the idl -> xml updates you did and for the fix to the MTRotator enumeration. I think the first one can be added in a file called DM-46179.removal.rst
and the second one to DM-46179.bugfix.rst
.
Also, I am ready to approve the PR after you make these updates so feel free to re-organize the git history.
if ( | ||
imgtype in ["OBJECT", "ENGTEST", "ACQ", "CWFS"] | ||
and self.ready_to_take_data is not None | ||
): |
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.
A couple line below (line 983) there is another elif
that needs updating. It warns users that the TCS synchronization feature is not configured. You might want to extract the list into a variable to use in both places, e.g.:
sync_imgtypes = ["OBJECT", "ENGTEST", "ACQ", "CWFS"]
if imgtype in sync_imgtypes:
...
.- Added image types ENGTEST, ACQ and CWFS to take_imgtype method in the BaseCamera class for tcs readiness checks. This requires the camera attribute: `tcs_ready_to_take_data` to be set. .- enums: in mtcs_async_mock.py replace MTRotator.EnabledSubstate from INITIALIZING to STATIONARY and point enums from idl package to the new xml one. .- Added unit tests methods for this logic.
6ede231
to
f3cf295
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.
Looks good!
No description provided.