Skip to content

Commit 3bae582

Browse files
committed
Merge branch 'main' into feature/plugins
2 parents e6318a6 + f933907 commit 3bae582

File tree

84 files changed

+14588
-7536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+14588
-7536
lines changed

.github/workflows/release-part-1.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,24 @@ jobs:
5353
perl -0777 -i -pe \
5454
"s/Unreleased Changes\n------------------/..\n Unreleased Changes\n ------------------\n\n${HEADER}\n${UNDERLINE}/g" \
5555
HISTORY.rst
56+
57+
- name: Install dependencies
58+
run: pip install rst2html5
59+
60+
- name: Generate changelog.html
61+
run: rst2html5 HISTORY.rst workbench/changelog.html
62+
63+
- name: Update package.json version
64+
uses: BellCubeDev/update-package-version-by-release-tag@v2
65+
with:
66+
version: ${{ inputs.version }}
67+
package-json-path: workbench/package.json
68+
69+
- name: Commit updated HISTORY.rst, changelog.html, and package.json
70+
run: |
5671
git add HISTORY.rst
72+
git add workbench/changelog.html
73+
git add workbench/package.json
5774
git commit -m "Committing the $VERSION release."
5875
5976
- name: Tag and push

.github/workflows/release-part-2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
twine upload \
100100
--username="__token__" \
101101
--password=${{ secrets.PYPI_NATCAP_INVEST_TOKEN }} \
102-
artifacts/natcap.invest*
102+
artifacts/natcap.invest* artifacts/natcap_invest*
103103
104104
- name: Roll back on failure
105105
if: failure()

HISTORY.rst

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,18 @@ Unreleased Changes
4444
``pygeoprocessing.get_raster_info`` and
4545
``pygeoprocessing.get_vector_info``.
4646
https://github.com/natcap/invest/issues/1645
47-
* Forest Carbon Edge Effects
48-
* Updating vector reprojection to allow partial reprojection. Related to
49-
https://github.com/natcap/invest/issues/1645
50-
* Urban Nature Access
51-
* The model now works as expected when the user provides an LULC raster
52-
that does not have a nodata value defined.
53-
https://github.com/natcap/invest/issues/1293
47+
* The scripting page of the InVEST API documentation has been updated to
48+
reflect changes in how InVEST is installed on modern systems, and also to
49+
include images of the InVEST workbench instead of just broken links.
50+
https://github.com/natcap/invest/issues/1660
51+
* Updated translations for Spanish and Chinese
52+
* natcap.invest now works with (and requires) ``gdal.UseExceptions``. A
53+
``FutureWarning`` is raised on import if GDAL exceptions are not enabled.
54+
* Fixed an issue on Windows where GDAL fails to find its DLLs due to
55+
an interfering GDAL installation on the PATH, such as from anaconda.
56+
https://github.com/natcap/invest/issues/1643
57+
* Improved error handling of NA values in raster reclassification to provide
58+
a more descriptive message.
5459
* Workbench
5560
* Several small updates to the model input form UI to improve usability
5661
and visual consistency (https://github.com/natcap/invest/issues/912).
@@ -64,14 +69,41 @@ Unreleased Changes
6469
(https://github.com/natcap/invest/issues/1609).
6570
* Improved error handling when a datastack cannot be saved with relative
6671
paths across drives (https://github.com/natcap/invest/issues/1608).
72+
* The InVEST changelog now displays in the Workbench the first time a new
73+
version is launched (https://github.com/natcap/invest/issues/1368).
74+
* Coastal Vulnerability
75+
* Fixed a regression where an AOI with multiple features could raise a
76+
TypeError after intersecting with the landmass polygon.
77+
https://github.com/natcap/invest/issues/1657
78+
* Forest Carbon Edge Effects
79+
* Updating vector reprojection to allow partial reprojection. Related to
80+
https://github.com/natcap/invest/issues/1645
6781
* Habitat Quality
6882
* Access raster is now generated from the reprojected access vector
6983
(https://github.com/natcap/invest/issues/1615).
7084
* Rarity values are now output in CSV format (as well as in raster format)
7185
(https://github.com/natcap/invest/issues/721).
86+
* Improved error handling when there is a missing LULC value in the
87+
sensitivity table (https://github.com/natcap/invest/issues/1671).
88+
* Pollination
89+
* Fixed an issue with nodata handling that was causing some outputs to be
90+
filled either with the float32 value for positive infinity, or else with
91+
a value very close to it. https://github.com/natcap/invest/issues/1635
92+
* While working on https://github.com/natcap/invest/issues/1635, we also
93+
updated the stated dtype of most pollination model outputs to be float32
94+
instead of the float64 dtype that was being assumed previously. This
95+
will result in smaller output filesizes with minimal loss of precision.
96+
* Seasonal Water Yield
97+
* Added support for zero padding in month numbers in ET and precipitation
98+
file names (i.e., users can now name their file Precip_01.tif).
99+
(https://github.com/natcap/invest/issues/1166)
72100
* Urban Flood Risk
73101
* Fields present on the input AOI vector are now retained in the output.
74102
(https://github.com/natcap/invest/issues/1600)
103+
* Urban Nature Access
104+
* The model now works as expected when the user provides an LULC raster
105+
that does not have a nodata value defined.
106+
https://github.com/natcap/invest/issues/1293
75107

76108
3.14.2 (2024-05-29)
77109
-------------------

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
DATA_DIR := data
33
GIT_SAMPLE_DATA_REPO := https://bitbucket.org/natcap/invest-sample-data.git
44
GIT_SAMPLE_DATA_REPO_PATH := $(DATA_DIR)/invest-sample-data
5-
GIT_SAMPLE_DATA_REPO_REV := ab8c74a62a93fd0019de2bca064abc0a5a07afab
5+
GIT_SAMPLE_DATA_REPO_REV := 0f8b41557753dad3670ba8220f41650b51435a93
66

77
GIT_TEST_DATA_REPO := https://bitbucket.org/natcap/invest-test-data.git
88
GIT_TEST_DATA_REPO_PATH := $(DATA_DIR)/invest-test-data
99
GIT_TEST_DATA_REPO_REV := 324abde73e1d770ad75921466ecafd1ec6297752
1010

1111
GIT_UG_REPO := https://github.com/natcap/invest.users-guide
1212
GIT_UG_REPO_PATH := doc/users-guide
13-
GIT_UG_REPO_REV := f203ec069f9f03560c9a85b268e67ebb6b994953
13+
GIT_UG_REPO_REV := 5ee3616d4549baf3b1e44e0fcef485145389e29a
1414

1515
ENV = "./env"
1616
ifeq ($(OS),Windows_NT)
@@ -66,13 +66,16 @@ PYTHON_ARCH := $(shell $(PYTHON) -c "import sys; print('x86' if sys.maxsize <= 2
6666

6767
GSUTIL := gsutil
6868
SIGNTOOL := SignTool
69+
RST2HTML5 := rst2html5
6970

7071
# local directory names
7172
DIST_DIR := dist
7273
DIST_DATA_DIR := $(DIST_DIR)/data
7374
BUILD_DIR := build
7475
WORKBENCH := workbench
7576
WORKBENCH_DIST_DIR := $(WORKBENCH)/dist
77+
CHANGELOG_SRC := HISTORY.rst
78+
CHANGELOG_DEST := $(WORKBENCH)/changelog.html
7679

7780
# The fork name and user here are derived from the git path on github.
7881
# The fork name will need to be set manually (e.g. make FORKNAME=natcap/invest)
@@ -141,6 +144,7 @@ help:
141144
@echo " binaries to build pyinstaller binaries"
142145
@echo " apidocs to build HTML API documentation"
143146
@echo " userguide to build HTML version of the users guide"
147+
@echo " changelog to build HTML version of the changelog"
144148
@echo " python_packages to build natcap.invest wheel and source distributions"
145149
@echo " codesign_mac to sign the mac disk image using the codesign utility"
146150
@echo " codesign_windows to sign the windows installer using the SignTool utility"
@@ -366,6 +370,9 @@ deploy:
366370
@echo "Application binaries (if they were created) can be downloaded from:"
367371
@echo " * $(DOWNLOAD_DIR_URL)"
368372

373+
changelog:
374+
$(RST2HTML5) $(CHANGELOG_SRC) $(CHANGELOG_DEST)
375+
369376
# Notes on Makefile development
370377
#
371378
# * Use the -drR to show the decision tree (and none of the implicit rules)

README.rst

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ General Information
3535
Dependencies
3636
------------
3737

38-
Run ``make check`` to test if all required dependencies are installed on your system.
3938
OS-specific installation instructions are found either online at
4039
http://invest.readthedocs.io/en/latest/installing.html or locally at ``doc/api-docs/installing.rst``.
4140

@@ -57,30 +56,50 @@ Or on Windows, use the following instead from a CMD prompt::
5756
> make env
5857
> .\env\bin\activate
5958

60-
This makefile target is included for convenience ... you may of course choose to
61-
manage your own virtual environment. ``requirements.txt``,
62-
``requirements-dev.txt`` and ``requirements-docs.txt`` list the python
63-
dependencies needed.
59+
This makefile target is included for convenience. It uses ``conda`` and installs packages from ``conda-forge``.
60+
It also uses the `-p` flag with `conda create`, creating a `./env` folder containing the environment.
6461

65-
Using a different environment name
66-
""""""""""""""""""""""""""""""""""
67-
If you prefer a different name for your environment, you may pass the environment name as
62+
Using a different environment folder name
63+
"""""""""""""""""""""""""""""""""""""""""
64+
If you prefer a different path for your environment, you may pass the environment path as
6865
a parameter to make::
6966

7067
$ make ENV=myEnv env
7168

72-
You could then activate the environment created at ``myEnv``.
69+
You could then activate the environment created at ``./myEnv``.
7370

7471

7572
Using a different environment management tool
7673
"""""""""""""""""""""""""""""""""""""""""""""
77-
The InVEST Makefile uses ``virtualenv`` to set up an environment, but this is
78-
not the only `environment management tool out there
79-
<https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments>`_.
80-
You may elect to manage your virtual environment a different way, independent
81-
of ``make env``. The only requirement for the build process is that the required
82-
tools are available on your PATH and the required python packages can be imported.
74+
You may of course choose to manage your own virtual environment without using the Makefile.
75+
76+
We suggest using ``conda`` or ``mamba`` and ``conda-forge``.
77+
78+
``requirements.txt``, ``requirements-dev.txt`` and ``requirements-docs.txt`` list the python
79+
dependencies needed.
80+
81+
Installing ``natcap.invest`` from local source code
82+
"""""""""""""""""""""""""""""""""""""""""""""""""""
83+
From an activated virtual environment, it's safest to uninstall any existing installation
84+
and then install `natcap.invest`::
85+
86+
$ pip uninstall natcap.invest
87+
$ make install
88+
89+
In practice, it can be convenient to use an "editable install" instead to avoid needing
90+
to uninstall & re-install after making changes to source code::
91+
92+
$ pip install -e .
93+
94+
Note that with an editable install any changes to non-Python (Cython, C++) files will
95+
require compilation using one of the above installation methods.
96+
97+
*The Workbench is not part of the* ``natcap.invest`` *Python package. See*
98+
``workbench/readme.md`` *for developer details.*
8399

100+
A successful ``natcap.invest`` installation will include the InVEST CLI::
101+
102+
$ invest list
84103

85104
Building InVEST Distributions
86105
-----------------------------
@@ -145,6 +164,13 @@ To build the user's guide::
145164
This will build HTML and PDF documentation, writing them to ``dist/userguide``
146165
and ``dist/InVEST_*_Documentation.pdf``, respectively.
147166

167+
The User's Guide is maintained in a separate git repository. InVEST will build
168+
the User's Guide with the commit defined in the ``Makefile``::
169+
170+
GIT_UG_REPO := https://github.com/natcap/invest.users-guide
171+
GIT_UG_REPO_PATH := doc/users-guide
172+
GIT_UG_REPO_REV := f203ec069f9f03560c9a85b268e67ebb6b994953
173+
148174

149175
API Documentation
150176
+++++++++++++++++
@@ -168,22 +194,12 @@ build zip archives of the sample data::
168194

169195
This will write the data zipfiles to ``dist/data``. ``git`` command is needed.
170196

171-
Single archive of sample data
172-
+++++++++++++++++++++++++++++
173-
174-
For trainings, it is especially convenient to distribute all sample data as a
175-
single zip archive. As an added bonus, this single zip archive can be provided
176-
to the InVEST installer for Windows as either the 'Advanced' input on the front
177-
page of the installer, or by a CLI flag, thus preventing the installer from
178-
downloading datasets from the internet. See
179-
``installer/windows/invest_installer.nsi`` for more details. To build a single
180-
archive of all InVEST sample data::
181-
182-
$ make sampledata_single
183-
184-
This will write the single sampledata archive to
185-
``dist/InVEST_*_sample_data.zip``.
197+
Sample data is tracked in a ``git-lfs`` repo and will be packaged based on the commit
198+
defined in the ``Makefile``::
186199

200+
GIT_SAMPLE_DATA_REPO := https://bitbucket.org/natcap/invest-sample-data.git
201+
GIT_SAMPLE_DATA_REPO_PATH := $(DATA_DIR)/invest-sample-data
202+
GIT_SAMPLE_DATA_REPO_REV := 0f8b41557753dad3670ba8220f41650b51435a93
187203

188204
Tests
189205
-----
@@ -197,6 +213,16 @@ To run tests on the suite of Ecosystem Service models in InVEST::
197213

198214
$ make test
199215

216+
Tests depend on test data that is tracked in a ``git-lfs`` repo defined in the ``Makefile``::
217+
218+
GIT_TEST_DATA_REPO := https://bitbucket.org/natcap/invest-test-data.git
219+
GIT_TEST_DATA_REPO_PATH := $(DATA_DIR)/invest-test-data
220+
GIT_TEST_DATA_REPO_REV := 324abde73e1d770ad75921466ecafd1ec6297752
221+
222+
Test data (and Sample Data) can be retrieved using::
223+
224+
$ make fetch
225+
200226

201227
Changing how GNU make runs tests
202228
++++++++++++++++++++++++++++++++

doc/api-docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
natcap.invest.carbon.execute(args)
188188
189189
For examples of scripting a model run, or multiple successive model runs,
190-
see :ref:`CreatingSamplePythonScripts`.
190+
see :ref:`CreatingPythonScripts`.
191191
192192
193193
.. contents:: Available Models and Tools:

0 commit comments

Comments
 (0)