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

ENH: Add pydantic meta schema #409

Merged
merged 25 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[mypy]
plugins = pydantic.mypy
disallow_untyped_defs = True
exclude = ^((tests|docs|examples|build)/|conftest.py?)
exclude = ^((tests|docs|examples|build|tools)/|conftest.py?)
extra_checks = True
ignore_missing_imports = True
python_version = 3.8
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [
"numpy",
"pandas",
"pyarrow",
"pydantic>=2.5.0",
janbjorge marked this conversation as resolved.
Show resolved Hide resolved
"PyYAML",
"xtgeo>=2.16",
]
Expand Down Expand Up @@ -81,10 +82,6 @@ write_to = "src/fmu/dataio/version.py"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--verbose"
log_cli = "False"
log_cli_format = "%(levelname)8s (%(relativeCreated)6.0fms) %(filename)44s [%(funcName)40s()] %(lineno)4d >> %(message)s"
log_cli_level = "INFO"
testpaths = "tests"
markers = ["integration: marks a test as an integration test"]
xfail_strict = true
Expand Down
2 changes: 2 additions & 0 deletions radixconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/equinor/radix-operator/release/json-schema/radixapplication.json
# Only works if the redhat yaml ext. in vs-code is installed.
apiVersion: radix.equinor.com/v1
kind: RadixApplication
metadata:
Expand Down
6 changes: 6 additions & 0 deletions src/fmu/dataio/models/meta/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .model import Root, dump
Copy link
Member

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"?

Copy link
Member

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


__all__ = [
"dump",
"Root",
]
8 changes: 8 additions & 0 deletions src/fmu/dataio/models/meta/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

import json

from . import dump

if __name__ == "__main__":
print(json.dumps(dump(), indent=2))
Loading
Loading