Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1a755c3
makes soon to be old `measures` module a legacy
spjuhel Apr 2, 2026
ceaf479
Oups these shouldn't be here!
spjuhel Apr 2, 2026
c176e80
Forgotten places
spjuhel Apr 2, 2026
2c0dffa
Introduces measure config dataclasses
spjuhel Apr 7, 2026
e9f4831
Cleans-up, Docstringfies
spjuhel Apr 7, 2026
bcf6811
Better to_dict, color parser, and post_inits
spjuhel Apr 7, 2026
2718c84
Unit tests
spjuhel Apr 7, 2026
c5345fb
Removes duplicate docstring
spjuhel Apr 7, 2026
4551e3c
Forgotten places
spjuhel Apr 2, 2026
78c4968
tests again
spjuhel Apr 7, 2026
3cae5d7
Merge branch 'feature/option-appraisal-dataclasses' of github.com:CLI…
spjuhel Apr 7, 2026
108bcb2
Updates changelog
spjuhel Apr 8, 2026
c96a061
Adds freq modifiers
spjuhel Apr 8, 2026
4e416bc
Improves __repr__
spjuhel Apr 8, 2026
30bdce6
Tutorial first draft
spjuhel Apr 8, 2026
bc5fefc
Adds future documentation placeholders, warnings in legacy guides
spjuhel Apr 9, 2026
3725078
This one does not exist yet
spjuhel Apr 9, 2026
5c80864
Merge branch 'feature/option-appraisal-split-make-legacy' into featur…
spjuhel Apr 9, 2026
cc70476
Includes guide in documentation index
spjuhel Apr 9, 2026
44a36d4
Updates changelog
spjuhel Apr 10, 2026
e4d7fc4
Updates rst files
spjuhel Apr 10, 2026
5634482
Merge branch 'feature/option-appraisal-split-make-legacy' into featur…
spjuhel Apr 10, 2026
8a09101
Adds new class to API ref
spjuhel Apr 10, 2026
775c621
Fixes wrong filename
spjuhel Apr 10, 2026
3ddf2b4
Revert "Fixes wrong filename"
spjuhel Apr 10, 2026
5b11b68
Correct rename
spjuhel Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Code freeze date: YYYY-MM-DD
### Added

- Better type hints and overloads signatures for ImpactFuncSet [#1250](https://github.com/CLIMADA-project/climada_python/pull/1250)
- Adds `MeasureConfig` and related dataclasses for new `Measure` object retrocompatibility and (de)serialization capabilities [#1276](https://github.com/CLIMADA-project/climada_python/pull/1276)

### Changed
- Updated Impact Calculation Tutorial (`doc.climada_engine_Impact.ipynb`) [#1095](https://github.com/CLIMADA-project/climada_python/pull/1095).
- Makes current `measure` module a legacy module, moving it to `_legacy_measure`, to retain compatibility with `CostBenefit` class and various tests. [#1274](https://github.com/CLIMADA-project/climada_python/pull/1274)

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions climada/engine/test/test_cost_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
risk_rp_100,
risk_rp_250,
)
from climada.entity._legacy_measures import Measure
from climada.entity._legacy_measures.base import LOGGER as ILOG
from climada.entity.disc_rates import DiscRates
from climada.entity.entity_def import Entity
from climada.entity.measures import Measure
from climada.entity.measures.base import LOGGER as ILOG
from climada.hazard.base import Hazard
from climada.test import get_test_file
from climada.util.api_client import Client
Expand Down
4 changes: 2 additions & 2 deletions climada/engine/unsequa/input_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def ent(
exp_list : [climada.entity.exposures.base.Exposure]
The list of base exposure. Can be one or many to uniformly sample
from.
meas_set : climada.entity.measures.measure_set.MeasureSet
meas_set : climada.entity._legacy_measures.measure_set.MeasureSet
The base measures.
haz_id_dict : dict
Dictionary of the impact functions affected by uncertainty.
Expand Down Expand Up @@ -660,7 +660,7 @@ def entfut(
exp_list : [climada.entity.exposures.base.Exposure]
The list of base exposure. Can be one or many to uniformly sample
from.
meas_set : climada.entity.measures.measure_set.MeasureSet
meas_set : climada.entity._legacy_measures.measure_set.MeasureSet
The base measures.
haz_id_dict : dict
Dictionary of the impact functions affected by uncertainty.
Expand Down
2 changes: 1 addition & 1 deletion climada/entity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
init entity
"""

from ._legacy_measures import *
from .disc_rates import *
from .entity_def import *
from .exposures import *
from .impact_funcs import *
from .measures import *
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from matplotlib import colormaps as cm

import climada.util.hdf5_handler as u_hdf5
from climada.entity.measures.base import Measure

from .base import Measure

LOGGER = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
import climada.entity.exposures.test as exposures_test
import climada.util.coordinates as u_coord
from climada import CONFIG
from climada.entity._legacy_measures.base import IMPF_ID_FACT, Measure
from climada.entity._legacy_measures.measure_set import MeasureSet
from climada.entity.entity_def import Entity
from climada.entity.exposures.base import Exposures
from climada.entity.impact_funcs.base import ImpactFunc
from climada.entity.impact_funcs.impact_func_set import ImpactFuncSet
from climada.entity.measures.base import IMPF_ID_FACT, Measure
from climada.entity.measures.measure_set import MeasureSet
from climada.hazard.base import Hazard
from climada.test import get_test_file
from climada.util.constants import HAZ_DEMO_H5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import numpy as np

from climada import CONFIG
from climada.entity.measures.base import Measure
from climada.entity.measures.measure_set import MeasureSet
from climada.entity._legacy_measures.base import Measure
from climada.entity._legacy_measures.measure_set import MeasureSet
from climada.util.constants import ENT_DEMO_TODAY, ENT_TEMPLATE_XLS

DATA_DIR = CONFIG.measures.test_data.dir()
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_add_wrong_error(self):
"""Test error is raised when wrong ImpactFunc provided."""
meas = MeasureSet()
with self.assertLogs(
"climada.entity.measures.measure_set", level="WARNING"
"climada.entity._legacy_measures.measure_set", level="WARNING"
) as cm:
meas.append(Measure())
self.assertIn("Input Measure's hazard type not set.", cm.output[0])
Expand All @@ -76,7 +76,9 @@ def test_remove_measure_pass(self):
def test_remove_wrong_error(self):
"""Test error is raised when invalid inputs."""
meas = MeasureSet(measure_list=[Measure(name="Mangrove", haz_type="FL")])
with self.assertLogs("climada.entity.measures.measure_set", level="INFO") as cm:
with self.assertLogs(
"climada.entity._legacy_measures.measure_set", level="INFO"
) as cm:
meas.remove_measure(name="Seawall")
self.assertIn("No Measure with name Seawall.", cm.output[0])

Expand Down
2 changes: 1 addition & 1 deletion climada/entity/entity_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

import pandas as pd

from climada.entity._legacy_measures.measure_set import Measure, MeasureSet
from climada.entity.disc_rates.base import DiscRates
from climada.entity.exposures.base import Exposures
from climada.entity.impact_funcs.impact_func_set import ImpactFuncSet
from climada.entity.measures.measure_set import MeasureSet

LOGGER = logging.getLogger(__name__)

Expand Down
Loading
Loading