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

1from bim2sim.elements.base_elements import Material 

2from bim2sim.elements.graphs.hvac_graph import HvacGraph 

3from bim2sim.tasks.base import ITask 

4 

5 

6class MakeGraph(ITask): 

7 

8 reads = ('elements', ) 

9 touches = ('graph', ) 

10 

11 def run(self, elements: dict): 

12 """Create an HVACGraph from IFC elements. 

13 

14 This task creates an HVACGraph from IFC elements (excluding materials). 

15 It logs the creation of the graph and returns the graph. 

16 

17 Args: 

18 elements: Dictionary of IFC elements. 

19 

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,