From b6dec717506907ccb2b7f3f8c1f6722fc1e6af90 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 11 Aug 2026 10:18:28 -0600 Subject: [PATCH 1/3] Use bool mask --- reV/supply_curve/points.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reV/supply_curve/points.py b/reV/supply_curve/points.py index 61f71b7f3..6c38c261d 100644 --- a/reV/supply_curve/points.py +++ b/reV/supply_curve/points.py @@ -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) From 3aee32413eca3b7f5990b144b45d1c3a08a2b595 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 11 Aug 2026 10:18:34 -0600 Subject: [PATCH 2/3] Add test --- tests/test_supply_curve_points.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_supply_curve_points.py b/tests/test_supply_curve_points.py index 6b3bc5342..a18884910 100644 --- a/tests/test_supply_curve_points.py +++ b/tests/test_supply_curve_points.py @@ -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.""" From 9e6cf1b4f2914069f56cc5e456ac4d69cfa84edf Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 11 Aug 2026 10:18:54 -0600 Subject: [PATCH 3/3] Bump version --- reV/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reV/version.py b/reV/version.py index defbe31c0..909047016 100644 --- a/reV/version.py +++ b/reV/version.py @@ -2,4 +2,4 @@ reV Version number """ -__version__ = "0.17.0" +__version__ = "0.17.1"