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

Add save_parameter_samples #370

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Add save_parameter_samples #370

merged 3 commits into from
Mar 19, 2024

Conversation

nefrathenrici
Copy link
Member

This adds a function save_parameter_samples which takes samples from the given Samples distribution and saves them to individual TOML files for use in model runs.

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.

Hi @nefrathenrici
Just a couple of small points to address then merge away

LGTM!

default_param_data::Dict,
save_path,
save_file;
pad_zeros = 3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason we hard-code this to 3?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I set it to be an optional keyword argument.

- rng - The random number generator used in sampling
"""
function save_parameter_samples(
distribution::ParameterDistribution{Samples},
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function would work with any distribution right? It doesn't need to be a Samples-type?
Unless there is a reason to restrict to this, we could allow others

Copy link
Member Author

Choose a reason for hiding this comment

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

As long as sample is defined for the given distribution, it would work. I will remove the type constraint!

@nefrathenrici nefrathenrici merged commit 8cdeeab into main Mar 19, 2024
11 checks passed
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