-
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
Adds MarginalInstance struct #957
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #957 +/- ##
==========================================
- Coverage 84.52% 84.43% -0.10%
==========================================
Files 40 40
Lines 3878 4074 +196
==========================================
+ Hits 3278 3440 +162
- Misses 600 634 +34
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Here's the MimiFAIRv2 PR: anthofflab/MimiFAIRv2.jl#16 |
@jrising this seems reasonable to me, am I right that in the diff most of the changes are the line spacing removal and the main functional change is just the addition of the method? @davidanthoff does this look alright to you? I'll note that we can also handle this by using the built-in Monte Carlo functionality of Mimi that takes care of the updating of a model instance without building, which is a bit safer for more novice users, but @jrising I know the FAIRv2 one we wrote did not use that functionality and as of now I haven't added one (I have for a paper I'm working on though, so when I get the chance I can port over that option too) so this is likely useful for your workflows. Happy to approve. |
@lrennels I only checked in files with changes, so there are minor additions to each of those files. Here's the list of actual additions:
I tried to put these where the equivalent code is for MarginalModels or ModelInstances. There are probably other functions one might want for MarginalInstance to support, but these were the ones I found necessary. |
Sorry for the delay @jrising I'll look at this this week, I think all should be fine I just want to run our dependency tests as well. I will note that I think I won't advertise this use for now, only because ew don't have as many safetys put onto the For example I was reminded the hard way recently that if you run |
No worries. Thanks for thinking about it. |
Currently, one can only run
build!
on aMarginalModel
, notbuild
. The second is useful for Monte Carlo runs because it gives aModelInstance
where parameters can be updated without requiring new building. This extends that feature toMarginalModel
s.A
MarginalInstance
is a pair ofModelInstance
s, with the delta so that marginal values can be retrieved. It also has a (currently minimal) set of associated functions so that Monte Carlo code that currently takes aModel
can just be generalized toUnion{Model, MarginalModel}
and the associated code still works.In the diffs below, sorry that my editor removed spaces at the end of lines. If it's a problem, I can fix that.
An associated PR to MimiFAIRv2 that uses this change will come next.