Thanks to visit codestin.com
Credit goes to github.com

Skip to content

write validation fails for VerticesDiscretization #398

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

Closed
Manangka opened this issue May 26, 2023 · 2 comments
Closed

write validation fails for VerticesDiscretization #398

Manangka opened this issue May 26, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Manangka
Copy link
Collaborator

In GitLab by @luitjansl on May 26, 2023, 17:54

to reproduce, go the example in imod-python\examples\mf6\circle.py
and add the following line at line number 114

gwf_model["disv"]._validate(imod.mf6.VerticesDiscretization._write_schemata, idomain=idomain )

this crashes and gives the following message:

Exception has occurred: KeyError
'bottom'
File "D:\dev\imod-python\imod\schemata.py", line 349, in validate
other_obj = kwargs[self.other]
File "D:\dev\imod-python\imod\mf6\pkgbase.py", line 421, in _validate
schema.validate(self.dataset[variable], **kwargs)
File "D:\dev\imod-python\examples\mf6\circle.py", line 114, in
gwf_model["disv"]._validate(imod.mf6.VerticesDiscretization._write_schemata, idomain=idomain )
KeyError: 'bottom'

@Manangka
Copy link
Collaborator Author

In GitLab by @JoerivanEngelen on Jul 24, 2023, 17:23

I investigated this. This is caused by a missing overrided of the _validate method, where "bottom" is added to the validation kwargs. By shere accident, the models already add this "bottom" to the kwargs:

...
            pkg_errors = pkg._validate(
                schemata=schemata,
                idomain=idomain,
                bottom=bottom,
            )
...

The "bottom" is required in model validation to compare with the River bottom_elevation.

So this error is only thrown when calling validation on the DiscretizationVertices package separately

@Manangka
Copy link
Collaborator Author

In GitLab by @JoerivanEngelen on Jul 24, 2023, 17:50

marked this issue as related to #483

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

No branches or pull requests

2 participants