diff --git a/LoopStructural/modelling/core/stratigraphic_column.py b/LoopStructural/modelling/core/stratigraphic_column.py index 4f4eb003..48d5e084 100644 --- a/LoopStructural/modelling/core/stratigraphic_column.py +++ b/LoopStructural/modelling/core/stratigraphic_column.py @@ -668,7 +668,7 @@ def get_isovalues(self) -> dict[str, float]: surface_values = {} for g in reversed(self.get_groups()): v = 0 - for u in g.units: + for u in reversed(g.units): surface_values[u.name] = {'value':v,'group':g.name,'colour':u.colour} v += u.thickness return surface_values diff --git a/release-please-config.json b/release-please-config.json index 3dbcbcb2..12d40ea0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -15,11 +15,13 @@ }, "packages/map2loop": { "release-type": "python", - "component": "map2loop" + "component": "map2loop", + "release-as": "3.4.0" }, "packages/loopstructural_visualisation": { "release-type": "python", - "component": "loopstructuralvisualisation" + "component": "loopstructuralvisualisation", + "release-as": "0.2.0" } } } diff --git a/tests/unit/modelling/test_stratigraphic_column.py b/tests/unit/modelling/test_stratigraphic_column.py index b10ed36e..1f7fc284 100644 --- a/tests/unit/modelling/test_stratigraphic_column.py +++ b/tests/unit/modelling/test_stratigraphic_column.py @@ -430,6 +430,20 @@ def test_get_isovalues(self): assert isovalues["B"]["value"] == 0 assert isovalues["B"]["group"] == "Group_0" + def test_get_isovalues_multi_unit_group(self): + # Isovalues must match update_unit_values: the base of the oldest + # unit in a group is 0, and each unit's thickness gives the base + # value of the next (younger) unit. + column = StratigraphicColumn() + column.clear(basement=False) + column.add_unit("A", thickness=10, id=0) + column.add_unit("B", thickness=5, id=1) + column.add_unit("C", thickness=3, id=2) + isovalues = column.get_isovalues() + assert isovalues["A"]["value"] == 0 + assert isovalues["B"]["value"] == 10 + assert isovalues["C"]["value"] == 15 + class TestOrderingAndUpdates: def test_update_order_reorders_elements(self):