Coverage for model_workflow/__init__.py: 45%
11 statements
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-23 10:54 +0000
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-23 10:54 +0000
1import os
2import subprocess
4name = "model_workflow"
5__all__ = ["resources", "tools", "utils"]
7# Workaround to fix ReadTheDocs build issue with conda environments
8# when fix_gromacs_masses and helical_parameters are called.
9if "CONDA_PREFIX" not in os.environ:
10 try:
11 # Get the path of the python executable
12 python_path = subprocess.check_output(["which", "python"], text=True).strip()
13 # Extract the directory path (one level up from bin/python)
14 conda_prefix = os.path.dirname(os.path.dirname(python_path))
15 # Set the environment variable
16 os.environ["CONDA_PREFIX"] = conda_prefix
17 except subprocess.SubprocessError:
18 print("Warning: Could not determine CONDA_PREFIX from 'which python'")