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

Move McStas configuration out of notebooks #91

Open
jl-wynen opened this issue Sep 4, 2024 · 1 comment
Open

Move McStas configuration out of notebooks #91

jl-wynen opened this issue Sep 4, 2024 · 1 comment

Comments

@jl-wynen
Copy link
Collaborator

jl-wynen commented Sep 4, 2024

Currently, McStas is configured in the notebooks with

my_configurator = ms.Configurator()
my_configurator.set_mcrun_path("/usr/bin/")
my_configurator.set_mcstas_path("/usr/share/mcstas/3.4/")

This is needed to build the book in CI. But is is incorrect on most client's machines. Including the schools JupyterHub. So move it from the notebooks somewhere else. E.g., into the CI script.

@willend
Copy link
Collaborator

willend commented Sep 4, 2024

In the school JupyterHub McStas is detected by McStasScript by means of the $MCSTAS env var and which mcrun.
(see https://github.com/PaNOSC-ViNYL/McStasScript/blob/6bbe6faf8129065cde82d3dac688ab0c6d5154c0/mcstasscript/interface/instr.py#L2997-L2999)

In e.g. conda the env var is automatically set. A relevant export MCSTAS=value could e.g. be probed via mcrun --showcfg=tooldir and set in in the CI after installation (assuming that mcstas/mcrun is on the PATH)

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

2 participants