Maintainers

Creating a Toolbox environment in the proposal folder

A Toolbox environment can be created by running the following commands in Maxwell:

module load exfel exfel-python
scs-create-toolbox-env --proposal <PROPOSAL>

where <PROPOSAL> is the desired proposal number. This will create a Python environment and will download and install the Toolbox source code. It will result to the creation of the following folders in the path <PROPOSAL_PATH>/scratch.

<PROPOSAL_PATH>/scratch/
├─ checkouts/
│  ├─ toolbox_<PROPOSAL>/
│  │  ├─ <source code>
├─ envs/
│  ├─ toolbox_<PROPOSAL>/
│  │  ├─ <Python files>

The checkouts folder contains the Toolbox source codes, correspondingly labeled according to the environment identifier, which is the proposal number by default. The downloaded code defaults to the master version at the time when the environment is created.

The envs folder contains the Python environment with the packages necessary to run the Toolbox. It is also correspondingly labeled according to the environment identifier, which is the proposal number by default.

Note

One can find the proposal path by running findxfel <PROPOSAL>.

It is a good practice to tag the Toolbox version at a given milestone. This version can be then supplied to the script as:

scs-create-toolbox-env --proposal <PROPOSAL> --version <VERSION>

It might also be helpful to supply an identifier to distinguish environments from each other. This can be done by running:

scs-create-toolbox-env --proposal <PROPOSAL> --identifier <IDENTIFIER>

The environment would then be identified as toolbox_<IDENTIFIER> instead of toolbox_<PROPOSAL>.

Installing additional packages

In order to install additional packages in a Toolbox environment, one should run the following commands:

cd <PROPOSAL_PATH>/scratch/
source envs/toolbox_<IDENTIFIER>/bin/activate
pip install ...

There’s no need to load the exfel module.

Updating the source codes

Should there be desired changes in the Toolbox codes, may it be bug fixes or additional features during beamtime, one can freely modify the source codes in the following path: <PROPOSAL_PATH>/scratch/checkouts/toolbox_<IDENTIFIER>. The contents of this folder should be a normal git repository. Any changes can be easily done (e.g., editing a line of code, checking out a different branch, etc.) and such changes are immediately reflected on the environment.