Skip to content

Commit

Permalink
Merge pull request #1670 from emlys/merge-main
Browse files Browse the repository at this point in the history
Merge main into feature/routing-refactor
  • Loading branch information
emlys authored Oct 29, 2024
2 parents fcff8db + d7d5210 commit 4843058
Show file tree
Hide file tree
Showing 46 changed files with 1,233 additions and 572 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 @@ -366,13 +369,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 @@ -441,20 +444,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 @@ -473,7 +476,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 @@ -483,11 +486,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 @@ -498,20 +501,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
43 changes: 42 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,49 @@
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
* The scripting page of the InVEST API documentation has been updated to
reflect changes in how InVEST is installed on modern systems, and also to
include images of the InVEST workbench instead of just broken links.
https://github.com/natcap/invest/issues/1660
* 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).
* Coastal Vulnerability
* Fixed a regression where an AOI with multiple features could raise a
TypeError after intersecting with the landmass polygon.
https://github.com/natcap/invest/issues/1657
* Forest Carbon Edge Effects
* Updating vector reprojection to allow partial reprojection. Related to
https://github.com/natcap/invest/issues/1645
* 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)
* 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

3.14.2 (2024-05-29)
-------------------
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
DATA_DIR := data
GIT_SAMPLE_DATA_REPO := https://bitbucket.org/natcap/invest-sample-data.git
GIT_SAMPLE_DATA_REPO_PATH := $(DATA_DIR)/invest-sample-data
GIT_SAMPLE_DATA_REPO_REV := ab8c74a62a93fd0019de2bca064abc0a5a07afab
GIT_SAMPLE_DATA_REPO_REV := 0f8b41557753dad3670ba8220f41650b51435a93

GIT_TEST_DATA_REPO := https://bitbucket.org/natcap/invest-test-data.git
GIT_TEST_DATA_REPO_PATH := $(DATA_DIR)/invest-test-data
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
14 changes: 6 additions & 8 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 All @@ -189,7 +187,7 @@
natcap.invest.carbon.execute(args)
For examples of scripting a model run, or multiple successive model runs,
see :ref:`CreatingSamplePythonScripts`.
see :ref:`CreatingPythonScripts`.
.. contents:: Available Models and Tools:
Expand Down
Loading

0 comments on commit 4843058

Please sign in to comment.