forked from APS-33IDD-SSM/33idd-bluesky-instrument
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueskyStarter.sh
executable file
·53 lines (43 loc) · 1.39 KB
/
blueskyStarter.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
export CONDA_BIN=$(dirname "${CONDA_EXE}")
if [[ "${CONDA_BIN}" = "" ]]; then
export CONDA_BIN=/APSshare/miniconda/x86_64/bin
fi
export CONDA_ACTIVATE="${CONDA_BIN}/activate"
export CONDA_ENVIRONMENT="${BLUESKY_CONDA_ENV:-bluesky_2022_1}"
# export CONDA_ENVIRONMENT=base
export IPYTHON_PROFILE=bluesky
export IPYTHONDIR="${HOME}/.ipython-bluesky"
console_session () {
export OPTIONS=""
export OPTIONS="${OPTIONS} --profile=${IPYTHON_PROFILE}"
export OPTIONS="${OPTIONS} --ipython-dir=${IPYTHONDIR}"
export OPTIONS="${OPTIONS} --IPCompleter.use_jedi=False"
export OPTIONS="${OPTIONS} --InteractiveShellApp.hide_initial_ns=False"
source ${CONDA_ACTIVATE} ${CONDA_ENVIRONMENT}
ipython ${OPTIONS}
}
lab_server () {
export OPTIONS=""
# export OPTIONS="${OPTIONS} --no-browser"
export OPTIONS="${OPTIONS} --ip=${HOST}"
source ${CONDA_ACTIVATE} ${CONDA_ENVIRONMENT}
python -m ipykernel install --user --name "${CONDA_ENVIRONMENT}"
jupyter-lab ${OPTIONS}
}
# start_iocs () {
# # FIXME: needs path/to/script (if not in ~/bin)
# iocStarter.sh
# }
usage () {
echo $"Usage: $0 [lab | help]"
}
case $(echo "${1}" | tr '[:upper:]' '[:lower:]') in
gui | jupyter | lab | notebook | server) lab_server ;;
"" | console | ipython) console_session ;;
# docker | ioc) start_iocs ;;
help | usage) usage ;;
*)
usage
exit 1
esac