Skip to content

Commit

Permalink
Merge branch 'plugin/schisto' into plugin-conda-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Oct 22, 2024
2 parents a82bbab + ec50151 commit f0689db
Show file tree
Hide file tree
Showing 47 changed files with 1,227 additions and 434 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
name: Check for syntax errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}

Expand All @@ -46,13 +46,13 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
python -m flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
check-history-rst-syntax:
name: Check HISTORY RST syntax
check-rst-syntax:
name: Check RST syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Set up python
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Lint with doc8
run: |
# Skip line-too-long errors (D001)
python -m doc8 --ignore D001 HISTORY.rst
python -m doc8 --ignore D001 HISTORY.rst README_PYTHON.rst
run-model-tests:
name: Run model tests
Expand All @@ -75,7 +75,7 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [windows-latest, macos-13]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -127,27 +127,27 @@ jobs:
run: make test

- name: Upload wheel artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Wheel for ${{ matrix.os }} ${{ matrix.python-version }}
path: dist

- name: Upload conda env artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: Conda Env for ${{ matrix.os }} ${{ matrix.python-version }}
path: conda-env.txt

- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request'
Expand All @@ -162,15 +162,15 @@ jobs:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [windows-latest, macos-13]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

- uses: ./.github/actions/setup_env
with:
python-version: ${{ matrix.python-version }}
requirements-files: requirements.txt
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }}
requirements: ${{ env.CONDA_DEFAULT_DEPENDENCIES }} twine

- name: Build source distribution
run: |
Expand All @@ -193,9 +193,12 @@ jobs:
# natcap.invest from source and that it imports.
python -c "from natcap.invest import *"
- uses: actions/upload-artifact@v3
- name: Check long description with twine
run: twine check $(find dist -name "natcap[._-]invest*")

- uses: actions/upload-artifact@v4
with:
name: Source distribution
name: Source distribution ${{ matrix.os }} ${{ matrix.python-version }}
path: dist

# Secrets not available in PR so don't use GCP.
Expand All @@ -204,13 +207,13 @@ jobs:
# different extensions)
- name: Authenticate GCP
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request' && matrix.os == 'macos-13' && matrix.python-version == env.LATEST_SUPPORTED_PYTHON_VERSION
Expand All @@ -221,7 +224,7 @@ jobs:
runs-on: windows-latest
needs: check-syntax-errors
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -252,7 +255,7 @@ jobs:

steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -309,7 +312,7 @@ jobs:
workspace-path: ${{ github.workspace }}
binary-extension: exe
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

Expand Down Expand Up @@ -383,13 +386,13 @@ jobs:

- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Build Workbench (PRs)
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -458,20 +461,20 @@ jobs:

- name: Upload workbench binary artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Workbench-${{ runner.os }}-binary
path: workbench/dist/*.${{ matrix.binary-extension }}

- name: Upload user's guide artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-user-guide
path: dist/InVEST_*_userguide.zip

- name: Upload workbench logging from puppeteer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ runner.os }}_puppeteer_log.zip'
Expand All @@ -490,7 +493,7 @@ jobs:

- name: Upload workspace on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-failed-${{ runner.os }}-workspace
path: ${{ matrix.workspace-path}}
Expand All @@ -500,11 +503,11 @@ jobs:
needs: check-syntax-errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch complete history for accurate versioning

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_SUPPORTED_PYTHON_VERSION }}

Expand All @@ -515,20 +518,20 @@ jobs:
- run: make sampledata sampledata_single

- name: Upload sample data artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: InVEST-sample-data
path: dist/*.zip

- name: Authenticate GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/auth@v0
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACC_KEY }}

- name: Set up GCP
if: github.event_name != 'pull_request'
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v2

- name: Deploy artifacts to GCS
if: github.event_name != 'pull_request'
Expand Down
35 changes: 34 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,41 @@
Unreleased Changes
------------------
* General
* InVEST has been updated to build against numpy 2.
https://github.com/natcap/invest/issues/1641
* Updating validation to handle a change in exceptions raised by GDAL in
``pygeoprocessing.get_raster_info`` and
``pygeoprocessing.get_vector_info``.
https://github.com/natcap/invest/issues/1645
* Forest Carbon Edge Effects
* Updating vector reprojection to allow partial reprojection. Related to
https://github.com/natcap/invest/issues/1645
* Urban Nature Access
* The model now works as expected when the user provides an LULC raster
that does not have a nodata value defined.
https://github.com/natcap/invest/issues/1293
* Workbench
* Several small updates to the model input form UI to improve usability and visual consistency (https://github.com/natcap/invest/issues/912)
* Several small updates to the model input form UI to improve usability
and visual consistency (https://github.com/natcap/invest/issues/912).
* Fixed a bug that caused the application to crash when attempting to
open a workspace without a valid logfile
(https://github.com/natcap/invest/issues/1598).
* Fixed a bug that was allowing readonly workspace directories on Windows
(https://github.com/natcap/invest/issues/1599).
* Fixed a bug that, in certain scenarios, caused a datastack to be saved
with relative paths when the Relative Paths checkbox was left unchecked
(https://github.com/natcap/invest/issues/1609).
* Improved error handling when a datastack cannot be saved with relative
paths across drives (https://github.com/natcap/invest/issues/1608).
* Habitat Quality
* Access raster is now generated from the reprojected access vector
(https://github.com/natcap/invest/issues/1615).
* Rarity values are now output in CSV format (as well as in raster format)
(https://github.com/natcap/invest/issues/721).
* Urban Flood Risk
* Fields present on the input AOI vector are now retained in the output.
(https://github.com/natcap/invest/issues/1600)

3.14.2 (2024-05-29)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT_TEST_DATA_REPO_REV := 324abde73e1d770ad75921466ecafd1ec6297752

GIT_UG_REPO := https://github.com/natcap/invest.users-guide
GIT_UG_REPO_PATH := doc/users-guide
GIT_UG_REPO_REV := 0404bc5d4d43085cdc58f50f8fc29944b10cefb1
GIT_UG_REPO_REV := f203ec069f9f03560c9a85b268e67ebb6b994953

ENV = "./env"
ifeq ($(OS),Windows_NT)
Expand Down
6 changes: 4 additions & 2 deletions constraints_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
# occur with regular use of invest. https://github.com/OSGeo/gdal/issues/8497
GDAL!=3.6.*,!=3.7.*

# https://github.com/natcap/pygeoprocessing/issues/387
GDAL<3.8.5
# Pyinstaller 6.10 breaks our windows builds. Until we can figure out the
# root cause, let's cap the versions to those that work.
# https://github.com/natcap/invest/issues/1622
#pyinstaller<6.10
12 changes: 5 additions & 7 deletions doc/api-docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@
# -- Options for HTML output ----------------------------------------------

import sphinx_rtd_theme

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "_static/invest-logo.png"
Expand Down Expand Up @@ -130,16 +128,16 @@
# dir menu entry, description, category)
texinfo_documents = [
('index', 'InVEST', 'InVEST Documentation',
'The Natural Capital Project', 'InVEST',
'The Natural Capital Project', 'InVEST',
'Integrated Valuation of Ecosystem Services and Tradeoffs',
'Scientific Software'),
]


# -- Prepare for sphinx build ---------------------------------------------

# Use sphinx apidoc tool to generate documentation for invest. Generated rst
# files go into the api/ directory. Note that some apidoc options may not work
# Use sphinx apidoc tool to generate documentation for invest. Generated rst
# files go into the api/ directory. Note that some apidoc options may not work
# the same because we aren't using their values in the custom templates
apidoc.main([
'--force', # overwrite any files from previous run
Expand All @@ -164,7 +162,7 @@
All InVEST models share a consistent python API:
- Every InVEST model has a corresponding module or subpackage in the
- Every InVEST model has a corresponding module or subpackage in the
``natcap.invest`` package
- The model modules contain a function called ``execute``
- The ``execute`` function takes a single argument (``args``), a dictionary
Expand Down
5 changes: 1 addition & 4 deletions exe/hooks/rthook.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import sys
import os
import multiprocessing
import platform

multiprocessing.freeze_support()
import sys

os.environ['PROJ_LIB'] = os.path.join(sys._MEIPASS, 'proj')

Expand Down
4 changes: 3 additions & 1 deletion exe/invest.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ kwargs = {
'pkg_resources.py2_warn',
'cmath',
'charset_normalizer',
'scipy.special._cdflib'
'scipy.special._cdflib',
'scipy.special._special_ufuncs',
'scipy._lib.array_api_compat.numpy.fft',
],
'datas': [proj_datas],
'cipher': block_cipher,
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ invest = "natcap.invest.cli:main"
# available at runtime.
requires = [
'setuptools>=61', 'wheel', 'setuptools_scm>=8.0', 'cython>=3.0.0', 'babel',
'oldest-supported-numpy'
'oldest-supported-numpy; python_version<="3.8"',
'numpy>=2; python_version>="3.9"', # numpy 2 only available for 3.9+
]
build-backend = "setuptools.build_meta"

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
GDAL>=3.4.2
Pyro4==4.77 # pip-only
pandas>=1.2.1
numpy>=1.11.0,!=1.16.0,<2.0
numpy>=1.11.0,!=1.16.0
Rtree>=0.8.2,!=0.9.1
shapely>=2.0.0
scipy>=1.9.0,!=1.12.*
pygeoprocessing>=2.4.2 # pip-only
pygeoprocessing>=2.4.6 # pip-only
taskgraph>=0.11.0
psutil>=5.6.6
chardet>=3.0.4
Expand Down
Loading

0 comments on commit f0689db

Please sign in to comment.