-
Notifications
You must be signed in to change notification settings - Fork 15
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
ENH: Add pydantic meta schema #409
Conversation
In its current state it fully runs A few assumtions has been made in order to attempt to clean up the schema abit:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only adding functionality - should not have any negative impact on existing usage.
Consider comments.
Very nice start on significant improvement 🚀
@@ -0,0 +1,6 @@ | |||
from .model import Root, dump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May cause confusion when the word "model" hits the namespace in a context where this word has lots of meanings. Possible to use "datamodels"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"datastructure" or "datastructures"? Ref discussion
From review, rename modeles folder to datastructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Followups:
python3 tools/sumo-explorer-model-validate.py
Traceback (most recent call last):
File "/Users/JLOV/src/fmu-dataio/tools/sumo-explorer-model-validate.py", line 53, in <module>
parsed = Root.model_validate(m)
File "/Users/JLOV/.pyenv/versions/dataio/lib/python3.10/site-packages/pydantic/main.py", line 503, in model_validate
return cls.__pydantic_validator__.validate_python(
pydantic_core._pydantic_core.ValidationError: 16 validation errors for Root
cube.fmu.realization.jobs.ert_pid
Field required [type=missing, input_value={'umask': '0002', 'DATA_R...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.global_environment
Field required [type=missing, input_value={'umask': '0002', 'DATA_R...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.arg_types
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.argList
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.error_file
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.executable
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.license_path
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.max_arg
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.max_running_minutes
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.max_running
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.start_file
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.stderr
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.stdin
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.stdout
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.jobList.0.target_file
Field required [type=missing, input_value={'min_arg': 1, 'name': 'M...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing
cube.fmu.realization.jobs.run_id
Field required [type=missing, input_value={'umask': '0002', 'DATA_R...'anything': 'something'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.5/v/missing |
Addresses #423
This PR is does not change any logic, it just adds a Pydantic model to the repository. There a few convenience tools as well, that i used while dev. the pydantic model.