You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When we have a field with e.g. type Union[TimModel, ForcingModel] we follow the order of the declared FileModels and try to parse the data from the file and initialize the model. When this fails, the next object is tried.
This has several draw backs:
Performance; especially with larger files this could build up significantly
When the user refers to e.g. a tim file in the model, but there is a mistake in the file, the initialized file model will be a ForcingModel. Because of the Union type, errors are swallowed and the user remains uninformed.
Sometimes the order is very finicky; some file types are very similar and the parser won't throw errors leading to the wrong FileModel.
With loading a model using Recurse=False, the first FileModel will be used, since it has no data to validate, this validation will always succeed.
Describe the solution you'd like
I would like to have a smarter way to deal with FileModel unions.
Some files like the old external forcing file have a file type defined, this could potentially be used to initialize the correct FileModel.
We could also look at the extensions of the file.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When we have a field with e.g. type
Union[TimModel, ForcingModel]
we follow the order of the declared FileModels and try to parse the data from the file and initialize the model. When this fails, the next object is tried.This has several draw backs:
ForcingModel
. Because of the Union type, errors are swallowed and the user remains uninformed.Recurse=False
, the first FileModel will be used, since it has no data to validate, this validation will always succeed.Describe the solution you'd like
I would like to have a smarter way to deal with FileModel unions.
Some files like the old external forcing file have a file type defined, this could potentially be used to initialize the correct FileModel.
We could also look at the extensions of the file.
The text was updated successfully, but these errors were encountered: