Skip to content

Conversation

rjplevin
Copy link
Collaborator

  • Added methods to manipulate a Simulation instance
  • Eliminated sim.dist_rvs
  • Changed uses of sim.dist_rvs to call values(sim.rvdict)

See also my comments in #474

- Eliminated sim.dist_rvs
- Changed uses of sim.dist_rvs to call values(sim.rvdict)
@rjplevin
Copy link
Collaborator Author

These new fns are not used in the code base. I though we might merge them to see if they meet our needs.

Copy link
Collaborator

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that looks pretty good to me!

@corakingdon
Copy link
Collaborator

These functions look great to me! I'm looking at the Travis build though, should we be concerned that something is erroring when trying to do an LHS sample?

using Mimi: reset_compdefs, modelinstance, compinstance,
get_var_value, OUTER, INNER, ReshapedDistribution

reset_compdefs()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? (I'm not sure I understand why it was there in the first place, but just wondering what's different now)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows from the removal of the global list of component defs. Nothing to reset!

src/mcs/lhs.jl Outdated
rvdict = sim.rvdict
num_rvs = length(rvdict)
rvlist = sim.dist_rvs
rvlist = collect(values(sim.rvdict))
Copy link
Collaborator

@corakingdon corakingdon May 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added this extra collect because the lhs function that gets called below expects a vector of RVs, not an iterator. All of the other places where you replace sim.dist_rvs with values(sim.rvdict) work though because they only get used in for loops

@davidanthoff
Copy link
Collaborator

I do think we should get back into the grove of not merging things that break CI. Can we figure out what is happening there before we merge?

@corakingdon
Copy link
Collaborator

@davidanthoff yes there is an actual error, I fixed one of them but there's still another so we definitely should not merge this yet!

@corakingdon
Copy link
Collaborator

I just added another spot where we need to use collect, but there are now more errors in something to do with GSA. @rjplevin can you take a look? this might involve needing to update something in the GlobalSensitivityAnalysis package, I'm not sure. The error happens during this call to sample on line 32 of "src/mcs/sobol.jl":

    payload = create_GSA_payload(sim)
    samples = GlobalSensitivityAnalysis.sample(payload)

@rjplevin
Copy link
Collaborator Author

I just posted an update to this branch that passes all Mimi tests.

@codecov-io
Copy link

codecov-io commented May 17, 2019

Codecov Report

Merging #478 into master will decrease coverage by 1.25%.
The diff coverage is 85.71%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #478      +/-   ##
========================================
- Coverage   83.26%    82%   -1.26%     
========================================
  Files          26     26              
  Lines        1870   1901      +31     
========================================
+ Hits         1557   1559       +2     
- Misses        313    342      +29
Impacted Files Coverage Δ
src/mcs/defmcs.jl 65.34% <ø> (-25.07%) ⬇️
src/mcs/sobol.jl 92.59% <100%> (+6.87%) ⬆️
src/mcs/montecarlo.jl 77.14% <100%> (+0.21%) ⬆️
src/mcs/lhs.jl 86.95% <100%> (-0.19%) ⬇️
src/mcs/mcs_types.jl 81.08% <42.85%> (-4.64%) ⬇️
src/core/defs.jl 92.22% <50%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9588fa5...200599c. Read the comment docs.

@davidanthoff
Copy link
Collaborator

Ready to merge then? @rjplevin do you want to merge, you probably know best whether this is ready?

@rjplevin
Copy link
Collaborator Author

I'm testing against all the models... I'll merge it when everything passes!

@rjplevin
Copy link
Collaborator Author

All Mimi and model tests are now passing.

@rjplevin rjplevin merged commit 92bcfc5 into master May 18, 2019
@rjplevin rjplevin deleted the sim-upd-funcs branch May 18, 2019 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants