magmap.io.load_env module¶
Cross-platform environment activation and MagellanMapper launcher script.
Launches MagellanMapper within a Conda or Venv environment. Environment activation is in this order: * If a Conda or Venv environment is already activate, launch in current
environment
Attempt to activate a Conda environment
Attempt to activate a Venv environment
This script is designed to run MagellanMapper without assuming that a Python environment has been activated. It does assume that an environment has been generated and can be identified.
Executing this script as a text file (ie not through Python directly)
assumes that the python command is accessible without a Python
environment. Use bin/runaltpy.sh instead if only python3 is
available (eg on Linux) or python is only available through Conda.
Conda activation assumes that the conda command is accessible, typically
from a previous initialization through conda init (preferred) or
by adding the conda binary directory to the PATH. Note that conda
may not be available in environments that do not load the full shell
configuration such as Python launched via Finder in the macOS platform.
- magmap.io.load_env.ARGS_MAGMAP = ['python -u -c "from magmap.io import cli; cli.main(); from magmap.gui import visualizer; visualizer.main()" -T -b html -d _build/doctrees -D language=en . /home/docs/checkouts/readthedocs.org/user_builds/magellanmapper/checkouts/stable/_readthedocs//html']¶
Shell commands to launch the MagellanMapper.
- Type:
List[str]
- magmap.io.load_env.is_conda_activated()[source]¶
Check whether the MagellanMapper Conda environment is active.
The environment name does not have to exactly match
ENV_NAMEbut at least start with this name to provide some flexibility for different versions of this environment, such asmag2.
- magmap.io.load_env.is_venv_activated()[source]¶
Check whether a Venv or virtualenv environment is active.
- Returns:
True if the environment is activated.
- magmap.io.load_env.launch_magmap()[source]¶
Launch MagellanMapper.
First launch the CLI to process user arguments, which will shut down the process afterward if a CLI task has been selected. If the process remains alive, the GUI will be launched.
- magmap.io.load_env.launch_subprocess(args, working_dir=None, sys_shell=False)[source]¶
Launch a subprocess with multiple commands strung together by logical ands.
- Parameters:
- Returns:
0 if the return code was 0; otherwise, raises a
subprocess.CalledProcessError.- Return type: