Commit c51ec6cd authored by jemian's avatar jemian
Browse files

design more defaults and configurability into this starter script

parent 9d76d652
#!/bin/bash
export PATH=~/Apps/BlueSky/bin:$PATH
#export PATH=/APSshare/anaconda3/BlueSky/bin:$PATH
export profile=${1:-bluesky}
echo "starting ipython with profile: $profile"
# https://git.aps.anl.gov/jemian/deployments/raw/master/BlueSky/use_bluesky.sh
# start an interactive ipython session running BlueSky (from NSLS-II)
#
# usage: use_bluesky.sh [profile_name]
#
# Command Options
# profile_name : name of existing ipython profile to use (default: $BLUESKY_PROFILE)
#
# Environment Variable(s) (these are optional)
# BLUESKY_BIN_DIR : absolute path to directory containing Python with BlueSky installed
#
# The use_bluesky.sh script has default values for the environment variable(s).
# BLUESKY_BIN_DIR__INTERNAL_DEFAULT : (the first of these to be found, in order)
# "~/Apps/BlueSky/bin"
# or "/APSshare/anaconda3/BlueSky/bin"
# or "." (the fallback default if none of those are found)
# BLUESKY_PROFILE__INTERNAL_DEFAULT : "bluesky"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# define the default path to the Python with BlueSky installed
export BLUESKY_BIN_DIR__INTERNAL_DEFAULT=.
if [ -d ~/Apps/BlueSky/bin ]; then
export BLUESKY_BIN_DIR__INTERNAL_DEFAULT=~/Apps/BlueSky/bin
elif [ -d /APSshare/anaconda3/BlueSky/bin ]; then
export BLUESKY_BIN_DIR__INTERNAL_DEFAULT=/APSshare/anaconda3/BlueSky/bin
fi
export BLUESKY_PROFILE__INTERNAL_DEFAULT=bluesky
# pick values to use, either from environment variables or defaults
export BLUESKY_BIN_DIR=${BLUESKY_BIN_DIR:-$BLUESKY_BIN_DIR__INTERNAL_DEFAULT}
export BLUESKY_PROFILE=${1:-$BLUESKY_PROFILE__INTERNAL_DEFAULT}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
export PATH=$BLUESKY_BIN_DIR:$PATH
echo "starting ipython with profile: $BLUESKY_PROFILE"
which python
python --version
conda --version
pip --version
which ipython
ipython --profile=$profile
\ No newline at end of file
ipython --profile=$BLUESKY_PROFILE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment