From 88f97d7795b9683fe80ec01bbca5ae2acad87947 Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Mon, 18 Nov 2024 07:48:29 +0100 Subject: [PATCH] Updated gitignore to latest version and added env_setup.sh bash file --- .gitignore | 4 +++- env_setup.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 env_setup.sh diff --git a/.gitignore b/.gitignore index adbb97d..c795df1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -data/ \ No newline at end of file +data/ +envs/ +logs/ \ No newline at end of file diff --git a/env_setup.sh b/env_setup.sh new file mode 100644 index 0000000..c6555c0 --- /dev/null +++ b/env_setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Define the name and location of the environment +ENV_NAME="multiphase_chem_env" +ENV_PATH="./envs/$ENV_NAME" # Define a custom output folder + +# Check if mamba is available and use it instead of conda for faster installation +if command -v mamba &> /dev/null; then + CONDA_COMMAND="mamba" +else + CONDA_COMMAND="conda" +fi + +# Create the conda environment with all dependencies +$CONDA_COMMAND create -y -p "$ENV_PATH" python=3.11 \ + jupyter numpy pandas matplotlib plotly=5.24 scipy pip + +# Activate the new environment +source activate "$ENV_PATH" || conda activate "$ENV_PATH" + +# Install pip packages in one go to avoid repeated initializations +pip install h5py==3.10 pybis==1.35 igor2 ipykernel dash dash-bootstrap-components + +# Export the environment to a YAML file +$CONDA_COMMAND env export --prefix "$ENV_PATH" > "$ENV_PATH/environment.yaml" + +# Print success message +echo "Environment '$ENV_NAME' created successfully at '$ENV_PATH'." +echo "Environment configuration saved to '$ENV_PATH/environment.yaml'."