-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline model building: system_structure and related functionality #542
Conversation
…feature/114-offline-model-building
This fixes issue #538, "`mock_slave` violates assumptions, causing tests to be ill-defined". Basically, what I've done is to make the user-supplied functions act on the outputs rather than on the internal states. This had quite substantial effects on some of the tests, which depended on the wrong behaviour. To compensate and, to some extent, restore the old behaviour in a "correct" way, I've had to add some new functionality to `mock_slave`, namely: - The possibility to have outputs depend on time as well as inputs. - The possibility to have a custom function called at each time step. Finally, I've taken this opportunity to make some of the tests slightly more readable by replacing magic numbers with named variables/constants. This includes: - Simulator indexes, which were assumed to be sequential in some tests - Variable references, which were assumed to be 0 and 1 for `mock_slave`'s variables The magic numbers were making the tests hard to read, and therefore also to fix. Besides, while the above assumptions are correct at the moment, that need not be the case in the future.
…offline-model-building
…offline-model-building
With a |
Looking at the PR though, I guess |
Yes! :) The plan is for the parsers to return a
I considered adding an |
d59806c
to
4f13557
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!🥇
The main thing in this PR is the addition of
system_structure
, along with related functions and classes. This fixes #114.system_structure
is a class that holds more or less the same information as anOspSystemStructure.xml
orSystemStructure.ssd
:The whole point is to be able to:
variable_value_map
which is not part of thesystem_structure
, but which is also validated against it.)What I have not done in this PR is to rewrite the CSE and SSP parsers in terms of
system_structure
. This is mainly to keep this PR focused and prevent it from growing entirely out of proportions. I will update the parsers in an upcoming PR based on this one. When that is done, the parsers should only contain parsing code, and thus be a lot cleaner.P.S. This is a revamp of an earlier PR, #427.