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

forcing generation is broken: config is read from forcing file #3

Closed
BSchilperoort opened this issue Oct 31, 2023 · 0 comments · Fixed by #4
Closed

forcing generation is broken: config is read from forcing file #3

BSchilperoort opened this issue Oct 31, 2023 · 0 comments · Fixed by #4
Labels
bug Something isn't working

Comments

@BSchilperoort
Copy link
Member

In the config loader, the config is read from the forcing file:

@model_validator(mode="after")
def _initialize_config(self) -> "MarrmotM14":
assert self.forcing.directory is not None
assert self.forcing.forcing_file is not None
forcing_filepath = str(self.forcing.directory / self.forcing.forcing_file)
self._config = sio.loadmat(forcing_filepath, mat_dtype=True)

However, when forcing is generated from ERA5/CMIP this configuration is missing. This prevents the user from running the model, unless they specify all required parameters as kwargs in model.setup().

This can be solved by implementing default parameters, which will be overwritten by any parameters in the config file or by user specified kwargs.

@BSchilperoort BSchilperoort added the bug Something isn't working label Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant