-
Notifications
You must be signed in to change notification settings - Fork 71
Description
I’m trying to create tests to verify the interaction of my software with the generate_parameter_library. I want to save the parameters to a file when they are updated in both Python and C++. The testes for the C++ version worked correctly, but in Python, I noticed an odd behaviour. The parameter values are shared across multiple instances. This resulted in the tests failing due to an inconsistent initial value. I expected a reset to parameter values when a new instance is created.
Looking at the generated code, I noticed the Param class doesn’t have an __init__(self) function and declares the parameters directly in the class body. This causes the parameters to be shared between instances. Is this the desired behaviour?
Adding the __init__(self) function and selfto the variables solved this. As a quick fix, I reloaded the entire module between each test.
If this is not intended, I can provide a pull request to solve this issue.
Expected generated code:

