diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index d9c7e113..99b2fa12 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -13,7 +13,7 @@ strategy: matrix: os: ['ubuntu-latest'] - environment-file: [.ci/39.yml] + environment-file: [ci/312.yml] experimental: [false] defaults: run: diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 139db760..9533a01a 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -2,70 +2,88 @@ on: push: - branches: [main] + branches: + - '*' pull_request: branches: - '*' schedule: - - cron: "0 0 * * 1,4" + - cron: '59 23 * * *' workflow_dispatch: - inputs: - version: - description: Manual Unittest Run - default: test - required: false + inputs: + version: + description: Manual CI Run + default: test + required: false jobs: - Tests: + tests: name: ${{ matrix.os }}, ${{ matrix.environment-file }} runs-on: ${{ matrix.os }} + timeout-minutes: 30 strategy: - fail-fast: false matrix: os: [ubuntu-latest] - environment-file: - - ci/310.yml - - ci/311.yml - - ci/312.yml + environment-file: [ + ci/311.yml, + ci/312.yml, + ci/313.yml, + ] include: - environment-file: ci/312.yml os: macos-13 # Intel - environment-file: ci/312.yml - os: macos-14 # Apple Silicon + os: macos-14 # Apple Silicon - environment-file: ci/312.yml os: windows-latest + fail-fast: false + defaults: run: shell: bash -l {0} - + steps: - - uses: actions/checkout@v4 - + - name: checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all branches and tags. + - name: setup micromamba uses: mamba-org/setup-micromamba@v1 with: environment-file: ${{ matrix.environment-file }} micromamba-version: 'latest' - - - name: Test segregation + + - name: environment info run: | - pytest \ - segregation \ + micromamba info + micromamba list + + - name: spatial versions + run: 'python -c "import geopandas; geopandas.show_versions();"' + + - name: install package + run: 'pip install . --no-deps' + + - name: run tests + run: | + pytest segregation \ -v \ -r a \ + -n auto \ --color yes \ --cov segregation \ --cov-append \ --cov-report term-missing \ - --cov-report xml \ + --cov-report xml - name: codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml name: segregation-codecov - + - name: Generate and publish the report if: | failure() diff --git a/ci/310.yml b/ci/313.yml similarity index 95% rename from ci/310.yml rename to ci/313.yml index 5bc24a64..2d2d5b36 100644 --- a/ci/310.yml +++ b/ci/313.yml @@ -2,7 +2,7 @@ name: test channels: - conda-forge dependencies: - - python=3.10 + - python=3.13 - deprecation - geopandas>=0.9 - joblib diff --git a/environment.yml b/environment.yml index dfe61705..994d4b5e 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.9 + - python>=3.12 - deprecation - geopandas>=0.9 - joblib diff --git a/pyproject.toml b/pyproject.toml index a30dd558..ef84bc77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ classifiers = [ "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering :: GIS", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "deprecation", "geopandas>=0.9", diff --git a/segregation/singlegroup/relative_centralization.py b/segregation/singlegroup/relative_centralization.py index f082d8d2..7fbd8d47 100644 --- a/segregation/singlegroup/relative_centralization.py +++ b/segregation/singlegroup/relative_centralization.py @@ -145,8 +145,8 @@ def _relative_centralization( Xi = np.cumsum(x[asc_ind]) / X Yi = np.cumsum(y[asc_ind]) / Y - RCE = np.nansum(shift(Xi, 1, cval=np.NaN) * Yi) - np.nansum( - Xi * shift(Yi, 1, cval=np.NaN) + RCE = np.nansum(shift(Xi, 1, cval=np.nan) * Yi) - np.nansum( + Xi * shift(Yi, 1, cval=np.nan) ) core_data = data[[group_pop_var, total_pop_var, data.geometry.name]]