NTNU-IHB / PythonFMU

A lightweight framework that enables the packaging of Python3.x code as co-simulation FMUs
MIT License
136 stars 38 forks source link

Generating flexible FMU out of Python code with different variables, problem creating class before build #200

Open till12mann opened 11 months ago

till12mann commented 11 months ago

Discussed in https://github.com/NTNU-IHB/PythonFMU/discussions/198

Originally posted by **till12mann** December 12, 2023 I am trying to generate an FMU out of a running python script. I want to hand over the variables I need (I/Os of the FMU) and then build the FMU. I can build the FMU with `os.system("pythonfmu build -f fmu_generator.py VSCode")` , but when I want to hand over my variables, I have to create the class "FMUGenerator" or in case of the example code "PythonSlave" bevor building it with the prompt. Is that even possible? Because what ever I do, I always get a KeyError: 'instance_name'. Any Ideas how I can fix that? If you need any more information let me know.