Skip to content

Commit dae3149

Browse files
author
luseverin
committed
Revert changes
1 parent e69e584 commit dae3149

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

climada/util/lines_polys_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _aggregate_impact_mat(imp_pnt, gdf_pnt, agg_met):
228228

229229
col_geom = gdf_pnt.index.get_level_values(level=0)
230230
# Converts string multi-index level 0 to integer index
231-
# col_geom = np.sort(np.unique(col_geom, return_inverse=True)[1])
231+
col_geom = np.sort(np.unique(col_geom, return_inverse=True)[1])
232232
row_pnt = np.arange(len(col_geom))
233233

234234
if agg_met is AggMethod.SUM:
@@ -238,7 +238,7 @@ def _aggregate_impact_mat(imp_pnt, gdf_pnt, agg_met):
238238
f"The available aggregation methods are {AggMethod._member_names_}"
239239
) # pylint: disable=no-member, protected-access
240240
csr_mask = sp.sparse.csr_matrix(
241-
(mask, (row_pnt, row_pnt)), shape=(len(row_pnt), len(row_pnt))
241+
(mask, (row_pnt, row_pnt)), shape=(len(row_pnt), len(np.unique(row_pnt)))
242242
)
243243

244244
return imp_pnt.imp_mat.dot(csr_mask)
@@ -962,7 +962,7 @@ def _line_to_pnts(gdf_lines, res, to_meters):
962962
LOGGER.warning(
963963
"%d lines with a length < 10*resolution were found. "
964964
"Each of these lines is disaggregate to one point. "
965-
"Reaggregating values will thus likely lead to overestimation. "
965+
"Reaggregatint values will thus likely lead to overestimattion. "
966966
"Consider chosing a smaller resolution or filter out the short lines. ",
967967
failing_res_check_count,
968968
)

0 commit comments

Comments
 (0)