Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AtMoDat/atmodat_data_checker
Browse files Browse the repository at this point in the history
  • Loading branch information
jkretz committed Jun 23, 2022
2 parents 3534209 + 4873b9f commit d9a1d6a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
12 changes: 11 additions & 1 deletion ancillary/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Ancillary files contained in this folder:

install_adc.sh: shell script to automate the installation of the atmodat data checker (adc) and the installation of Jupyter Lab with an adc kernel
install_adc.sh: shell script to automate the installation of the atmodat data checker (adc).
The script allows you to define the name of the conda environment in which the checker is installed.
Besides the atmodat data checker, the scripts also installs CDOs, NCOs and Jupyter Lab (with a adc kernel).

To use the script, please make sure the install_adc.sh is executable (chmod +x install_adc.sh).
Then run the script either like
./install_adc.sh
--> installation of atmodat checker in conda environment named 'atmodat'
./install_adc.sh myenvname
--> installation of atmodat checker in conda environment named 'myenvname'

25 changes: 14 additions & 11 deletions ancillary/install_adc.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#!/bin/bash

git clone https://github.com/AtMoDat/atmodat_data_checker.git
cd atmodat_data_checker || exit


if [ $# -gt 0 ] ; then
new_env=$1
git clone https://github.com/AtMoDat/atmodat_data_checker.git $new_env
cd $new_env || exit
sed -i.bak "s/atmodat/${new_env}/" environment.yml
else
git clone https://github.com/AtMoDat/atmodat_data_checker.git
cd atmodat_data_checker || exit
fi

env_name=$(sed -n 2p environment.yml |cut -d: -f2|tr -d ' ')
echo "Installing atmodat checker in environment" "{$env_name}"
echo "Installing atmodat checker in environment" "$env_name"

conda env create # environment name is retrieved from environment.yml

# shellcheck disable=SC1090
source ~/anaconda3/bin/activate "$env_name" #-- equivalent to conda activate ${env_name} in terminal
#source ~/anaconda3/etc/profile.d/conda.sh

mamba install --yes --file mamba_requirements.txt
pip install -U -e .
git submodule init
git submodule update
git submodule update --remote --recursive


#=== install jupyterlab and create ipykernel with name of the environment

#=== also install cdo and nco
mamba install --yes -c conda-forge jupyterlab
python -m ipykernel install --user --name "{$env_name}"kernel
mamba install --yes -c conda-forge cdo nco

python -m ipykernel install --user --name "$env_name"kernel

echo "finished installing $env_name
you can now activate the atmodat checker environment with
conda activate $env_name"

0 comments on commit d9a1d6a

Please sign in to comment.