Skip to content

Commit

Permalink
Merge pull request #1420 from emlys/bugfix/1417
Browse files Browse the repository at this point in the history
Wind energy: handle the case where the grid points path is empty or None
  • Loading branch information
dcdenu4 authored Oct 5, 2023
2 parents c82f22f + d505248 commit ec4e005
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Unreleased Changes
* SDR
* RKLS, USLE, avoided erosion, and avoided export rasters will now have
nodata in streams (`#1415 <https://github.com/natcap/invest/issues/1415>`_)
* Wind Energy
* Fixed a bug where model would error when the grid points path was empty
(`#1417 <https://github.com/natcap/invest/issues/1417>`_)

3.14.0 (2023-09-08)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/wind_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ def execute(args):
LOGGER.info('Valuation Not Selected. Model completed')
return

if 'grid_points_path' in args:
if 'grid_points_path' in args and args['grid_points_path']:
# Handle Grid Points
LOGGER.info('Grid Points Provided. Reading in the grid points')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ ArgInput.propTypes = {
units: PropTypes.string, // for numbers only
}).isRequired,
userguide: PropTypes.string.isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
value: PropTypes.oneOfType(
[PropTypes.string, PropTypes.bool, PropTypes.number]),
touched: PropTypes.bool,
isValid: PropTypes.bool,
validationMessage: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class ArgsForm extends React.Component {
ArgsForm.propTypes = {
argsValues: PropTypes.objectOf(
PropTypes.shape({
value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
value: PropTypes.oneOfType(
[PropTypes.string, PropTypes.bool, PropTypes.number]),
touched: PropTypes.bool,
})
).isRequired,
Expand Down
3 changes: 2 additions & 1 deletion workbench/src/renderer/components/SetupTab/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ SetupTab.propTypes = {
enabledFunctions: PropTypes.objectOf(PropTypes.func),
dropdownFunctions: PropTypes.objectOf(PropTypes.func),
}).isRequired,
argsInitValues: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.bool])),
argsInitValues: PropTypes.objectOf(PropTypes.oneOfType(
[PropTypes.string, PropTypes.bool, PropTypes.number])),
investExecute: PropTypes.func.isRequired,
sidebarSetupElementId: PropTypes.string.isRequired,
sidebarFooterElementId: PropTypes.string.isRequired,
Expand Down

0 comments on commit ec4e005

Please sign in to comment.