Closed yousefmoazzam closed 1 month ago
One solution to this would be:
yaml_templates/
to httomo/yaml_templates/
parent_dir
in yaml_checker.py
to parent_dir = Path(__file__).parent
Thus, both:
pip install
of httomowould have the same relative path from yaml_checker.py
to the yaml_templates/
dir.
Regardless of if/when #300 is done, there is still something else to deal with.
Assume the root directory for the httomo repo being used for the source for an installation is
/scratch/user/httomo
, and that the root directory for httomo when installed in a conda env is/dls_sw/apps/httomo/2.0.0rc1/lib/python3.10/site-packages/httomo
The YAML checker file
yaml_checker.py
is in the subdir/scratch/user/httomo/httomo/yaml_checker.py
, and the YAML templates when in version control in the repo are in the root directory/scratch/user/httomo/yaml_templates
.When running httomo locally in dev mode, this allows the following code to correctly find the YAML templates dir relative to the
yaml_checker.py
file: https://github.com/DiamondLightSource/httomo/blob/8b77eb0776b1ae02d4832e5878752051fce1213d/httomo/yaml_checker.py#L347However, when httomo is installed via
pip install
orconda install
into/dls_sw
, the root directory stuff like/scratch/users/httomo/pyproject.toml
is not copied to the conda env, only the contents of/scratch/user/httomo/httomo
subdir is copied. Hence, the dir for httomo in the conda env has only the contents of/scratch/user/httomo/httomo
in/dls_sw/apps/httomo/2.0.0rc1/lib/python3.10/site-packages/httomo
.This means that the only place to copy the YAML templates would be
/dls_sw/apps/httomo/2.0.0rc1/lib/python3.10/site-packages/httomo/yaml_templates
.However, notice in that situation,
yaml_checker.py
are now adjacent to each other rather thanyaml_checker.py
being in a dir "below" the YAML templates dir.Ie, compare:
to
and it becomes clearer that their locations relative to each other will change if the YAML templates are copied to the "root httomo dir" in the conda env.
This essentially requires the path of the YAML templates dir in the YAML checker to be changed to:
and is what was done to hackily install httomo in
/dls_sw
to make it work