-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLN: Validate global configuration using pydantic
- Loading branch information
JB Lovland
committed
Jan 16, 2024
1 parent
5bcc749
commit 003b549
Showing
6 changed files
with
62 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ dependencies = [ | |
"numpy", | ||
"pandas", | ||
"pyarrow", | ||
"pydantic>=2.5.2", | ||
"PyYAML", | ||
"xtgeo>=2.16", | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Provides classes for managing and validating global configuration | ||
settings in an application. These classes ensure essential settings | ||
are defined and maintained consistently. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Dict, List, Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class MinimumGlobalConfigurationStratigraphy(BaseModel): | ||
name: str | ||
stratigraphic: bool | ||
alias: Optional[List[str]] = None | ||
stratigraphic_alias: Optional[List[str]] = None | ||
|
||
|
||
class MinimumGlobalConfiguration(BaseModel): | ||
"""A minimum check/validation of the static global_config.""" | ||
|
||
access: Dict | ||
masterdata: Dict | ||
model: Dict | ||
stratigraphy: Optional[Dict[str, MinimumGlobalConfigurationStratigraphy]] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters