From 986f6ac892b2216c419038f44da4004b2b1fc9ce Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 15 Oct 2020 10:18:21 -0400 Subject: [PATCH 1/4] I. #319 Fixing Windows model links. Fixed a couple models that were pointing to the wrong html name. --- HISTORY.rst | 1 + src/natcap/invest/ui/globio.py | 2 +- src/natcap/invest/ui/habitat_quality.py | 2 +- src/natcap/invest/ui/hra.py | 2 +- src/natcap/invest/ui/hydropower.py | 2 +- src/natcap/invest/ui/ndr.py | 2 +- src/natcap/invest/ui/sdr.py | 2 +- src/natcap/invest/ui/urban_flood_risk_mitigation.py | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 02560ebea0..70dd245e3d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -55,6 +55,7 @@ Unreleased Changes (3.9) messages from the model execution will show up when you run the script. * InVEST is now a 64-bit binary built against Python 3.7. * Adding Python 3.8 support for InVEST testing. + * Fixing model documentation links for Windows. * Coastal Vulnerability * 'shore_points_missing_geomorphology.gpkg' output file name now includes the suffix if any, and its one layer now is renamed from diff --git a/src/natcap/invest/ui/globio.py b/src/natcap/invest/ui/globio.py index b718ec2eb6..0ae83c57a9 100644 --- a/src/natcap/invest/ui/globio.py +++ b/src/natcap/invest/ui/globio.py @@ -11,7 +11,7 @@ def __init__(self): label='GLOBIO', target=natcap.invest.globio.execute, validator=natcap.invest.globio.validate, - localdoc='../documentation/globio.html') + localdoc='globio.html') self.lulc_to_globio_table_path = inputs.File( args_key='lulc_to_globio_table_path', diff --git a/src/natcap/invest/ui/habitat_quality.py b/src/natcap/invest/ui/habitat_quality.py index ed5c8a0590..afe149a9b9 100644 --- a/src/natcap/invest/ui/habitat_quality.py +++ b/src/natcap/invest/ui/habitat_quality.py @@ -11,7 +11,7 @@ def __init__(self): label='Habitat Quality', target=natcap.invest.habitat_quality.execute, validator=natcap.invest.habitat_quality.validate, - localdoc='../documentation/habitat_quality.html') + localdoc='habitat_quality.html') self.current_landcover = inputs.File( args_key='lulc_cur_path', helptext=( diff --git a/src/natcap/invest/ui/hra.py b/src/natcap/invest/ui/hra.py index 6dbaff4e37..d84e5b72b6 100644 --- a/src/natcap/invest/ui/hra.py +++ b/src/natcap/invest/ui/hra.py @@ -10,7 +10,7 @@ def __init__(self): label='Habitat Risk Assessment', target=hra.execute, validator=hra.validate, - localdoc='../documentation/habitat_risk_assessment.html') + localdoc='habitat_risk_assessment.html') self.info_table_path = inputs.File( args_key='info_table_path', diff --git a/src/natcap/invest/ui/hydropower.py b/src/natcap/invest/ui/hydropower.py index ee7a6630d0..b1c42cec00 100644 --- a/src/natcap/invest/ui/hydropower.py +++ b/src/natcap/invest/ui/hydropower.py @@ -11,7 +11,7 @@ def __init__(self): label='Hydropower Water Yield', target=hydropower_water_yield.execute, validator=hydropower_water_yield.validate, - localdoc='../documentation/reservoirhydropowerproduction.html') + localdoc='reservoirhydropowerproduction.html') self.precipitation = inputs.File( args_key='precipitation_path', diff --git a/src/natcap/invest/ui/ndr.py b/src/natcap/invest/ui/ndr.py index b996018da7..f21dcc6105 100644 --- a/src/natcap/invest/ui/ndr.py +++ b/src/natcap/invest/ui/ndr.py @@ -11,7 +11,7 @@ def __init__(self): label='Nutrient Delivery Ratio Model (NDR)', target=natcap.invest.ndr.ndr.execute, validator=natcap.invest.ndr.ndr.validate, - localdoc='waterpurification.html') + localdoc='ndr.html') self.dem_path = inputs.File( args_key='dem_path', diff --git a/src/natcap/invest/ui/sdr.py b/src/natcap/invest/ui/sdr.py index b0b5aea6b7..ddc7f2c06b 100644 --- a/src/natcap/invest/ui/sdr.py +++ b/src/natcap/invest/ui/sdr.py @@ -11,7 +11,7 @@ def __init__(self): label='Sediment Delivery Ratio Model (SDR)', target=natcap.invest.sdr.sdr.execute, validator=natcap.invest.sdr.sdr.validate, - localdoc='../documentation/sdr.html') + localdoc='sdr.html') self.dem_path = inputs.File( args_key='dem_path', helptext=( diff --git a/src/natcap/invest/ui/urban_flood_risk_mitigation.py b/src/natcap/invest/ui/urban_flood_risk_mitigation.py index 578cd26a18..5ebea9a926 100644 --- a/src/natcap/invest/ui/urban_flood_risk_mitigation.py +++ b/src/natcap/invest/ui/urban_flood_risk_mitigation.py @@ -11,7 +11,7 @@ def __init__(self): label='UrbanFloodRiskMitigation', target=natcap.invest.urban_flood_risk_mitigation.execute, validator=natcap.invest.urban_flood_risk_mitigation.validate, - localdoc='../documentation/urban_flood_risk_mitigation.html') + localdoc='urban_flood_mitigation.html') self.aoi_watersheds_path = inputs.File( args_key='aoi_watersheds_path', From 9e31b4bcd8a70806aa6a22a51eeead56d777845e Mon Sep 17 00:00:00 2001 From: James Douglass Date: Mon, 23 Nov 2020 11:14:47 -0800 Subject: [PATCH 2/4] Updating mac build to include the HTML docs within the .app directory. RE:#319 --- Makefile | 6 +++--- installer/darwin/build_app_bundle.sh | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 05b92472a8..c27c046c17 100644 --- a/Makefile +++ b/Makefile @@ -333,13 +333,13 @@ $(WINDOWS_INSTALLER_FILE): $(INVEST_BINARIES_DIR) $(USERGUIDE_ZIP_FILE) build/vc makensis /DVERSION=$(VERSION) /DBINDIR=$(INVEST_BINARIES_DIR) /DARCHITECTURE=$(PYTHON_ARCH) /DFORKNAME=$(INSTALLER_NAME_FORKUSER) /DDATA_LOCATION=$(DATA_BASE_URL) installer\windows\invest_installer.nsi DMG_CONFIG_FILE := installer/darwin/dmgconf.py -mac_dmg: $(MAC_DISK_IMAGE_FILE) +mac_dmg: $(MAC_DISK_IMAGE_FILE) $(MAC_DISK_IMAGE_FILE): $(DIST_DIR) $(MAC_APPLICATION_BUNDLE) $(USERGUIDE_HTML_DIR) dmgbuild -Dinvestdir=$(MAC_APPLICATION_BUNDLE) -s $(DMG_CONFIG_FILE) "InVEST $(VERSION)" $(MAC_DISK_IMAGE_FILE) mac_app: $(MAC_APPLICATION_BUNDLE) -$(MAC_APPLICATION_BUNDLE): $(BUILD_DIR) $(INVEST_BINARIES_DIR) - ./installer/darwin/build_app_bundle.sh $(VERSION) $(INVEST_BINARIES_DIR) $(MAC_APPLICATION_BUNDLE) +$(MAC_APPLICATION_BUNDLE): $(BUILD_DIR) $(INVEST_BINARIES_DIR) $(USERGUIDE_HTML_DIR) + ./installer/darwin/build_app_bundle.sh $(VERSION) $(INVEST_BINARIES_DIR) $(USERGUIDE_HTML_DIR) $(MAC_APPLICATION_BUNDLE) mac_zipfile: $(MAC_BINARIES_ZIP_FILE) $(MAC_BINARIES_ZIP_FILE): $(DIST_DIR) $(MAC_APPLICATION_BUNDLE) $(USERGUIDE_HTML_DIR) diff --git a/installer/darwin/build_app_bundle.sh b/installer/darwin/build_app_bundle.sh index e016057e35..cb8924b3b4 100755 --- a/installer/darwin/build_app_bundle.sh +++ b/installer/darwin/build_app_bundle.sh @@ -5,7 +5,8 @@ # Arguments: # $1 = the version string to use # $2 = the path to the binary dir to package. -# $3 = the path to where the application bundle should be written. +# $3 = the path to the HTML documentation +# $4 = the path to where the application bundle should be written. # remove temp files that can get in the way tempdir=`basename $3` @@ -21,13 +22,18 @@ mkdir -p "$tempdir" # .command extension makes the scripts runnable by the user. # Shell files without the `invest_` prefix will be left alone. new_basename='InVEST' -_APPDIR="$3" +_APPDIR="$4" _MACOSDIR="$_APPDIR/Contents/MacOS" _RESOURCEDIR="$_APPDIR/Contents/Resources" +_INVEST_DIST_DIR="$_MACOSDIR/invest_dist" +_USERGUIDE_HTML_DIR="$_INVEST_DIST_DIR/documentation/userguide" CONFIG_DIR="installer/darwin" mkdir -p "${_MACOSDIR}" mkdir -p "${_RESOURCEDIR}" -cp -r "$2" "$_MACOSDIR/invest_dist" +mkdir -p "${_USERGUIDE_HTML_DIR}" + +cp -r "$2" "$_INVEST_DIST_DIR" +cp -r "$3" "$_USERGUIDE_HTML_DIR" new_command_file="$_MACOSDIR/$new_basename" cp $CONFIG_DIR/invest.icns "$_RESOURCEDIR/invest.icns" From 5fb84a81ac5fb9c26cc6402f9bf7d6f667c9a90c Mon Sep 17 00:00:00 2001 From: James Douglass Date: Mon, 23 Nov 2020 14:25:41 -0800 Subject: [PATCH 3/4] Correting how we copy directories around. RE:#319 --- installer/darwin/build_app_bundle.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installer/darwin/build_app_bundle.sh b/installer/darwin/build_app_bundle.sh index cb8924b3b4..357378088f 100755 --- a/installer/darwin/build_app_bundle.sh +++ b/installer/darwin/build_app_bundle.sh @@ -26,13 +26,14 @@ _APPDIR="$4" _MACOSDIR="$_APPDIR/Contents/MacOS" _RESOURCEDIR="$_APPDIR/Contents/Resources" _INVEST_DIST_DIR="$_MACOSDIR/invest_dist" -_USERGUIDE_HTML_DIR="$_INVEST_DIST_DIR/documentation/userguide" +_USERGUIDE_HTML_DIR="$_INVEST_DIST_DIR/documentation" CONFIG_DIR="installer/darwin" mkdir -p "${_MACOSDIR}" mkdir -p "${_RESOURCEDIR}" -mkdir -p "${_USERGUIDE_HTML_DIR}" cp -r "$2" "$_INVEST_DIST_DIR" + +mkdir -p "${_USERGUIDE_HTML_DIR}" cp -r "$3" "$_USERGUIDE_HTML_DIR" new_command_file="$_MACOSDIR/$new_basename" cp $CONFIG_DIR/invest.icns "$_RESOURCEDIR/invest.icns" From 77313c87740c3aee70dbc77eae15acc7563d930d Mon Sep 17 00:00:00 2001 From: James Douglass Date: Mon, 23 Nov 2020 15:17:52 -0800 Subject: [PATCH 4/4] Noting corrected local documentation links on mac. RE:#319 --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index ddf64b5870..6e4e695678 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -65,7 +65,7 @@ Unreleased Changes (3.9) * No longer include the HTML docs or HISTORY.rst in the macOS distribution. * Bumped the ``shapely`` requirements to ``>=1.7.1`` to address a library import issue on Mac OS Big Sur. - * Fixing model documentation links for Windows. + * Fixing model local documentation links for Windows and Mac binaries. * The InVEST binary builds now launch on Mac OS 11 "Big Sur". This was addressed by defining the ``QT_MAC_WANTS_LAYER`` environment variable. * Coastal Blue Carbon