Skip to content

Commit

Permalink
docs: update install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Feb 22, 2024
1 parent 3284324 commit 5c051a4
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,56 @@
# 🚀 Install

## Online usage (Binder)

See below for the full installation instructions. If instead you'd like to use
this package online, without needing to install anything, check out our
[Binder link](https://mybinder.org/v2/gh/mdtanker/invert4geom/main), which
gives full access the the package in an online environment.

This Binder environment can also be accessed by clicking the Binder icon in any
of the `gallery` or `tutorial` examples.

## Install Python

Before installing *Invert4Geom*, ensure you have Python downloaded. If you don't, I recommend setting up Python
with Miniforge. See the install instructions
[here](https://github.com/conda-forge/miniforge).

## Install *Invert4Geom* Locally

There are 3 main ways to install `invert4geom`. We show them here in order of
simplest to hardest.

## Conda / Mamba
### Conda / Mamba

```{warning}
Conda install instructions still to come ...
```
The easiest way to install this package and it's dependencies is with conda or
mamba into a new virtual environment:

mamba create --name invert4geom --yes --force invert4geom

## Pip
Activate the environment:

You can install via pip, but some of the dependencies include packages which can
only be installed by other means, such as `conda` or `mamba`.
conda activate invert4geom

First create a `conda` environment and install the necessary packages into that:
### Pip

Instead, you can use pip to install `invert4geom`, but first you need to install
a few dependencies with conda. This is because a few dependencies rely on C packages, which can only be install with conda/mamba and
not with pip.

```{note}
`conda` and `mamba` are interchangeable
```

Create a new virtual environment:

```
mamba create --name invert4geom polartoolkit python=3.11
mamba create --name invert4geom --yes --force polartoolkit
```

The package `polartoolkit` provides several useful functions used in
`invert4geom`. Since `polartoolkit` has several dependencies that can't be
install with `pip` (mostly `pygmt`), it is easiest to install with `conda`.
install with `pip` (mostly `pygmt`), it is easiest to install with `conda` or `mamba`.

activate the environment and use `pip` to install `invert4geom`:

Expand All @@ -37,35 +61,37 @@ pip install invert4geom

```{note}
to install the optional dependencies, use this instead:
`pip install [all]`
`pip install invert4geom[all]`
```

## Locally
### Development version

To get a local version of the package and include that in your environment
follow these instructions.
You can use pip, with the above created environment, to install the latest
source from GitHub:

clone the GitHub repository and change directories into it:
pip install git+https://github.com/mdtanker/invert4tgeom.git

```
git clone https://github.com/mdtanker/invert4geom.git
cd invert4geom
```
Or you can clone the git repository and install one of two ways:

#### with Make

assuming you have `Python` and `make` installed, as well as `mamba` (install
Or, assuming you have `make` installed, as well as `mamba` (install
mamba with `pip install mamba`) installed within your Python environment, run
the following to install the package locally:

```
git clone https://github.com/mdtanker/invert4geom.git
cd invert4geom
make create
conda activate invert4geom
make install
```

If you don't have or want `make` or `mamba` installed, you can accomplish the
same with the following:
#### manually

```
git clone https://github.com/mdtanker/invert4geom.git
cd invert4geom
conda create --name invert4geom --yes --force polartoolkit python=3.11
conda activate invert4geom
pip install -e .[all]
Expand Down

0 comments on commit 5c051a4

Please sign in to comment.