Skip to content

Commit af53e83

Browse files
authored
Merge pull request #230 from knaaptime/testing
old numpy nan
2 parents 4352234 + 0ab89a2 commit af53e83

File tree

6 files changed

+48
-30
lines changed

6 files changed

+48
-30
lines changed

.github/workflows/build_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
strategy:
1414
matrix:
1515
os: ['ubuntu-latest']
16-
environment-file: [.ci/39.yml]
16+
environment-file: [ci/312.yml]
1717
experimental: [false]
1818
defaults:
1919
run:

.github/workflows/unittests.yml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,88 @@
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- '*'
67
pull_request:
78
branches:
89
- '*'
910
schedule:
10-
- cron: "0 0 * * 1,4"
11+
- cron: '59 23 * * *'
1112
workflow_dispatch:
12-
inputs:
13-
version:
14-
description: Manual Unittest Run
15-
default: test
16-
required: false
13+
inputs:
14+
version:
15+
description: Manual CI Run
16+
default: test
17+
required: false
1718

1819
jobs:
19-
Tests:
20+
tests:
2021
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
2122
runs-on: ${{ matrix.os }}
23+
timeout-minutes: 30
2224
strategy:
23-
fail-fast: false
2425
matrix:
2526
os: [ubuntu-latest]
26-
environment-file:
27-
- ci/310.yml
28-
- ci/311.yml
29-
- ci/312.yml
27+
environment-file: [
28+
ci/311.yml,
29+
ci/312.yml,
30+
ci/313.yml,
31+
]
3032
include:
3133
- environment-file: ci/312.yml
3234
os: macos-13 # Intel
3335
- environment-file: ci/312.yml
34-
os: macos-14 # Apple Silicon
36+
os: macos-14 # Apple Silicon
3537
- environment-file: ci/312.yml
3638
os: windows-latest
39+
fail-fast: false
40+
3741
defaults:
3842
run:
3943
shell: bash -l {0}
40-
44+
4145
steps:
42-
- uses: actions/checkout@v4
43-
46+
- name: checkout repo
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0 # Fetch all history for all branches and tags.
50+
4451
- name: setup micromamba
4552
uses: mamba-org/setup-micromamba@v1
4653
with:
4754
environment-file: ${{ matrix.environment-file }}
4855
micromamba-version: 'latest'
49-
50-
- name: Test segregation
56+
57+
- name: environment info
5158
run: |
52-
pytest \
53-
segregation \
59+
micromamba info
60+
micromamba list
61+
62+
- name: spatial versions
63+
run: 'python -c "import geopandas; geopandas.show_versions();"'
64+
65+
- name: install package
66+
run: 'pip install . --no-deps'
67+
68+
- name: run tests
69+
run: |
70+
pytest segregation \
5471
-v \
5572
-r a \
73+
-n auto \
5674
--color yes \
5775
--cov segregation \
5876
--cov-append \
5977
--cov-report term-missing \
60-
--cov-report xml \
78+
--cov-report xml
6179
6280
- name: codecov
63-
uses: codecov/codecov-action@v4
81+
uses: codecov/codecov-action@v3
6482
with:
6583
token: ${{ secrets.CODECOV_TOKEN }}
6684
file: ./coverage.xml
6785
name: segregation-codecov
68-
86+
6987
- name: Generate and publish the report
7088
if: |
7189
failure()

ci/310.yml renamed to ci/313.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: test
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.10
5+
- python=3.13
66
- deprecation
77
- geopandas>=0.9
88
- joblib

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python=3.9
6+
- python>=3.12
77
- deprecation
88
- geopandas>=0.9
99
- joblib

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers = [
2727
"Intended Audience :: Science/Research",
2828
"Topic :: Scientific/Engineering :: GIS",
2929
]
30-
requires-python = ">=3.8"
30+
requires-python = ">=3.9"
3131
dependencies = [
3232
"deprecation",
3333
"geopandas>=0.9",

segregation/singlegroup/relative_centralization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def _relative_centralization(
145145
Xi = np.cumsum(x[asc_ind]) / X
146146
Yi = np.cumsum(y[asc_ind]) / Y
147147

148-
RCE = np.nansum(shift(Xi, 1, cval=np.NaN) * Yi) - np.nansum(
149-
Xi * shift(Yi, 1, cval=np.NaN)
148+
RCE = np.nansum(shift(Xi, 1, cval=np.nan) * Yi) - np.nansum(
149+
Xi * shift(Yi, 1, cval=np.nan)
150150
)
151151

152152
core_data = data[[group_pop_var, total_pop_var, data.geometry.name]]

0 commit comments

Comments
 (0)