mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Window carries no opening_type — ventilation table is the sole persistence point 🟥
This commit is contained in:
parent
c6f94b576b
commit
3f5b3cf172
2 changed files with 22 additions and 15 deletions
|
|
@ -93,12 +93,6 @@ def test_window_fields_are_floats(plan: Plan) -> None:
|
||||||
assert isinstance(window.area_m2, float)
|
assert isinstance(window.area_m2, float)
|
||||||
|
|
||||||
|
|
||||||
def test_window_opening_type_prefix_stripped(plan: Plan) -> None:
|
|
||||||
window = plan.floors[0].rooms[0].windows[0]
|
|
||||||
assert not window.opening_type.startswith("window")
|
|
||||||
assert window.opening_type == "casement"
|
|
||||||
|
|
||||||
|
|
||||||
def test_window_area_is_width_times_height(plan: Plan) -> None:
|
def test_window_area_is_width_times_height(plan: Plan) -> None:
|
||||||
window = plan.floors[0].rooms[0].windows[0]
|
window = plan.floors[0].rooms[0].windows[0]
|
||||||
assert window.area_m2 == round(window.width_m * window.height_m, 2)
|
assert window.area_m2 == round(window.width_m * window.height_m, 2)
|
||||||
|
|
@ -117,12 +111,6 @@ def test_hallway_has_no_windows(plan: Plan) -> None:
|
||||||
assert hallway.windows == []
|
assert hallway.windows == []
|
||||||
|
|
||||||
|
|
||||||
def test_floor1_window_opening_type_awning(plan: Plan) -> None:
|
|
||||||
bedroom1 = plan.floors[1].rooms[0]
|
|
||||||
assert bedroom1.name == "Bedroom 1"
|
|
||||||
assert bedroom1.windows[0].opening_type == "awning"
|
|
||||||
|
|
||||||
|
|
||||||
# --- Doors ---
|
# --- Doors ---
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -163,6 +151,20 @@ def test_window_with_no_custom_fields_has_no_ventilation() -> None:
|
||||||
assert window.ventilation is None
|
assert window.ventilation is None
|
||||||
|
|
||||||
|
|
||||||
|
def test_mapped_window_has_no_opening_type() -> None:
|
||||||
|
wi = WallItem(
|
||||||
|
uid="test",
|
||||||
|
symbol=Symbol(id="windowcasement", name="Casement Window", valid=True),
|
||||||
|
size=Vec3(x=1.0, y=0.0, z=1.2),
|
||||||
|
position=Vec3(x=0.0, y=0.0, z=0.0),
|
||||||
|
rotation=Vec3(x=0.0, y=0.0, z=0.0),
|
||||||
|
)
|
||||||
|
|
||||||
|
window = _map_window(wi)
|
||||||
|
|
||||||
|
assert not hasattr(window, "opening_type")
|
||||||
|
|
||||||
|
|
||||||
def test_kitchen_window_has_ventilation(plan: Plan) -> None:
|
def test_kitchen_window_has_ventilation(plan: Plan) -> None:
|
||||||
window = plan.floors[0].rooms[0].windows[0]
|
window = plan.floors[0].rooms[0].windows[0]
|
||||||
|
|
||||||
|
|
@ -181,12 +183,18 @@ def test_toilet_door_has_ventilation_undercut(plan: Plan) -> None:
|
||||||
def test_doorglass_is_classified_as_window(plan: Plan) -> None:
|
def test_doorglass_is_classified_as_window(plan: Plan) -> None:
|
||||||
room = plan.floors[0].rooms[1]
|
room = plan.floors[0].rooms[1]
|
||||||
|
|
||||||
assert "doorglass" in [w.opening_type for w in room.windows]
|
assert any(
|
||||||
|
w.ventilation is not None and w.ventilation.opening_type == "External.Door"
|
||||||
|
for w in room.windows
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_glass_door_ventilation_opening_type(plan: Plan) -> None:
|
def test_glass_door_ventilation_opening_type(plan: Plan) -> None:
|
||||||
room = plan.floors[0].rooms[1]
|
room = plan.floors[0].rooms[1]
|
||||||
glass = next(w for w in room.windows if w.opening_type == "doorglass")
|
glass = next(
|
||||||
|
w for w in room.windows
|
||||||
|
if w.ventilation is not None and w.ventilation.opening_type == "External.Door"
|
||||||
|
)
|
||||||
|
|
||||||
assert glass.ventilation is not None
|
assert glass.ventilation is not None
|
||||||
assert glass.ventilation.opening_type == "External.Door"
|
assert glass.ventilation.opening_type == "External.Door"
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ def _plan() -> Plan:
|
||||||
width_m=1.2,
|
width_m=1.2,
|
||||||
height_m=1.5,
|
height_m=1.5,
|
||||||
area_m2=1.8,
|
area_m2=1.8,
|
||||||
opening_type="casement",
|
|
||||||
ventilation=WindowVentilation(
|
ventilation=WindowVentilation(
|
||||||
opening_type="30.Hinged.Pivot.Window",
|
opening_type="30.Hinged.Pivot.Window",
|
||||||
num_openings=2,
|
num_openings=2,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue