Skip to content

Commit 46ff9e9

Browse files
committed
feat: renamed to focalpy
1 parent 045de8d commit 46ff9e9

File tree

14 files changed

+44
-47
lines changed

14 files changed

+44
-47
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ Before you submit a pull request, check that it meets these guidelines:
2828

2929
1. The pull request should include tests.
3030
1. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.
31-
1. The pull request should work for Python 3.8, 3.9, 3.10 and 3.11. Check https://github.com/martibosch/multilandpy/actions and make sure that the tests pass for all supported Python versions.
31+
1. The pull request should work for Python 3.8, 3.9, 3.10 and 3.11. Check https://github.com/martibosch/focalpy/actions and make sure that the tests pass for all supported Python versions.

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
[![PyPI version fury.io](https://badge.fury.io/py/multilandpy.svg)](https://pypi.python.org/pypi/multilandpy/)
2-
[![Documentation Status](https://readthedocs.org/projects/multilandpy/badge/?version=latest)](https://multilandpy.readthedocs.io/en/latest/?badge=latest)
3-
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/martibosch/multilandpy/main.svg)](https://results.pre-commit.ci/latest/github/martibosch/multilandpy/main)
4-
[![codecov](https://codecov.io/gh/martibosch/multilandpy/branch/main/graph/badge.svg?token=hKoSSRn58a)](https://codecov.io/gh/martibosch/multilandpy)
5-
[![GitHub license](https://img.shields.io/github/license/martibosch/multilandpy.svg)](https://github.com/martibosch/multilandpy/blob/main/LICENSE)
1+
[![PyPI version fury.io](https://badge.fury.io/py/focalpy.svg)](https://pypi.python.org/pypi/focalpy/)
2+
[![Documentation Status](https://readthedocs.org/projects/focalpy/badge/?version=latest)](https://focalpy.readthedocs.io/en/latest/?badge=latest)
3+
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/martibosch/focalpy/main.svg)](https://results.pre-commit.ci/latest/github/martibosch/focalpy/main)
4+
[![codecov](https://codecov.io/gh/martibosch/focalpy/branch/main/graph/badge.svg?token=hKoSSRn58a)](https://codecov.io/gh/martibosch/focalpy)
5+
[![GitHub license](https://img.shields.io/github/license/martibosch/focalpy.svg)](https://github.com/martibosch/focalpy/blob/main/LICENSE)
66

7-
# multilandpy
7+
# focalpy
88

9-
Computing multi-scale landscape features for vector and raster layers (terrain/topographic indices, vegetation, building areas and volumes...) in Python.
10-
11-
> *multilandpy* is an analogy to the [multilandr](https://github.com/phuais/multilandR) package [1] to compute multi-scale landscape metrics in R. However, instead of lansdcape metrics<sup>[1](#pylandstats)</sup>, multilandpy computes generic mutli-scale landscape features for vector and raster layers, such as topographic features, tree canopy cover as well as building areas and volumes.
9+
Toolkit for focal site multi-scale studies in Python
1210

1311
Example application to compute the proportion of tree canopy around (with multiple buffer radii) weather stations in Zurich, Switzerland:
1412

15-
![stations-tree-canopy](https://github.com/martibosch/multilandpy/raw/main/figures/stations-tree-canopy.png)
13+
![stations-tree-canopy](https://github.com/martibosch/focalpy/raw/main/figures/stations-tree-canopy.png)
1614

1715
*(C) OpenStreetMap contributors, tiles style by Humanitarian OpenStreetMap Team hosted by OpenStreetMap France*
1816

@@ -23,7 +21,7 @@ Start by instantiating a `MultiScaleFeatureComputer` for [a given region of inte
2321
```python
2422
import swisstopopy
2523

26-
import multilandpy
24+
import focalpy
2725

2826
# parameters
2927
region = "EPFL"
@@ -32,7 +30,7 @@ buffer_dists = [10, 25, 50, 100]
3230
grid_res = 200
3331

3432
# instantiate the multi-scale feature computer
35-
msfc = multilandpy.MultiScaleFeatureComputer(region=region, crs=crs)
33+
msfc = focalpy.MultiScaleFeatureComputer(region=region, crs=crs)
3634

3735
# generate a regular grid of points/sites within the region
3836
site_gser = msfc.generate_regular_grid_gser(grid_res, geometry_type="point")
@@ -74,21 +72,21 @@ features_df.head()
7472
| | 100 | 250923.879244 | 0.043386 | 0.073637 | 0.006363 | -0.716217 |
7573
| 1 | 10 | 627.309698 | 0.000000 | 0.095521 | 0.228504 | 0.080963 |
7674

77-
See the [overview notebook](https://multilandpy.readthedocs.io/en/latest/overview.html) and the [API documentation](https://multilandpy.readthedocs.io/en/latest/api.html) for more details on the features of multilandpy.
75+
See the [overview notebook](https://focalpy.readthedocs.io/en/latest/overview.html) and the [API documentation](https://focalpy.readthedocs.io/en/latest/api.html) for more details on the features of focalpy.
7876

7977
## Installation
8078

81-
Like many other geospatial Python packages, multilandpy requires many base C libraries that cannot be installed with pip. Accordingly, the best way to install multilandpy is to use conda/mamba, i.e., in a given conda environment, run:
79+
Like many other geospatial Python packages, focalpy requires many base C libraries that cannot be installed with pip. Accordingly, the best way to install focalpy is to use conda/mamba, i.e., in a given conda environment, run:
8280

8381
```bash
8482
# or mamba install -c conda-forge geopandas
8583
conda install -c conda-forge geopandas
8684
```
8785

88-
Within the same conda environment, you can then install multilandpy using pip:
86+
Within the same conda environment, you can then install focalpy using pip:
8987

9088
```bash
91-
pip install https://github.com/martibosch/multilandpy/archive/main.zip
89+
pip install https://github.com/martibosch/focalpy/archive/main.zip
9290
```
9391

9492
## Acknowledgements

docs/api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
## Computing features
44

55
```{eval-rst}
6-
.. autoclass:: multilandpy.MultiScaleFeatureComputer
6+
.. autoclass:: focalpy.MultiScaleFeatureComputer
77
:members:
88
```
99

1010
## Standalone topographic functions
1111

1212
```{eval-rst}
13-
.. autofunction:: multilandpy.topo.compute_terrain_attribute
13+
.. autofunction:: focalpy.topo.compute_terrain_attribute
1414
15-
.. autofunction:: multilandpy.topo.northness
15+
.. autofunction:: focalpy.topo.northness
1616
17-
.. autofunction:: multilandpy.topo.comparative_height_at_center
17+
.. autofunction:: focalpy.topo.comparative_height_at_center
1818
19-
.. autofunction:: multilandpy.topo.flow_accumulation_at_center
19+
.. autofunction:: focalpy.topo.flow_accumulation_at_center
2020
```

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
import pkg_resources
77

8-
project = "multilandpy"
8+
project = "focalpy"
99
author = "Martí Bosch"
1010

11-
release = pkg_resources.get_distribution("multilandpy").version
11+
release = pkg_resources.get_distribution("focalpy").version
1212
version = ".".join(release.split(".")[:2])
1313

1414
extensions = [
@@ -21,7 +21,7 @@
2121
autodoc_typehints = "description"
2222
html_theme = "pydata_sphinx_theme"
2323
html_theme_options = {
24-
"github_url": "https://github.com/martibosch/multilandpy",
24+
"github_url": "https://github.com/martibosch/focalpy",
2525
}
2626

2727
# add module to path

docs/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: multilandpy
1+
name: focalpy
22
channels:
33
- conda-forge
44
dependencies:

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Usage
22

3-
To use multilandpy in a project
3+
To use focalpy in a project
44

55
```python
6-
import multilandpy
6+
import focalpy
77
```

focalpy/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""focalpy."""
2+
3+
from focalpy.features import MultiScaleFeatureComputer
4+
from focalpy.scale import (
5+
fully_connected_threshold,
6+
no_island_threshold,
7+
scale_eval_df,
8+
scale_of_effect_dict,
9+
)

multilandpy/features.py renamed to focalpy/features.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
import pandas as pd
1414
import rasterio as rio
1515
import rasterstats
16+
from multilandpy import topo, utils
1617
from osgeo import gdal
1718
from pyregeon import CRSType, RegionMixin, RegionType
1819
from rasterio import mask, transform
1920
from tqdm import tqdm
2021

21-
from multilandpy import topo, utils
22-
2322
# to use `progress_apply`
2423
tqdm.pandas()
2524

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)