Coverage for bim2sim/plugins/PluginTEASER/bim2sim_teaser/task/serialize_teaser_prj.py: 0%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-03-12 17:09 +0000

1from bim2sim.tasks.base import ITask 

2 

3 

4class SerializeTEASER(ITask): 

5 """Creates the TEASER project, run() method holds detailed information.""" 

6 reads = ('teaser_prj',) 

7 

8 def run(self, teaser_prj): 

9 """Serialize the created TEASER project. 

10 

11 This is useful if we want to work on the created TEASER project outside 

12 of bim2sim and don't want to export it directly to Modelica. 

13 

14 Args: 

15 teaser_prj: teaser project instance 

16 

17 """ 

18 self.logger.info("Serializing the created TEASER project") 

19 self.paths.export.joinpath("TEASER/serialized_teaser").mkdir(parents=True, 

20 exist_ok=True) 

21 teaser_prj.save_project( 

22 file_name=self.prj_name, 

23 path=self.paths.export / "TEASER/serialized_teaser") 

24 

25 self.logger.info( 

26 f'Saved TEASER project ' 

27 f'to {self.paths.export.joinpath("TEASER/serialized_teaser")}')