Skip to content

Conversation

@lucaeg
Copy link
Contributor

@lucaeg lucaeg commented Dec 19, 2025

This is a draft, do not merge.

@lucaeg lucaeg marked this pull request as draft December 19, 2025 06:57
def transform_data(self) -> Callable[[float], float]:
return lambda x: x

def sample_value(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since sample_value is called in a loop, I wonder if this should be re-written to samples VALUES (plural) instead. That way we avoid the O(n) computation inside each method call, so we get O(n) overall instead of O(n^2) and a bit more clarity in the code IMO.

Copy link
Contributor Author

@lucaeg lucaeg Jan 6, 2026

Choose a reason for hiding this comment

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

Do you mean this loop?

datasets = [ Ensemble.sample_parameter( config_node, realization_nr, random_seed=random_seed, num_realizations=num_realizations, ) for realization_nr in active_realizations ]

Copy link
Contributor

Choose a reason for hiding this comment

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

yes!

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