Skip to content
Snippets Groups Projects
build.sh 2.06 KiB
#!/usr/bin/env bash

set -xeuo pipefail

# Get the base directory of the script
basedir=$(dirname "$(readlink -f "$0")")


# Ensure conda is updated to a version that supports the --no-capture-output option
# conda install -y -n base -c conda-forge "conda>=4.13.0"

echo installing ich environment...
conda env create --name ich-env -f ${basedir}/environments/ich-env.yml

# Install the maap.py environment
echo installing maap-py...
source activate ich-env
git clone --single-branch --branch v4.1.0 https://github.com/MAAP-Project/maap-py.git
cd maap-py
pip install -e .
echo installed maap-py package!

# Install essential packages in the base environment
# conda install -y -n base -c conda-forge gdal
# conda install -y gdal libgdal

# Install Python packages using pip
# pip install pandas scikit-image empatches scikit-learn scipy numpy matplotlib tqdm futures

# Create a new conda environment for your project (uncomment if needed)
# conda create -y -n ich gdal matplotlib scipy scikit-image tqdm pandas

# Install dependencies from lock file for speed and reproducibility (uncomment if needed)
# conda-lock install -n ich "${basedir}/environment/conda-lock.yml"

# Install additional packages that can't be specified in the lock file (uncomment if needed)
# conda env update -n ich --file "${basedir}/environments/environment-maappy.yml"

# Install the current project in editable mode (uncomment if needed)
# conda run --no-capture-output -n ich PIP_REQUIRE_VENV=0 python -m pip install -e "${basedir}"

# Verify the GDAL installation and other package availability
conda run --no-capture-output -n ich-env python -c '
try:
    from osgeo import gdal
    import warnings
    import argparse
    import os
    import sys
    # from skimage.util.shape import view_as_blocks
    from mpl_toolkits.axes_grid1 import make_axes_locatable
    from scipy.interpolate import griddata
    from tqdm import tqdm
    from concurrent.futures import ProcessPoolExecutor, as_completed
    print("All modules imported successfully.")
except ImportError as e:
    print(f"Import error: {e}")
    sys.exit(1)
# '