-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Change u₀ to u0 #107
Change u₀ to u0 #107
Conversation
If we want to add this there needs to be an overload so the old notation works and returns |
Is that possible (without simultaneously supporting both fields)? I am only familiar with overloads for functions, so would be unsure how to do this. |
See |
But both |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #107 +/- ##
==========================================
- Coverage 83.76% 83.00% -0.76%
==========================================
Files 4 4
Lines 351 359 +8
==========================================
+ Hits 294 298 +4
- Misses 57 61 +4 ☔ View full report in Codecov by Sentry. |
Updated. These overloads added: # Ensures that `prnbng.u₀` works.
function Base.getproperty(prnbng::ParsedReactionNetwork, name::Symbol)
if name === :u₀
return getfield(prnbng, :u0)
else
return getfield(prnbng, name)
end
end
# Ensures that `prnbng.u₀ = ...` works.
function Base.setproperty!(prnbng::ParsedReactionNetwork, name::Symbol, x)
if name === :u₀
return setfield!(prnbng, :u0, x)
else
return setfield!(prnbng, name, x)
end
end Given that parsed reaction networks are immutable, I don;t think the other one is needed though? I have also added a couple of tests in the tests file to check that (for some loaded network) @test isequal(prnbng.u0, prnbng.u₀) |
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.
One change then I'm happy to merge. Thanks!
90ec84e
to
a9862a4
Compare
This one should be ready now. |
Related to #104
This is highly breaking though.