Closed oldfielj-ansto closed 1 year ago
Still a work in progress, not ready to merge.
Looks really nice !. I'm not entirely up to speed with typhints so maybe there is something I did not understand with how Union[str, Any]
is used. Would not simply Any
be enough ?. Or is it more to signal that it should be str but its in reality in many cases not a str and so Union[str, Any]
is partly used for documentation ?
Hey @oldfielj-ansto, do you think you can rebase this when you get the time to solve the conflicts, then Ill merge. Thanks !
This is very, very good. As yuou see I have some suggestions/questions, but I would not insist on holding this up - we can always come back to them.
In a way it is too bad to have done so much work on (e.g.) HardwareObjectNode when,. (IMHO) it ought to be deprecated. But it is great to have a start on introducing type annotations.
Thanks, I still think it's worth doing it while these objects aren't fully deprecated, even then, they may be around for a while yet for legacy compatibility reasons while facilities update their codebases.
Looks really nice !. I'm not entirely up to speed with typhints so maybe there is something I did not understand with how
Union[str, Any]
is used. Would not simplyAny
be enough ?. Or is it more to signal that it should be str but its in reality in many cases not a str and soUnion[str, Any]
is partly used for documentation ?
Thanks, the section @rhfogh commented on has been updated to simply be typed as "str". As mentioned above, I mostly just did this to indicate that I was fairly sure a string was the expected type, but wasn't entirely sure, so left the typing open.
Hey @oldfielj-ansto, do you think you can rebase this when you get the time to solve the conflicts, then Ill merge. Thanks !
Sorry @marcus-oscarsson I've been pretty busy with other parts of the MX3 implementation, haven't had a chance till now to follow up on this.
I've tidied things up and rebased my changes onto the latest commit.
Great !, thanks for all this nice work !
This PR adds type hinting and low level hardware object test cases.
Currently the goal is to add type hinting and test cases for each class defined in the modules BaseHardwareObjects.py and BaseHardwareObjects.py, which has not yet been deprecated.
Once these test cases are completed it will be a lot simpler to create test cases for the abstract hardware objects, as all the low level logic can be patched over using MagicMocks.