From 6daaf154aac3253c5582c9dc7c9d813e6cf55ce4 Mon Sep 17 00:00:00 2001 From: bgeels <bgeels@usgs.gov> Date: Wed, 20 Dec 2023 16:20:18 -0700 Subject: [PATCH] Update install.md and small correction in develop.md --- docs/develop.md | 4 ++-- docs/install.md | 46 ++++++++++++++++++++++------------------------ 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/docs/develop.md b/docs/develop.md index ec98f89b..f492c545 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -8,9 +8,9 @@ code for this project, but may also be used to run a local copy of the code. This project uses a forking workflow. https://guides.github.com/activities/forking/ -1. Fork this project on Github. +1. Fork this project from code.usgs.gov. - https://github.com/usgs/geomag-algorithms.git + https://code.usgs.gov/ghsc/geomag/geomag-algorithms.git 2. Clone your fork diff --git a/docs/install.md b/docs/install.md index df1b3037..0a82a750 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,43 +1,41 @@ # Installation - -> - [Develop](./develop.md) describes how to install locally. -> - [Docker](./install_docker.md) describes container usage. +This document describes installation instructions for users. For those that wish to modify or develop custom code within **geomag-algorithms**, or prefer to install the Docker container, please see the following documents: +> - [Develop](./develop.md) provides installation instruction for developers +> - [Docker](./install_docker.md) describes Docker container installation and usage. ## Requirements: -- Python 3.6 or newer -- ObsPy 1.2.1 or newer +- Python 3.8 to 3.11 +- ObsPy 1.4.0 ## Procedure: -1. Install Python and dependencies +### Option 1: Anaconda/Miniconda (https://conda.io/miniconda.html): +1. Set up environment & install dependencies - - Option 1: Anaconda/Miniconda (https://conda.io/miniconda.html): + conda create --name=geomagenv --channel conda-forge python=3 obspy pycurl + source activate geomagenv - conda create --name=geomagenv --channel conda-forge python=3 obspy pycurl - source activate geomagenv +2. Install **geomagio** - - Option 2: Pip + pip install git+https://code.usgs.gov/ghsc/geomag/geomag-algorithms.git - > `pyenv` can install specific/multiple versions of python - > - > - https://github.com/pyenv/pyenv - > - https://github.com/pyenv-win/pyenv-win +### Option 2: Venv and pip +1. Create a virtual environment using `venv` (recommended) - # create virtual environment (optional) - python -m venv path/to/geomagenv - source path/to/geomagenv/bin/activate + python -m venv path/to/your/environment - # install dependencies - pip install numpy - pip install obspy + > `venv` is a tool included with Python 3.3 and above that allows you to create isolated Python environments, each with their own set of installed packages, which can help you manage different projects without package conflicts. Each environment is stored within a folder of the user's choosing. + > + > You can find more information on using `venv` [here](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment). -2. Install **geomagio** +2. Install **geomagio** within the virtual environment + source path/to/your/environment/bin/activate pip install git+https://code.usgs.gov/ghsc/geomag/geomag-algorithms.git -3. Use **geomagio** +### Using **geomagio** +**geomagio** is the Python module for interfacing with geomag-algorithms. - Use the main script, `geomag.py -h` - - In python scripts, `import geomagio` - - Interactively with Jupyter notebooks ( http://jupyter.org/install.html ) + - In Python scripts or Jupyter notebooks, `import geomagio` \ No newline at end of file -- GitLab