From 978101f9c2d9b210a22749b8191330c6d8a97959 Mon Sep 17 00:00:00 2001 From: Florez Ospina Juan Felipe Date: Sun, 29 Jun 2025 07:53:20 +0200 Subject: [PATCH] Refactor README to use Miniforge and conda-forge for env setup; remove unreliable shell script instructions --- README.md | 50 +++++++++++++++++++++++-------------------------- environment.yml | 4 +--- setup_env.sh | 47 ---------------------------------------------- 3 files changed, 24 insertions(+), 77 deletions(-) delete mode 100644 setup_env.sh diff --git a/README.md b/README.md index 7648dbf..40519a0 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ For **Windows** users, the following are required: 1. **Git Bash**: Install [Git Bash](https://git-scm.com/downloads) to run shell scripts (`.sh` files). -2. **Conda**: Install [Anaconda](https://www.anaconda.com/products/individual) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html). +2. **Miniforge**: Install [Miniforge](https://conda-forge.org/download/). 3. **PSI Network Access** @@ -44,56 +44,52 @@ For **Windows** users, the following are required: ### Download DIMA -Open a **Git Bash** terminal. +Open a **Git Bash** terminal (or a terminal of your choice). -Navigate to your `Gitea` folder, clone the repository, and navigate to the `dima` folder as follows: +Navigate to your `Gitea` folder, clone the repository, and move into the `dima` directory: - ```bash - cd path/to/Gitea - git clone --recurse-submodules https://gitea.psi.ch/5505-public/dima.git - cd dima + ```bash + cd path/to/Gitea + git clone --recurse-submodules https://gitea.psi.ch/5505-public/dima.git + cd dima ``` -### Install Python Interpreter +### Install Python Environment Using Miniforge and conda-forge -Open **Git Bash** terminal. +We recommend using Miniforge to manage your conda environments. Miniforge ensures compatibility with packages from the conda-forge channel. -**Option 1**: Install a suitable conda environment `multiphase_chemistry_env` inside the repository `dima` as follows: +1. Make sure you have installed **Miniforge**. +2. Create the Environment from `environment.yml` +After installing Miniforge, open **Miniforge Prompt** or a terminal with access to conda and run: ```bash - cd path/to/GitLab/dima - Bash setup_env.sh - ``` - -Open **Anaconda Prompt** or a terminal with access to conda. - -**Option 2**: Install conda enviroment from YAML file as follows: - ```bash - cd path/to/GitLab/dima + cd path/to/Gitea/dima conda env create --file environment.yml ``` +3. Activate the Environment + ```bash + conda activate dima_env + ``` -
- Working with Jupyter Notebooks - -We now make the previously installed Python environment `multiphase_chemistry_env` selectable as a kernel in Jupyter's interface. +### Working with Jupyter Notebooks +We now make the previously installed Python environment `dima_env` selectable as a kernel in Jupyter's interface. 1. Open an Anaconda Prompt, check if the environment exists, and activate it: ``` conda env list - conda activate multiphase_chemistry_env + conda activate dima_env ``` 2. Register the environment in Jupyter: ``` - python -m ipykernel install --user --name multiphase_chemistry_env --display-name "Python (multiphase_chemistry_env)" + python -m ipykernel install --user --name dima_env --display-name "Python (dima_env)" ``` 3. Start a Jupyter Notebook by running the command: ``` jupyter notebook ``` - and select the `multiphase_chemistry_env` environment from the kernel options. + and select the `dima_env` environment from the kernel options. + -
## Repository Structure and Software arquitecture diff --git a/environment.yml b/environment.yml index d5aea65..12f7db5 100644 --- a/environment.yml +++ b/environment.yml @@ -1,8 +1,6 @@ -name: pyenv5505 -#prefix: ./envs/pyenv5505 # Custom output folder +name: dima_env channels: - conda-forge - - defaults dependencies: - python=3.11 - jupyter diff --git a/setup_env.sh b/setup_env.sh deleted file mode 100644 index 9e7e8a6..0000000 --- a/setup_env.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Define the name of the environment -ENV_NAME="multiphase_chemistry_env" - -# 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, resolving from conda-forge and defaults -$CONDA_COMMAND create -y -n "$ENV_NAME" -c conda-forge -c defaults python=3.11 \ - jupyter numpy h5py pandas matplotlib plotly=5.24 scipy pip - -# Check if the environment was successfully created -if [ $? -ne 0 ]; then - echo "Failed to create the environment '$ENV_NAME'. Please check the logs above for details." - exit 1 -fi - -# Activate the new environment -if source activate "$ENV_NAME" 2>/dev/null || conda activate "$ENV_NAME" 2>/dev/null; then - echo "Environment '$ENV_NAME' activated successfully." -else - echo "Failed to activate the environment '$ENV_NAME'. Please check your conda setup." - exit 1 -fi - -# Install additional pip packages only if the environment is activated -echo "Installing additional pip packages..." -pip install pybis==1.35 igor2 ipykernel sphinx - -# Check if pip installations were successful -if [ $? -ne 0 ]; then - echo "Failed to install pip packages. Please check the logs above for details." - exit 1 -fi - -# Optional: Export the environment to a YAML file (commented out) -# $CONDA_COMMAND env export -n "$ENV_NAME" > "$ENV_NAME-environment.yaml" - -# Print success message -echo "Environment '$ENV_NAME' created and configured successfully." -# echo "Environment configuration saved to '$ENV_NAME-environment.yaml'." -