Skip to content
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

[ESRF Specific files] - Cleanup, deletion and linting of ESRF specific files #1123

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

marcus-oscarsson
Copy link
Member

Cleanup, deletion and linting of ESRF specific files:

  • Removed unsued files
  • Linted and cleaned up a few others
  • Improved logging

if USER_CLICKED_EVENT and not USER_CLICKED_EVENT.ready():
logging.getLogger("HWR").debug("DEBUG: USER_CLICKED_EVENT: false")

# Clear ready flag incase it was stuck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Clear ready flag incase it was stuck
# Clear ready flag in case it was stuck

if x < 0 or y < 0:
for i in range(1, 18):
# logging.info("loop not found - moving back %d" % i)
logging.getLogger("HWR").info("loop not found - moving back %d" % i)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logging.getLogger("HWR").info("loop not found - moving back %d" % i)
logging.getLogger("HWR").info("loop not found - moving back %d", i)

move_motors(SAVED_INITIAL_POSITIONS)
raise

# logging.info("X=%s,Y=%s", X, Y)
# logging.getLogger("HWR").info("X=%s,Y=%s", X, Y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing this line or changing it to debug level log:

logging.getLogger("HWR").debug("X=%s,Y=%s", X, Y)

Comment on lines +467 to +474
# logging.getLogger("HWR").debug(f"Click at {x}, {y}")
except Exception:
logging.exception("Exception while centring")
logging.getLogger("HWR").exception("Exception while centring")
move_motors(SAVED_INITIAL_POSITIONS)
READY_FOR_NEXT_POINT.set()
raise RuntimeError("Exception while centring")

# logging.info("X=%s,Y=%s", X, Y)
# logging.getLogger("HWR").debug("X=%s,Y=%s", X, Y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest turn the commented out debug log lines to actual code.

In principle, a verbose debug logging is not a problem. Debug logging can (should) be disabled when running in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants