Coverage for bim2sim/tasks/hvac/make_graph.py: 64%
11 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-03-12 17:09 +0000
1from bim2sim.elements.base_elements import Material
2from bim2sim.elements.graphs.hvac_graph import HvacGraph
3from bim2sim.tasks.base import ITask
6class MakeGraph(ITask):
8 reads = ('elements', )
9 touches = ('graph', )
11 def run(self, elements: dict):
12 """Create an HVACGraph from IFC elements.
14 This task creates an HVACGraph from IFC elements (excluding materials).
15 It logs the creation of the graph and returns the graph.
17 Args:
18 elements: Dictionary of IFC elements.
20 Returns:
21 The created HVAC graph.
22 """
23 self.logger.info("Creating graph from IFC elements")
24 not_mat_elements = \
25 {k: v for k, v in elements.items() if not isinstance(v, Material)}
26 graph = HvacGraph(not_mat_elements.values())
27 return graph,