Closed clegaard closed 4 years ago
To suppress undefined variable IDE/Linting warnings, it is necessary to declare a variable explicitly as follows:
self.a = 0 self.register_variable("a", "real", "input", description='acceleration',start=0)
There are at least two problems with this:
A solution to this would be to have the register_variable function return the start value:
self.a = register_variable("a","real","input",description="acceleration",start=0)
This would ensure that the two values are identical and would also open the possibility of returning a variable object rather than a primitive. This object could ensure that only valid values could be written to the variable.
This has been mitigated by two checks:
The first one ensures that the IntelliSense works correctly, the second one ensures that start value and the value declared in python are identical
To suppress undefined variable IDE/Linting warnings, it is necessary to declare a variable explicitly as follows:
There are at least two problems with this:
A solution to this would be to have the register_variable function return the start value:
This would ensure that the two values are identical and would also open the possibility of returning a variable object rather than a primitive. This object could ensure that only valid values could be written to the variable.