-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.sh
More file actions
37 lines (35 loc) · 1.32 KB
/
activate.sh
File metadata and controls
37 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Activate the Python environment that has PyAutoLens installed.
#
# Most users just `pip install autolens` (see the al_setup_environment skill) into a
# virtual environment. By default this looks for a `.venv` created inside the project
# (what al_setup_environment makes); edit VENV to point elsewhere, e.g. ~/venv/PyAuto.
#
# Resolving relative to this file (not the current directory) means it works both for a
# local `source activate.sh` and for the HPC scripts' `source $PROJECT_PATH/activate.sh`.
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV=$HERE/.venv
if [ -f "$VENV/bin/activate" ]; then
source "$VENV/bin/activate"
elif [ -f /mnt/ral/jnightin/PyAuto/PyAuto/bin/activate ]; then
BASE=/mnt/ral/jnightin/PyAuto
source "$BASE/PyAuto/bin/activate"
export PYTHONPATH=$BASE:\
$BASE/PyAutoConf:\
$BASE/PyAutoFit:\
$BASE/PyAutoArray:\
$BASE/PyAutoGalaxy:\
$BASE/PyAutoLens
else
echo "No local .venv or known HPC PyAuto environment found." >&2
fi
# Developer setup only: if you run against editable source checkouts of the PyAuto*
# libraries instead of a pip install, drop the line above and add their parent directory
# to PYTHONPATH, e.g.:
#
# SRC=~/Code/PyAutoLabs
# export PYTHONPATH=$SRC:\
# $SRC/PyAutoConf:\
# $SRC/PyAutoFit:\
# $SRC/PyAutoArray:\
# $SRC/PyAutoGalaxy:\
# $SRC/PyAutoLens