Skip to content
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

[WIP] Update examples to work with latest CES code #92

Closed
wants to merge 5 commits into from

Conversation

bielim
Copy link
Contributor

@bielim bielim commented Dec 18, 2020

The goal of this PR is to get all examples synced up with the latest changes in the code base (in particular, PRs #88 and #89)

  • Cloudy_example.jl
  • learn_noise.jl
  • plot_GP.jl

In addition, get_distribution() (in ParameterDistribution.jl) has been modified to return the array of samples when called for Samples ( rather than the message "Contains samples only"). get_distribution now returns a Dict with the parameter names as keys and the corresponding distribution (in the case of Parameterized distributions, such as Normal(0.0, 1.0)) or the corresponding samples (in the case of parameters represented by Samples) as a parameter_dimension x n_samples array.

@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #92 (ec879ce) into master (35eef88) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #92   +/-   ##
=======================================
  Coverage   85.19%   85.19%           
=======================================
  Files           7        7           
  Lines         547      547           
=======================================
  Hits          466      466           
  Misses         81       81           
Impacted Files Coverage Δ
src/ParameterDistribution.jl 98.82% <100.00%> (ø)

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 35eef88...ec879ce. Read the comment docs.

Copy link
Collaborator

@odunbar odunbar left a comment

Choose a reason for hiding this comment

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

Looks good! I think the heart of my comments are that we have built an interface with ParameterDistribution s, and so we should use always use it. That is, rather than directly accessing the (effectively private) members e.g posterior.distribution[i] we should be instead "getting" them. i.e call get_distribution(posterior) and then using the returned objects. This is typically easier to maintain down the line if everything interacts with the distributions in the same way. If the right getter functionality isn't there we should add the getter functions over bypassing them.

Melanie added 2 commits December 22, 2020 15:14
Use getters (Ollie's comments), additional explanations, beautification, etc.
@bielim bielim self-assigned this Dec 22, 2020
@bielim bielim closed this Dec 22, 2020
@bielim
Copy link
Contributor Author

bielim commented Dec 22, 2020

Superseded by #94 (messed up the squash and rebase :-))

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.

2 participants