Skip to content

Commit

Permalink
Polish installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mszell committed Apr 18, 2024
1 parent 0fab961 commit c1bbab3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 58 deletions.
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,57 @@ prevented or pacified, giving priority to people walking and cycling.

## Installation

We recommend
using [`micromamba`](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
to create a virtual environment and installing the package in editable mode.
Alternatively, one can
use [`conda`](https://docs.conda.io/projects/conda/en/latest/index.html)
or [`mamba`](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html)
to create the environment (they can be used interchangeably).
### Set up environment
Use [`conda`](https://docs.conda.io/projects/conda/en/latest/index.html) or [`mamba`](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) or [`micromamba`](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
to create and activate the virtual environment `sb_env` via the [`environment.yml`](environment.yml) file:

```bash
micromamba create -n sb_env -c conda-forge python=3.12 osmnx
micromamba activate sb_env
pip install superblockify
conda env create --file environment.yml
conda activate sb_env
```

This installs the package and its dependencies,
ready for use when activating the environment.
Learn more about `superblockify` by reading
the [documentation](https://NERDSITU.github.io/superblockify/)
with the [usage section](https://nerdsitu.github.io/superblockify/usage/)
or
the [minimal working example](https://github.com/NERDSITU/superblockify/blob/main/scripts/examples/mwe.py).
*Alternatively*, or if you run into issues, run:

## Development Setup
```bash
conda create -n sb_env -c conda-forge python=3.12 osmnx=1.9.2
conda activate sb_env
```

For development, clone the repository, navigate to the root folder and
create the environment with the wished python version and the development dependencies.
### Install package
Next, install the package:

```bash
micromamba create -n sb_env -c conda-forge python=3.12 --file=environment.yml
micromamba activate sb_env
pip install superblockify
```

Now it is possible to import the package relatively to the root folder.
Optionally, register the package in editable mode with `pip`:
### Set up Jupyter kernel
If you want to use `superblockify` with its environment `sb_env` in Jupyter, run:

```bash
pip install --no-build-isolation --no-deps -e .
pip install --user ipykernel
python -m ipykernel install --user --name=sb_env
```

This allows you to run Jupyter with the kernel `sb_env` (Kernel > Change Kernel > sb_env)


## Usage

For a quick start after installation,
refer to the [usage section](https://nerdsitu.github.io/superblockify/usage/)
in the documentation.
Additionally, there are example scripts in
the [`examples/`](https://github.com/NERDSITU/superblockify/blob/main/scripts/examples/)
folder and
a [minimal working example](https://github.com/NERDSITU/superblockify/blob/main/scripts/examples/mwe.py).
We provide a minimum working example in two formats:

* [Jupyter notebook (`mwe.ipynb`)](mwe.ipynb)
* [Python script (`mwe.py`)](mwe.py)

There are additional example scripts in
the [`examples/`](scripts/examples/)
folder.

For a guided start after installation, see the [usage section](https://superblockify.city/usage/) in the documentation.

## Documentation

Read the [documentation](https://superblockify.city) to learn more about `superblockify`.


## Testing

Expand Down
45 changes: 19 additions & 26 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
# Installation

We recommend using `micromamba` to create a virtual
environment and installing the package in editable mode.
Alternatively, one can use `conda` or `mamba` to create the environment
(they can be used interchangeably).
After cloning the repository, navigate to the root folder and
create the environment with the wished python version and the development dependencies.
### Set up environment
Use [`conda`](https://docs.conda.io/projects/conda/en/latest/index.html) or [`mamba`](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) or [`micromamba`](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html)
to create and activate the virtual environment `sb_env` via the `environment.yml` file:

```bash
micromamba create -n sb_env -c conda-forge python=3.12 osmnx
micromamba activate sb_env
pip install superblockify
conda env create --file environment.yml
conda activate sb_env
```

This installs the package and its dependencies,
ready for use when activating the environment.
Now you are ready to use `superblockify` in your projects,
as shown in the following [Usage](#usage) section.

For development, see the [Development Setup](#development-setup) section.
*Alternatively*, or if you run into issues, run:

## Development Setup
```bash
conda create -n sb_env -c conda-forge python=3.12 osmnx=1.9.2
conda activate sb_env
```

For development, clone the repository, navigate to the root folder and
create the environment with the wished python version and the development dependencies.
### Install package
Next, install the package:

```bash
micromamba create -n sb_env -c conda-forge python=3.12 --file=environment.yml
micromamba activate sb_env
pip install superblockify
```

Now it is possible to import the package relatively to the root folder.
Optionally, register the package in editable mode with `pip`:
### Set up Jupyter kernel
If you want to use `superblockify` with its environment `sb_env` in Jupyter, run:

```bash
pip install --no-build-isolation --no-deps -e .
pip install --user ipykernel
python -m ipykernel install --user --name=sb_env
```

## Testing
This allows you to run Jupyter with the kernel `sb_env` (Kernel > Change Kernel > sb_env)

The tests are specified using the `pytest` signature in the `tests/` folder and
can be run using a test runner of choice.
For a guided start after installation, see the following [Usage section](#usage).

0 comments on commit c1bbab3

Please sign in to comment.