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

Warm up detectors conditionally #31

Open
mrakitin opened this issue Aug 2, 2021 · 0 comments
Open

Warm up detectors conditionally #31

mrakitin opened this issue Aug 2, 2021 · 0 comments

Comments

@mrakitin
Copy link
Member

mrakitin commented Aug 2, 2021

Current state

Right now the detectors are warmed up unconditionally, that may be an issue if another bsui session is started in parallel with the existing one (whether under the same account or under another account over ssh).

Examples:

Possible solution:

Wrap these calls to warmup() the detectors into the condition to check if we want to touch the beamline or not, using this standard function (still in the #19 PR branch):

def if_touch_beamline(envvar="TOUCHBEAMLINE"):
value = os.environ.get(envvar, "false").lower()
if value in ("", "n", "no", "f", "false", "off", "0"):
return False
elif value in ("y", "yes", "t", "true", "on", "1"):
return True
else:
raise ValueError(f"Unknown value: {value}")

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

No branches or pull requests

1 participant