Skip to content

Commit

Permalink
Merge pull request #676 from CLIMADA-project/bugfix/lines_poly_impf
Browse files Browse the repository at this point in the history
Change test data impf.id to test non-default params
  • Loading branch information
Evelyn-M authored Mar 28, 2023
2 parents 912127e + 37feeab commit e51f92d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Removed:
- Refactored `Exposure.assign_centroids` using a new util function `u_coord.match_centroids` [#602](https://github.com/CLIMADA-project/climada_python/pull/602)
- Renamed `climada.util.coordinate.assign_grid_points` to `match_grid_points` and `climada.util.coordinates.assign_coordinates` to `match_coordinates`
[#602](https://github.com/CLIMADA-project/climada_python/pull/602)
- 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).
- 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).
- Added test for non-default impact function id in the `lines_polys_handler` [#676](https://github.com/CLIMADA-project/climada_python/pull/676)

### Fixed

Expand Down
6 changes: 5 additions & 1 deletion climada/util/test/test_lines_polys_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import numpy as np
import geopandas as gpd
import copy

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

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

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

IMPF = ImpfStormEurope.from_welker()
IMPF_SET = ImpactFuncSet([IMPF])
IMPF2 = copy.deepcopy(IMPF)
IMPF2.id = 2
IMPF_SET = ImpactFuncSet([IMPF, IMPF2])

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

Expand Down

0 comments on commit e51f92d

Please sign in to comment.