Skip to content

Commit 8d6ef87

Browse files
committed
propagates name change
1 parent 05cd6c4 commit 8d6ef87

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

climada/entity/measures/measure_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ class MeasureConfig(ModifierConfig):
448448
449449
This class is the primary entry point for defining measures in a
450450
declarative, file-based workflow and serves as the serialization
451-
counterpart to :class:`~climada.entity.measures.base.Measure`.
451+
counterpart to :class:`~climada.entity.measures.measure.Measure`.
452452
453453
Parameters
454454
----------

climada/entity/measures/test/test_base.py renamed to climada/entity/measures/test/test_measure.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
import pytest
2626

27-
from climada.entity.measures.base import Measure, allow_kwargs
2827
from climada.entity.measures.cost_income import CostIncome
28+
from climada.entity.measures.measure import Measure, allow_kwargs
2929

3030

3131
def _make_mock():
@@ -149,7 +149,7 @@ def fn(obj, **kw):
149149
return obj
150150

151151
with patch(
152-
"climada.entity.measures.base.copy.deepcopy", return_value=copied
152+
"climada.entity.measures.measure.copy.deepcopy", return_value=copied
153153
) as mock_dc:
154154
m = Measure("test", exposures_changes=fn)
155155
result = m.apply_exposures_changes(original, enforce_copy=True)
@@ -162,7 +162,7 @@ def test_no_deepcopy_when_enforce_copy_false(self):
162162
def fn(obj, **kw):
163163
return obj
164164

165-
with patch("climada.entity.measures.base.copy.deepcopy") as mock_dc:
165+
with patch("climada.entity.measures.measure.copy.deepcopy") as mock_dc:
166166
m = Measure("test", exposures_changes=fn)
167167
m.apply_exposures_changes(original, enforce_copy=False)
168168
mock_dc.assert_not_called()
@@ -201,7 +201,9 @@ def test_custom_fn_deepcopies_when_enforce_copy(self):
201201
def fn(obj, **kw):
202202
return obj
203203

204-
with patch("climada.entity.measures.base.copy.deepcopy", return_value=copied):
204+
with patch(
205+
"climada.entity.measures.measure.copy.deepcopy", return_value=copied
206+
):
205207
m = Measure("test", impfset_changes=fn)
206208
result = m.apply_impfset_changes(_make_mock(), enforce_copy=True)
207209
assert result is copied
@@ -239,7 +241,9 @@ def test_custom_fn_deepcopies_when_enforce_copy(self):
239241
def fn(obj, **kw):
240242
return obj
241243

242-
with patch("climada.entity.measures.base.copy.deepcopy", return_value=copied):
244+
with patch(
245+
"climada.entity.measures.measure.copy.deepcopy", return_value=copied
246+
):
243247
m = Measure("test", hazard_changes=fn)
244248
result = m.apply_hazard_changes(_make_mock(), enforce_copy=True)
245249
assert result is copied
@@ -248,7 +252,7 @@ def test_no_deepcopy_when_enforce_copy_false(self):
248252
def fn(obj, **kw):
249253
return obj
250254

251-
with patch("climada.entity.measures.base.copy.deepcopy") as mock_dc:
255+
with patch("climada.entity.measures.measure.copy.deepcopy") as mock_dc:
252256
m = Measure("test", hazard_changes=fn)
253257
m.apply_hazard_changes(_make_mock(), enforce_copy=False)
254258
mock_dc.assert_not_called()

climada/test/test_measures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import pytest
1818
from scipy.sparse import csr_matrix
1919

20-
from climada.entity.measures.base import Measure
2120
from climada.entity.measures.cost_income import CostIncome
21+
from climada.entity.measures.measure import Measure
2222
from climada.test.conftest import HAZARD_TYPE
2323

2424
# ===========================================================================

doc/api/climada/climada.entity.measures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ climada\.entity\.measures package
88
climada\.entity\.measures\.base module
99
--------------------------------------
1010

11-
.. automodule:: climada.entity.measures.base
11+
.. automodule:: climada.entity.measures.measure
1212
:members:
1313
:undoc-members:
1414
:show-inheritance:

0 commit comments

Comments
 (0)