diff --git a/README.md b/README.md index 2427b807..8e16df76 100644 --- a/README.md +++ b/README.md @@ -22,28 +22,47 @@ and a standardized "recipe" format to define the steps in our workflows. [Documentation](https://springtime.readthedocs.io/) -## Installation +## Requirements -To install springtime in your current environment, type +This project requires python and R. To simplify installation of the (indirect) R +depencencies you can create a Anaconda environment using [Mamba +forge](https://github.com/conda-forge/miniforge#mambaforge) with: + +```shell +mamba env create --file environment.yml +conda activate springtime +``` + +## Install Python package with dependencies + +Once you have python and R, to install springtime in your current environment, +type ```bash pip install git+https://github.com/phenology/springtime.git ``` -## R dependencies - -Some datasets use [R](https://www.r-project.org/) libraries. +## Install R dependencies -The R dependencies can be installed from R shell with +Some datasets use [R](https://www.r-project.org/) libraries. The R dependencies +can be installed with -```R -if(!require(devtools)){install.packages(devtools)} -devtools::install_github("bluegreen-labs/phenor@v1.3.1") -install.packages("daymetr") -devtools::install_github("ropensci/rppo") +```bash +Rscript -e 'devtools::install_github("bluegreen-labs/phenor")' +Rscript -e 'devtools::install_github("ropensci/rppo")' +Rscript -e 'install.packages("daymetr")' ``` -To complete installation you might need to install some OS dependencies. + +## Verify installation + +```bash +python -m r2py.situation +> ... +> Calling `R RHOME`: /home/peter/miniconda3/envs/springtime/lib/R +> Environment variable R_LIBS_USER: None +> ... +``` diff --git a/docs/conda.md b/docs/conda.md deleted file mode 100644 index ef0f8784..00000000 --- a/docs/conda.md +++ /dev/null @@ -1,23 +0,0 @@ -# Install R and python with conda - -```bash -# Create a basic conda environment with R and Python -mamba create -c conda-forge -n springtime python=3.9 r-base r-devtools # TODO: try use r-essentials instead - -# Install r-deps from command line (how to make this simpler?) -Rscript -e 'devtools::install_github("bluegreen-labs/phenor")' -Rscript -e 'devtools::install_github("ropensci/rppo")' - -# Install python package and verify installation -pip install git+https://github.com/phenology/springtime.git -python -m r2py.situation -> ... -> Calling `R RHOME`: /home/peter/miniconda3/envs/springtime/lib/R -> Environment variable R_LIBS_USER: None -> ... - -# Or use hatch -pip install hatch -hatch env create -hatch run python -m rpy2.situation -``` \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..a2a23a59 --- /dev/null +++ b/environment.yml @@ -0,0 +1,57 @@ +name: springtime +channels: + - conda-forge +dependencies: + - pip!=21.3 + - python==3.10 + - hatch + # R dependencies + - r-base >=4.2 + # - r-BayesianTools # not in any anconda channel + - r-ape + - r-changepoint + - r-class + - r-devtools + - r-doparallel + - r-expm + - r-filelock + - r-foreach + - r-gap + - r-GenSA + - r-getpass + - r-ggplot2 + - r-gmm + - r-httr + - r-idpmisc + - r-jsonlite + - r-keyring + - r-kernsmooth + - r-lme4 + - r-lmtest + - r-magrittr + - r-minqa + - r-msm + - r-ncdf4 + - r-nloptr + - r-proxy + - r-qgam + - r-raster + - r-rcppeigen + # - r-rgenoud # is in r channel + - r-rvest + - r-sf + - r-snow + - r-sp + - r-sodium + - r-survival + - r-terra + - r-tibble + - r-tidyr + - r-tmvtnorm + - r-units + - r-wk + - r-xml2 + - r-uuid + - r-zoo +# TODO make list smaller by only listing most direct dependencies +# this will make it easier to maintain the list diff --git a/mkdocs.yml b/mkdocs.yml index 1e425776..20dce84b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,7 +8,6 @@ nav: - Getting started: setup.md - User Guide: - Getting started: setup.md - - Conda installation: conda.md - CRIB installation: crib.md - Example notebooks: notebooks/pk_wishful_workflows.ipynb - Contributing guide: contributing.md