-
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
Addition of reflector CSC #2
Conversation
1b73839
to
b453900
Compare
388abf7
to
a2ba5ff
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.
Please add a setup.py file using one of the other repos as a template, this is still required for conda recipe version metadata.
a2ba5ff
to
767a12a
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 pretty good but there is an unnecessary duplicate schema definition and I disagree with the LabjackChannel class. For the rest please review all doc strings and error messages and make sure they follow our coding guidelines.
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 a lot better. you missed a few of my earlier comments even though you indicated that you didn't. Also, please improve the code as indicated by my new comments. We're getting 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.
More comments added.
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 much better. Please make sure to go to FAULT whenever a RuntimeError happens.
async def connect(self) -> None: | ||
"""Connect to the labjack.""" | ||
self.configure() | ||
try: |
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.
If you move the self.log.exception
line to the write_channel
method, you can remove the try/exception block.
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 think I still need it for the raising the RuntimeError.
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.
If you
- remove the try/except block on lines 112 to 115
- raise RuntimeError in (the current) line 120
then you can get rid of the try/except in theconnect
method.
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.
Almost there. If we fix the run
and connect
methods as I indicated, we're done.
Oh and the CSC still needs to go to FAULT state whenever a RuntimeError happens. |
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.
LGTM. Please improve that one error message as per my suggestion.
python/lsst/ts/mtreflector/csc.py
Outdated
""" | ||
if self.controller is None: | ||
raise RuntimeError( | ||
"CSC Tried to use reflector controller without a valid object." |
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.
Please improve this error message. Something like Reflector controller is None.
would be much clearer.
8ff5152
to
63cc013
Compare
No description provided.