Skip to content

Commit 5db4e07

Browse files
authored
Merge pull request #1195 from CLIMADA-project/feature/minor-logging-fix
Fix logging of asset count in impact calculation
2 parents 6d3c41a + 2b20784 commit 5db4e07

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Code freeze date: YYYY-MM-DD
1717

1818
### Fixed
1919

20+
- Fixed asset count in impact logging message [#1195](https://github.com/CLIMADA-project/climada_python/pull/1195).
21+
2022
### Deprecated
2123

2224
### Removed

climada/engine/impact_calc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def impact(
186186
return self._return_empty(save_mat)
187187
LOGGER.info(
188188
"Calculating impact for %s assets (>0) and %s events.",
189-
exp_gdf.size,
189+
len(exp_gdf),
190190
self.n_events,
191191
)
192192
imp_mat_gen = self.imp_mat_gen(exp_gdf, impf_col)

climada/engine/test/test_impact_calc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def test_calc_insured_impact_no_insurance(self):
441441
self.assertEqual(
442442
logs.output,
443443
[
444-
"INFO:climada.engine.impact_calc:Calculating impact for 150 assets (>0) and 14450 events."
444+
"INFO:climada.engine.impact_calc:Calculating impact for 50 assets (>0) and 14450 events."
445445
],
446446
)
447447
self.assertEqual(icalc.n_events, len(impact.at_event))

0 commit comments

Comments
 (0)