-
Notifications
You must be signed in to change notification settings - Fork 35
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
Set param update #665
Set param update #665
Conversation
…re commented out, and a few bugs appeared in test_explorer_sim.jl.
# Conflicts: # test/test_parametertypes.jl Also fix default-setting bug.
Co-Authored-By: David Anthoff <[email protected]>
…imi.jl into set-param-update
For some reason, yes there are cases in some of the tests where these are different. I was just explaining to Lisa (but maybe should have said it in the general slack channel) that this fix only appears to work for flat models and not all composite models. It does work for some of the composites in the tests files though. I think it has to do with if the parameters have different names. This is definitely not a full/clean implementation though. I just pushed it for Lisa to be able to look at. |
I'm surprised it works since |
I think it only disconnects parameters for that component, not for all things bound to that external parameter. For example, the following works now (and works in the @defcomp A begin
p1 = Parameter()
end
@defcomp B begin
p1 = Parameter()
end
m = Model()
set_dimension!(m, :time, 10)
add_comp!(m, A)
add_comp!(m, B)
set_param!(m, :p1, 5)
run(m)
m[:A, :p1] == m[:B, :p1] == 5 |
Great -- maybe it's simpler than I expected! |
Looks like we're failing a test in update Ok that was dumb of me, this was before we had our rules about parameters having the same name! I changed the code so we have two distinct components with distinct parameters. Just to make sure, we're not throwing any kind of flags when two components have the same parameter right, we're assuming the user is aware of that meaning they both get set to the same thing?
|
Codecov Report
@@ Coverage Diff @@
## master #665 +/- ##
==========================================
- Coverage 80.24% 79.19% -1.06%
==========================================
Files 39 39
Lines 2743 2840 +97
==========================================
+ Hits 2201 2249 +48
- Misses 542 591 +49
Continue to review full report at Codecov.
|
WIP Fix bug in testing for colon support
…imi.jl into set-param-update
@ckingdon95 and @lrennels to fix the doctests, including adding
mim-next
branches to FUND and DICE2010, and any other tutorial changes we need.