diff --git a/README.rst b/README.rst index b62b5285b4c552585ee96c4cb35a3dd09d1f4336..6328ee6186d55220d620f7704c1967fbf829ef1a 100644 --- a/README.rst +++ b/README.rst @@ -50,14 +50,6 @@ Clone from git:: git clone https://git.xfel.eu/gitlab/detectors/pycalibration.git cd pycalibration -Edit path to the python environment in the bin/activate.sh file. Change:: - - export PATH=/home/${USER}/.local/bin:$PATH - -to:: - - export PATH=/path/to/new/virtual/environment/bin:$PATH - Install the package:: pip install -r requirements.txt diff --git a/bin/activate.sh b/bin/activate.sh deleted file mode 100644 index 8c8a0500e9d400a6094aaf05192ea40fbc5bde96..0000000000000000000000000000000000000000 --- a/bin/activate.sh +++ /dev/null @@ -1,5 +0,0 @@ -source /etc/profile.d/modules.sh -module load anaconda/3 -module load texlive/2019 -# export path to python environment -export PATH=$HOME/.local/bin:$PATH diff --git a/bin/slurm_calibrate.sh b/bin/slurm_calibrate.sh index 44be0e93e511c491fe6171badb0e0f49c708d1f2..d5e87ebc30bfb9649a97543b4cc1e855493446cd 100755 --- a/bin/slurm_calibrate.sh +++ b/bin/slurm_calibrate.sh @@ -3,24 +3,18 @@ # set paths to use nb_path=$1 python_path=$2 -ipython_path=$3 -jupyter_path=$4 -ipcluster_path="${5}" -activate_path=$6 -uuid=$7 -notebook=$8 -detector=$9 -caltype=${10} -final=${11} -finalize=${12} -cluster_cores=${13} +activate_path=$3 +uuid=$4 +notebook=$5 +detector=$6 +caltype=${7} +final=${8} +finalize=${9} +cluster_cores=${10} echo "Running with the following parameters:" echo "Notebook path: $nb_path" echo "Python path: $python_path" -echo "IPython path: $ipython_path" -echo "Jupyter path: $jupyter_path" -echo "IP-Cluster path: $ipcluster_path" echo "Environment activate: $activate_path" echo "IP-Cluster profile: $uuid" echo "notebook: $notebook" @@ -45,20 +39,20 @@ export MPLBACKEND=AGG # start an ip cluster if requested if [ "${uuid}" != "NO_CLUSTER" ] then - ${ipython_path} profile create ${uuid} --parallel - ${ipcluster_path} start --n=${cluster_cores} --profile=${uuid} --daemon & + ${python_path} -m IPython profile create ${uuid} --parallel + ${python_path} -m ipyparallel.cluster start --n=${cluster_cores} --profile=${uuid} --daemon & sleep 15 fi echo "Running script" -${jupyter_path} nbconvert --to rst --ExecutePreprocessor.timeout=36000 --ExecutePreprocessor.allow_errors=True --TemplateExporter.exclude_input=True --execute ${nb_path} +${python_path} -m nbconvert --to rst --ExecutePreprocessor.timeout=36000 --ExecutePreprocessor.allow_errors=True --TemplateExporter.exclude_input=True --execute ${nb_path} # stop the cluster if requested if [ "${uuid}" != "NO_CLUSTER" ] then - ${ipcluster_path} stop --profile=${uuid} - profile_path=`${ipython_path} locate profile ${uuid}` + ${python_path} -m ipyparallel.cluster stop --profile=${uuid} + profile_path=$(${python_path} -m IPython locate profile ${uuid}) echo "Removing cluster profile from: $profile_path" rm -rf $profile_path fi diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index 8bdbdbe15f2e31e43f464ae62d845cc4d71494ea..352c4ca3ba9c15dd7d50220a46b761c73eeb8ada 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -653,9 +653,6 @@ def concurrent_run(temp_path, nb, nbname, args, cparm=None, cval=None, srun_base += [os.path.join(PKG_DIR, "bin", "slurm_calibrate.sh"), # path to helper sh os.path.abspath(nbpath), # path to notebook python_path, # path to python - ipython_path, # path to ipython - jupyter_path, # path to jupyter - ipcluster_path, # path to ipcluster # python activate path activate_path if activate_path!="" else os.path.join(PKG_DIR, "bin", "activate.sh"), args.get("cluster_profile", "NO_CLUSTER"), diff --git a/xfel_calibrate/settings.py b/xfel_calibrate/settings.py index cbe4c21b66bca70ed8db0d5902a7ca4e15c5365b..78c3053e78b331973ba17c99f3ea21da41b1609e 100644 --- a/xfel_calibrate/settings.py +++ b/xfel_calibrate/settings.py @@ -1,23 +1,15 @@ import os +import sys # path into which temporary files from each run are placed temp_path = os.path.abspath("temp/") # Path to use for calling Python. If the environment is correctly set, simply the command -python_path = "python" - -# Path to use for calling iPython. If the environment is correctly set, simply the command -ipython_path = "ipython" - -# Path to use for calling Jupyter. If the environment is correctly set, simply the command -jupyter_path = "jupyter" +python_path = sys.executable # Path to find activate script activate_path = "" -# Path to use for calling ipcluster. If the environment is correctly set, simply the command -ipcluster_path = "ipcluster" - # Path to store reports in report_path = "{}/calibration_reports/".format(os.getcwd())