Skip to content

Commit

Permalink
Merge branch 'main' into feature/plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Dec 12, 2024
2 parents e6318a6 + f933907 commit 3bae582
Show file tree
Hide file tree
Showing 84 changed files with 14,588 additions and 7,536 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release-part-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,24 @@ jobs:
perl -0777 -i -pe \
"s/Unreleased Changes\n------------------/..\n Unreleased Changes\n ------------------\n\n${HEADER}\n${UNDERLINE}/g" \
HISTORY.rst
- name: Install dependencies
run: pip install rst2html5

- name: Generate changelog.html
run: rst2html5 HISTORY.rst workbench/changelog.html

- name: Update package.json version
uses: BellCubeDev/update-package-version-by-release-tag@v2
with:
version: ${{ inputs.version }}
package-json-path: workbench/package.json

- name: Commit updated HISTORY.rst, changelog.html, and package.json
run: |
git add HISTORY.rst
git add workbench/changelog.html
git add workbench/package.json
git commit -m "Committing the $VERSION release."
- name: Tag and push
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-part-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
twine upload \
--username="__token__" \
--password=${{ secrets.PYPI_NATCAP_INVEST_TOKEN }} \
artifacts/natcap.invest*
artifacts/natcap.invest* artifacts/natcap_invest*
- name: Roll back on failure
if: failure()
Expand Down
46 changes: 39 additions & 7 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,18 @@ Unreleased Changes
``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
* 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
* Updated translations for Spanish and Chinese
* natcap.invest now works with (and requires) ``gdal.UseExceptions``. A
``FutureWarning`` is raised on import if GDAL exceptions are not enabled.
* Fixed an issue on Windows where GDAL fails to find its DLLs due to
an interfering GDAL installation on the PATH, such as from anaconda.
https://github.com/natcap/invest/issues/1643
* Improved error handling of NA values in raster reclassification to provide
a more descriptive message.
* Workbench
* Several small updates to the model input form UI to improve usability
and visual consistency (https://github.com/natcap/invest/issues/912).
Expand All @@ -64,14 +69,41 @@ Unreleased Changes
(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).
* The InVEST changelog now displays in the Workbench the first time a new
version is launched (https://github.com/natcap/invest/issues/1368).
* 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).
* Improved error handling when there is a missing LULC value in the
sensitivity table (https://github.com/natcap/invest/issues/1671).
* Pollination
* Fixed an issue with nodata handling that was causing some outputs to be
filled either with the float32 value for positive infinity, or else with
a value very close to it. https://github.com/natcap/invest/issues/1635
* While working on https://github.com/natcap/invest/issues/1635, we also
updated the stated dtype of most pollination model outputs to be float32
instead of the float64 dtype that was being assumed previously. This
will result in smaller output filesizes with minimal loss of precision.
* Seasonal Water Yield
* Added support for zero padding in month numbers in ET and precipitation
file names (i.e., users can now name their file Precip_01.tif).
(https://github.com/natcap/invest/issues/1166)
* 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
11 changes: 9 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 := f203ec069f9f03560c9a85b268e67ebb6b994953
GIT_UG_REPO_REV := 5ee3616d4549baf3b1e44e0fcef485145389e29a

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

GSUTIL := gsutil
SIGNTOOL := SignTool
RST2HTML5 := rst2html5

# local directory names
DIST_DIR := dist
DIST_DATA_DIR := $(DIST_DIR)/data
BUILD_DIR := build
WORKBENCH := workbench
WORKBENCH_DIST_DIR := $(WORKBENCH)/dist
CHANGELOG_SRC := HISTORY.rst
CHANGELOG_DEST := $(WORKBENCH)/changelog.html

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

changelog:
$(RST2HTML5) $(CHANGELOG_SRC) $(CHANGELOG_DEST)

# Notes on Makefile development
#
# * Use the -drR to show the decision tree (and none of the implicit rules)
Expand Down
86 changes: 56 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ General Information
Dependencies
------------

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

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

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

Using a different environment name
""""""""""""""""""""""""""""""""""
If you prefer a different name for your environment, you may pass the environment name as
Using a different environment folder name
"""""""""""""""""""""""""""""""""""""""""
If you prefer a different path for your environment, you may pass the environment path as
a parameter to make::

$ make ENV=myEnv env

You could then activate the environment created at ``myEnv``.
You could then activate the environment created at ``./myEnv``.


Using a different environment management tool
"""""""""""""""""""""""""""""""""""""""""""""
The InVEST Makefile uses ``virtualenv`` to set up an environment, but this is
not the only `environment management tool out there
<https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments>`_.
You may elect to manage your virtual environment a different way, independent
of ``make env``. The only requirement for the build process is that the required
tools are available on your PATH and the required python packages can be imported.
You may of course choose to manage your own virtual environment without using the Makefile.

We suggest using ``conda`` or ``mamba`` and ``conda-forge``.

``requirements.txt``, ``requirements-dev.txt`` and ``requirements-docs.txt`` list the python
dependencies needed.

Installing ``natcap.invest`` from local source code
"""""""""""""""""""""""""""""""""""""""""""""""""""
From an activated virtual environment, it's safest to uninstall any existing installation
and then install `natcap.invest`::

$ pip uninstall natcap.invest
$ make install

In practice, it can be convenient to use an "editable install" instead to avoid needing
to uninstall & re-install after making changes to source code::

$ pip install -e .

Note that with an editable install any changes to non-Python (Cython, C++) files will
require compilation using one of the above installation methods.

*The Workbench is not part of the* ``natcap.invest`` *Python package. See*
``workbench/readme.md`` *for developer details.*

A successful ``natcap.invest`` installation will include the InVEST CLI::

$ invest list

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

The User's Guide is maintained in a separate git repository. InVEST will build
the User's Guide with the commit defined in the ``Makefile``::

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


API Documentation
+++++++++++++++++
Expand All @@ -168,22 +194,12 @@ build zip archives of the sample data::

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

Single archive of sample data
+++++++++++++++++++++++++++++

For trainings, it is especially convenient to distribute all sample data as a
single zip archive. As an added bonus, this single zip archive can be provided
to the InVEST installer for Windows as either the 'Advanced' input on the front
page of the installer, or by a CLI flag, thus preventing the installer from
downloading datasets from the internet. See
``installer/windows/invest_installer.nsi`` for more details. To build a single
archive of all InVEST sample data::

$ make sampledata_single

This will write the single sampledata archive to
``dist/InVEST_*_sample_data.zip``.
Sample data is tracked in a ``git-lfs`` repo and will be packaged based on the commit
defined in the ``Makefile``::

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 := 0f8b41557753dad3670ba8220f41650b51435a93

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

$ make test

Tests depend on test data that is tracked in a ``git-lfs`` repo defined in the ``Makefile``::

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

Test data (and Sample Data) can be retrieved using::

$ make fetch


Changing how GNU make runs tests
++++++++++++++++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion doc/api-docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,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 3bae582

Please sign in to comment.