-
Notifications
You must be signed in to change notification settings - Fork 0
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
Parsing optional statements in model interface. #158
Conversation
ae3105c
to
8711791
Compare
…ong as the definitions are consistent.
8711791
to
dd3eeec
Compare
…enarios where units are inferred from the RHS for some new variables.
dd3eeec
to
fdfde7a
Compare
The s1_s2_noble test causes an error in cellmlmanip, where the if to_units is not None or was_converted:
# Convert the result if required
expr = expr.func(*new_args)
expr, was_converted, actual_units = maybe_convert_expr(expr, was_converted, actual_units, to_units) These lines do look wrong to me: maybe_convert_expr() can be called with |
Stopped this from happening now, but the lines above still look dubious to me @jonc125 :D |
I think the bit with the output variables can be tidied up further:
|
Wondering if |
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.
This looks really good overall, and does tidy things up nicely. There are some instances of broken code suggesting that we're missing some important test coverage, and a couple of bits I'm not sure about. Plus a few cosmetic changes :)
…lla RDF terms to be used as outputs.
2b7be7d
to
f2ea7f1
Compare
Ready for final(?) review @jonc125 |
@jonc125 optional outputs? |
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.
Looks good to me. I've just suggested a few minor tweaks.
I thought they would have been removed by this point? Maybe not. No tests failed though! |
I think the protocol_variables list just gives all the information about variables specified in the protocol, including optional ones that couldn't be resolved. So probably if we add a test with an optional output that's also optional in post-processing this could fail? |
Co-Authored-By: Jonathan Cooper <[email protected]>
Co-Authored-By: Jonathan Cooper <[email protected]>
Quite possibly. In which case please do revert that change! (Perhaps with a comment explaining the situation.) |
Co-Authored-By: Jonathan Cooper <[email protected]>
Co-Authored-By: Jonathan Cooper <[email protected]>
Co-Authored-By: Jonathan Cooper <[email protected]>
Co-Authored-By: Jonathan Cooper <[email protected]>
Co-Authored-By: Jonathan Cooper <[email protected]>
Check that units_of is evaluated at the right time
I agree it's a very ugly if-block 😅 |
Fixed now? |
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.
Great!
Huh, except that the assertion keeps tripping? |
I forgot to set |
Addresses #157. Fixes #105.
Significant rewrite of ModelInterface.modify_model(), based on #157 (comment)
input
declarations are allowed on the same variable, as long as they don't make conflicting demandsstate_variable
annotation