Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reV/supply_curve/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def sub_agg_stats(self, agg):
n = self._resolution // agg

arr = self.include_mask.copy()
arr[self.tm == -1] = 0.0
arr[~self.bool_mask.reshape(arr.shape)] = 0.0

# Example for 2D:
# (12, 8) with n=4 -> reshape to (4, 3, 4, 2)
Expand Down
2 changes: 1 addition & 1 deletion reV/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
reV Version number
"""

__version__ = "0.17.0"
__version__ = "0.17.1"
16 changes: 16 additions & 0 deletions tests/test_supply_curve_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ def test_sub_agg_stats_agg1_returns_pixel_stats():
)


def test_sub_agg_stats_excludes_invalid_generation_gids():
"""Test sub-aggregation areas match area when a gen gid is unavailable."""

include_mask = np.array([[1.0, 0.5], [1.0, 0.25]])
point = _make_generation_sc_point_for_sub_agg_stats(include_mask, 2)
point._gids[1] = -1

summary = point.sub_agg_stats(1)
area = SupplyCurveField.AREA_SQ_KM

assert np.isclose(point.area, 2.25)
assert np.isclose(summary[f"min_agg1_{area}"], 0.0)
assert np.isclose(summary[f"max_agg1_{area}"], 1.0)
assert np.isclose(summary[f"mean_agg1_{area}"], point.area / 4)


@pytest.mark.parametrize("resolution", [7, 32, 50, 64, 163])
def test_points_calc(resolution):
"""Test the calculation of the SC points setup from exclusions tiff."""
Expand Down
Loading