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 a SeedMixin class for seed options #1642

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

SGeeversAtVortech
Copy link
Contributor

Add a SeedMixin class for enabling seed options such as reading a seed from a file and falling back to a default seed if the solver failed.

Refactor timeseries utilities used in optimization CSVMixin
and PIMixin and move the utilities to a more generic module.
Add a mixin class to enable more seed options,
such as reading a seed from a file
and falling back to a default seed if the solver failed
for the given seed.
Copy link
Contributor

@Ailbhemit Ailbhemit left a comment

Choose a reason for hiding this comment

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

Hi Sjoerd. This works well, meets the requirements and is user friendly. There was one bug I found during testing where the seed cannot be interpolated due to being filled with nans.

src/rtctools/data/timeseries.py Show resolved Hide resolved
@Ailbhemit
Copy link
Contributor

I am also not able to see how a user can choose whether or not to use a seed based upon and input parameter? Parameters are not yet available when seed_options is accessed.

@SGeeversAtVortech
Copy link
Contributor Author

I am also not able to see how a user can choose whether or not to use a seed based upon and input parameter? Parameters are not yet available when seed_options is accessed.

The user can overwrite the seed_options method, similar to how we handle other options. By default, option seed_timeseries is None, which means no timeseries is used for the seed.

Update fill_nan_in_timeseries for the case where the timeseries
has only nans.
In this case, the result should also only be nans.
Call pre- and postprocessing at the correct place in SeedMixin,
so only before and after the actaul optimization.
@Ailbhemit
Copy link
Contributor

I am also not able to see how a user can choose whether or not to use a seed based upon and input parameter? Parameters are not yet available when seed_options is accessed.

The user can overwrite the seed_options method, similar to how we handle other options. By default, option seed_timeseries is None, which means no timeseries is used for the seed.

This is now possible (accessing parameters) with the recent commit

Copy link
Contributor

@Ailbhemit Ailbhemit left a comment

Choose a reason for hiding this comment

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

PR is now ready to merge

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