Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion LoopStructural/modelling/core/stratigraphic_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
14 changes: 14 additions & 0 deletions tests/unit/modelling/test_stratigraphic_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading