Skip to content

Commit 2d02dd0

Browse files
committed
Formatting
1 parent 53c6257 commit 2d02dd0

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

climada/entity/exposures/base.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,10 @@ def __init__(
403403

404404
self.description = self._consolidate(meta, "description", description)
405405
self.ref_year = self._consolidate(meta, "ref_year", ref_year, DEF_REF_YEAR)
406-
406+
407407
if geodata.shape[0] > 0:
408-
value_unit = self._consolidate(
409-
geodata.iloc[0], "value_unit", value_unit
410-
)
411-
self.value_unit = self._consolidate(
412-
meta, "value_unit", value_unit, DEF_VALUE_UNIT
413-
)
408+
value_unit = self._consolidate(geodata.iloc[0], "value_unit", value_unit)
409+
self.value_unit = self._consolidate(meta, "value_unit", value_unit, DEF_VALUE_UNIT)
414410

415411
crs = self._consolidate(meta, "crs", crs, equals=u_coord.equal_crs)
416412

climada/entity/exposures/test/test_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def test_read_template_pass(self):
431431
exp_df.ref_year = 2020
432432
exp_df.value_unit = "PAK"
433433
exp_df.check()
434-
434+
435435
def test_handling_unit_conflicts_pass(self):
436436
"""Check that the value_unit is correctly set when there are conflicting value_unit definitions in the data frame and the meta attribute."""
437437
df = pd.read_excel(ENT_TEMPLATE_XLS)
@@ -445,13 +445,12 @@ def test_handling_unit_conflicts_pass(self):
445445
with self.assertRaises(ValueError) as cm:
446446
exp_df = Exposures(df, meta={"value_unit": "PAK"}, value_unit="PAK")
447447

448-
449448
def test_io_hdf5_pass(self):
450449
"""write and read hdf5"""
451450
exp = Exposures(
452451
pd.read_excel(ENT_TEMPLATE_XLS),
453452
crs="epsg:32632",
454-
ref_year = 2020,
453+
ref_year = 2020
455454
)
456455

457456
# add another geometry column

0 commit comments

Comments
 (0)