Skip to content

Commit e51f92d

Browse files
authored
Merge pull request #676 from CLIMADA-project/bugfix/lines_poly_impf
Change test data impf.id to test non-default params
2 parents 912127e + 37feeab commit e51f92d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Removed:
2626
- Refactored `Exposure.assign_centroids` using a new util function `u_coord.match_centroids` [#602](https://github.com/CLIMADA-project/climada_python/pull/602)
2727
- Renamed `climada.util.coordinate.assign_grid_points` to `match_grid_points` and `climada.util.coordinates.assign_coordinates` to `match_coordinates`
2828
[#602](https://github.com/CLIMADA-project/climada_python/pull/602)
29-
- Modified the method to disaggregate lines in the lines_polygons_handler utility module in order to better conserve the total length of all lines on average [#679](https://github.com/CLIMADA-project/climada_python/pull/679).
29+
- Modified the method to disaggregate lines in the `lines_polys_handler` utility module in order to better conserve the total length of all lines on average [#679](https://github.com/CLIMADA-project/climada_python/pull/679).
30+
- Added test for non-default impact function id in the `lines_polys_handler` [#676](https://github.com/CLIMADA-project/climada_python/pull/676)
3031

3132
### Fixed
3233

climada/util/test/test_lines_polys_handler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import numpy as np
2626
import geopandas as gpd
27+
import copy
2728

2829
from shapely.geometry import Point
2930
from shapely.geometry import LineString
@@ -43,6 +44,7 @@
4344
HAZ = Client().get_hazard('storm_europe', name='test_haz_WS_nl', status='test_dataset')
4445

4546
EXP_POLY = Client().get_exposures('base', name='test_polygon_exp', status='test_dataset')
47+
EXP_POLY.gdf['impf_WS'] = 2
4648
GDF_POLY = EXP_POLY.gdf
4749

4850
EXP_LINE = Client().get_exposures('base', name='test_line_exp', status='test_dataset')
@@ -52,7 +54,9 @@
5254
GDF_POINT = EXP_POINT.gdf
5355

5456
IMPF = ImpfStormEurope.from_welker()
55-
IMPF_SET = ImpactFuncSet([IMPF])
57+
IMPF2 = copy.deepcopy(IMPF)
58+
IMPF2.id = 2
59+
IMPF_SET = ImpactFuncSet([IMPF, IMPF2])
5660

5761
COL_CHANGING = ['value', 'latitude', 'longitude', 'geometry', 'geometry_orig']
5862

0 commit comments

Comments
 (0)