|
47 | 47 | STR_DT = h5py.special_dtype(vlen=str) |
48 | 48 |
|
49 | 49 |
|
50 | | -def dummy_impact(): |
51 | | - """Return an impact object for testing""" |
52 | | - return Impact( |
53 | | - event_id=np.arange(6) + 10, |
54 | | - event_name=[0, 1, "two", "three", 30, 31], |
55 | | - date=np.arange(6), |
56 | | - coord_exp=np.array([[1, 2], [1.5, 2.5]]), |
57 | | - crs=DEF_CRS, |
58 | | - eai_exp=np.array([7.2, 7.2]), |
59 | | - at_event=np.array([0, 2, 4, 6, 60, 62]), |
60 | | - frequency=np.array([1 / 6, 1 / 6, 1, 1, 1 / 30, 1 / 30]), |
61 | | - tot_value=7, |
62 | | - aai_agg=14.4, |
63 | | - unit="USD", |
64 | | - frequency_unit="1/month", |
65 | | - imp_mat=sparse.csr_matrix( |
| 50 | +def impact_kwargs(): |
| 51 | + return { |
| 52 | + "event_id": np.arange(6) + 10, |
| 53 | + "event_name": [0, 1, "two", "three", 30, 31], |
| 54 | + "date": np.arange(6), |
| 55 | + "coord_exp": np.array([[1, 2], [1.5, 2.5]]), |
| 56 | + "crs": DEF_CRS, |
| 57 | + "eai_exp": np.array([7.2, 7.2]), |
| 58 | + "at_event": np.array([0, 2, 4, 6, 60, 62]), |
| 59 | + "frequency": np.array([1 / 6, 1 / 6, 1, 1, 1 / 30, 1 / 30]), |
| 60 | + "tot_value": 7, |
| 61 | + "aai_agg": 14.4, |
| 62 | + "unit": "USD", |
| 63 | + "frequency_unit": "1/month", |
| 64 | + "imp_mat": sparse.csr_matrix( |
66 | 65 | np.array([[0, 0], [1, 1], [2, 2], [3, 3], [30, 30], [31, 31]]) |
67 | 66 | ), |
68 | | - haz_type="TC", |
69 | | - ) |
| 67 | + "haz_type": "TC", |
| 68 | + } |
| 69 | + |
| 70 | + |
| 71 | +def dummy_impact(): |
| 72 | + """Return an impact object for testing""" |
| 73 | + return Impact(**impact_kwargs()) |
70 | 74 |
|
71 | 75 |
|
72 | 76 | def dummy_impact_yearly(): |
|
0 commit comments