Skip to content

Commit

Permalink
Fixing and noting change in HISTORY. RE:natcap#1350
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Jul 20, 2023
1 parent e3ac861 commit 4b0cce9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Unreleased Changes
* Fixed a bug where the model incorrectly raised an error if the
biophysical table contained a row of all 0s.
(`#1123 <https://github.com/natcap/invest/issues/1123>`_)
* Urban Nature Access
* Fixed an issue where, under certain circumstances, the model would raise
a cryptic ``TypeError`` when creating the summary vector.
https://github.com/natcap/invest/issues/1350
* Visitation: Recreation and Tourism
* Fixed a bug where overlapping predictor polygons would be double-counted
in ``polygon_area_coverage`` and ``polygon_percent_coverage`` calculations.
Expand Down
5 changes: 4 additions & 1 deletion src/natcap/invest/urban_nature_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,10 @@ def _write_supply_demand_vector(source_aoi_vector_path, feature_attrs,
for feature in target_layer:
feature_id = feature.GetFID()
for attr_name, attr_value in feature_attrs[feature_id].items():
feature.SetField(attr_name, attr_value)
# It is possible that attr_value may be a numpy.float32 object,
# which will raise a cryptic error. Numpy.float64 will not raise
# this error. Casting to float avoids the issue.
feature.SetField(attr_name, float(attr_value))

target_layer.SetFeature(feature)
target_layer.CommitTransaction()
Expand Down

0 comments on commit 4b0cce9

Please sign in to comment.