Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pr/gsagostini/377
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Jan 23, 2024
2 parents 0e435d2 + 24672bf commit d0c12e7
Show file tree
Hide file tree
Showing 74 changed files with 4,858 additions and 6,680 deletions.
20 changes: 0 additions & 20 deletions .coveragerc

This file was deleted.

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
35 changes: 35 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Type checking

on:
push:
branches: [main]
pull_request:
branches:
- "*"
schedule:
- cron: "0 0 * * 1,4"

jobs:
mypy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/envs/312-latest.yaml
create-args: >-
mypy
- name: Install momepy
run: pip install .

- name: Check momepy
run: |
mypy momepy/ --install-types --ignore-missing-imports --non-interactive
4 changes: 2 additions & 2 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand Down
55 changes: 20 additions & 35 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,52 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches:
- "*"
schedule:
- cron: "0 0 * * 1,4"

jobs:
Linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

Test:
needs: Linting
name: ${{ matrix.os }}, ${{ matrix.env }}
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
env:
- ci/envs/38-minimal.yaml
- ci/envs/39-latest.yaml
environment-file:
- ci/envs/310-oldest.yaml
- ci/envs/310-latest.yaml
- ci/envs/310-dev.yaml
- ci/envs/311-latest.yaml
- ci/envs/312-latest.yaml
- ci/envs/312-dev.yaml
include:
- env: ci/envs/310-latest.yaml
- environment-file: ci/envs/312-latest.yaml
os: macos-latest
- env: ci/envs/310-latest.yaml
- environment-file: ci/envs/312-latest.yaml
os: windows-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.env }}
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
environment-file: ${{ matrix.environment-file }}

- name: Install momepy
run: pip install .

- name: Check environment
run: |
conda info
conda list
- name: Test momepy
run: |
pytest -v --color yes --cov-config .coveragerc --cov momepy --cov-append --cov-report term-missing --cov-report xml tests
pytest -v --color yes --cov momepy --cov-append --cov-report term-missing --cov-report xml .
- name: Test user guide
if: contains(matrix.env, '310-latest.yaml') && contains(matrix.os, 'ubuntu')
if: contains(matrix.environment-file, '312-latest.yaml') && contains(matrix.os, 'ubuntu')
run: |
ci/envs/test_user_guide.sh
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ run/
.asv
dask-worker-space
.DS_Store
.ruff_cache
25 changes: 10 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
files: 'momepy\/'
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.11"
hooks:
- id: ruff
- id: ruff-format

ci:
autofix_prs: false
autoupdate_schedule: quarterly
2 changes: 0 additions & 2 deletions .pylintrc

This file was deleted.

27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
Changelog
=========

Version 0.7.0 (November 22, 2023)
---------------------------------

Momepy now requires at least Python 3.10, GeoPandas 0.12, NetworkX 2.7 and tqdm 4.63.

Enhancements:

- ENH: support single-part multipolygons in ``Squareness`` and ``CentroidCorners`` (#507)
- ENH: add ``FaceArtifacts`` function to detect non-morphological artifacts in street
networks (#510)

Version 0.6.0 (May 1, 2023)
---------------------------

Momepy now requires shapely 2.0 or newer to run and no longer depends on PyGEOS. The
highlights of the release:

Enhancements:

- ENH: support bi-directional roads in ``gdf_to_nx`` (#357)
- ENH: geometry-based simplification of roundabouts (#371, #392)
- REF: update for shapely 2.0 (#479)

Bug fixes:

- resolves bug in ``Percentiles`` append. (#427)

Version 0.5.4 (September 20, 2022)
----------------------------------

Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# momepy
[![Documentation Status](https://readthedocs.org/projects/momepy/badge/?version=latest)](http://docs.momepy.org/en/latest/?badge=latest) [![Actions Status](https://github.com/pysal/momepy/workflows/Tests/badge.svg)](https://github.com/pysal/momepy/actions?query=workflow%3ATests)
[![codecov](https://codecov.io/gh/pysal/momepy/branch/main/graph/badge.svg?token=VNn0WR5JWT)](https://codecov.io/gh/pysal/momepy) [![CodeFactor](https://www.codefactor.io/repository/github/pysal/momepy/badge)](https://www.codefactor.io/repository/github/pysal/momepy) [![DOI](https://joss.theoj.org/papers/10.21105/joss.01807/status.svg)](https://doi.org/10.21105/joss.01807)
[![codecov](https://codecov.io/gh/pysal/momepy/branch/main/graph/badge.svg?token=VNn0WR5JWT)](https://codecov.io/gh/pysal/momepy) [![Discord](https://img.shields.io/badge/Discord-join%20chat-7289da?style=flat&logo=discord&logoColor=cccccc&link=https://discord.gg/he6Y8D2ap3)](https://discord.gg/he6Y8D2ap3) [![DOI](https://joss.theoj.org/papers/10.21105/joss.01807/status.svg)](https://doi.org/10.21105/joss.01807)


<img src="https://raw.githubusercontent.com/pysal/momepy/main/docs/_static/logo.png" width="50%">
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class TimeDimension:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class TimeDistribution:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down
2 changes: 0 additions & 2 deletions benchmarks/bench_diversity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class TimeDiversity:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down Expand Up @@ -34,7 +33,6 @@ class TimeDiversityBinning:
params = [("HeadTailBreaks", "Quantiles", "EqualInterval")]

def setup(self, *args):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

class TimeElements:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_tessellation = gpd.read_file(test_file_path, layer="tessellation")
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

class TimeGraph:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
self.network = mm.gdf_to_nx(self.df_streets)
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_intensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class TimeIntensity:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class TimeShape:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_streets = gpd.read_file(test_file_path, layer="streets")
Expand Down
1 change: 0 additions & 1 deletion benchmarks/bench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class TimeUtils:
def setup(self):

test_file_path = mm.datasets.get_path("bubenec")
self.df_buildings = gpd.read_file(test_file_path, layer="buildings")
self.df_tessellation = gpd.read_file(test_file_path, layer="tessellation")
Expand Down
13 changes: 4 additions & 9 deletions ci/envs/310-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ dependencies:
- python=3.10
- geopandas
- inequality
- libpysal>=4.6.0
- libpysal>=4.8.0
- mapclassify
- networkx
- packaging
- pandas!=1.5.0
- shapely>=2
- esda
- tqdm
# testing
- codecov
- pytest
- pytest-cov
# user guide testing
- dask
- inequality
- jupyter
- matplotlib
- osmnx
- pygeos
- pytest-cov
19 changes: 19 additions & 0 deletions ci/envs/310-oldest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.10
- geopandas=0.12
- inequality
- libpysal=4.8.0
- mapclassify
- networkx=2.7
- numpy=1.22
- packaging
- pandas>=1.4.0,!=1.5.0,<2
- shapely=2.0
- tqdm=4.63.0
# testing
- codecov
- pytest
- pytest-cov
14 changes: 10 additions & 4 deletions ci/envs/39-latest.yaml → ci/envs/311-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ name: test
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.11
- geopandas
- inequality
- libpysal>=4.6.0
- libpysal>=4.8.0
- mapclassify
- networkx
- osmnx
- packaging
- pandas!=1.5.0
- pygeos
- shapely>=2
- esda
- tqdm
# testing
- codecov
- pytest
- pytest-cov
# user guide testing
- dask
- inequality
- jupyter
- matplotlib
- osmnx
Loading

0 comments on commit d0c12e7

Please sign in to comment.