Skip to content

Commit

Permalink
Drop m2r2
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalrussell committed May 24, 2024
1 parent db79d69 commit 27ec61b
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 21 deletions.
11 changes: 0 additions & 11 deletions docs/source/api/snail.core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,3 @@ snail.core package
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

snail.core.intersections module
-------------------------------

.. automodule:: snail.core.intersections
:members:
:undoc-members:
:show-inheritance:
16 changes: 16 additions & 0 deletions docs/source/api/snail.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ snail.cli module
:undoc-members:
:show-inheritance:

snail.damages module
--------------------

.. automodule:: snail.damages
:members:
:undoc-members:
:show-inheritance:

snail.intersection module
-------------------------

Expand All @@ -33,6 +41,14 @@ snail.intersection module
:undoc-members:
:show-inheritance:

snail.io module
---------------

.. automodule:: snail.io
:members:
:undoc-members:
:show-inheritance:

snail.routing module
--------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration


# Extra styles, found in _static
def setup(app):
app.add_css_file("theme_tweaks.css")
Expand All @@ -37,13 +38,12 @@ def setup(app):
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"m2r2",
]
templates_path = ["_templates"]
exclude_patterns = []

# The suffix(es) of source filenames.
source_suffix = [".rst", ".md"]
source_suffix = [".rst"]


# -- Options for HTML output -------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions docs/source/getting_started.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
===============
Getting Started
===============

For now, the best place to start is with the
`notebook tutorials <https://github.com/nismod/snail/tree/master/tutorials>`_.
55 changes: 52 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,58 @@ climate hazards on infrastructure networks.
:alt: PyPI version


.. mdinclude:: ../../README.md
:start-line: 22
:end-line: 95
## Installation

Install using pip:

pip install nismod-snail

This should bring all dependencies with it. If any of these cause difficulties,
try using a `conda <https://docs.conda.io/en/latest/miniconda.html>`_ environment::

conda env create -n snail_env \
python=3.8 geopandas shapely rasterio python-igraph
conda activate snail_env
pip install nismod-snail

If all worked okay, you should be able to run python and import snail::

$ python
>>> import snail
>>> help(snail)
Help on package snail:

NAME
snail - snail - the spatial networks impact assessment library

## Using the `snail` command

Once installed, you can use `snail` directly from the command line.

Split features on a grid defined by its transform, width and height::

snail split \
--features input.shp \
--transform 1 0 -180 0 -1 90 \
--width 360 \
--height 180 \
--output split.gpkg


Split features on a grid defined by a GeoTIFF, optionally adding the values from each raster band to each split feature as a new attribute::

snail split \
--features lines.geojson \
--raster gridded_data.tif \
--attribute \
--output split_lines_with_raster_values.geojson


Split multiple vector feature files along the grids defined by multiple raster files, attributing all raster values::

snail process -fs features.csv -rs rasters.csv

Where at a minimum, each CSV has a column `path` with the path to each file.


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dev = [
"pytest-cov",
"pytest",
]
docs = ["sphinx", "m2r2"]
docs = ["sphinx"]
tutorials = [
"contextily",
"irv_autopkg_client",
Expand Down

0 comments on commit 27ec61b

Please sign in to comment.