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

REV: Set depth as default vertical_domain #807

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions src/fmu/dataio/dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class ExportData:
Note also: If missing or empty, export() may still be done, but without a
metadata file (this feature may change in future releases).

content: Optional, default is "depth". Is a string or a dictionary with one key.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaked in a removal of incorrect documentation

content: Optional. Is a string or a dictionary with one key.
Example is "depth" or {"fluid_contact": {"xxx": "yyy", "zzz": "uuu"}}.
Content is checked agains a white-list for validation!

Expand Down Expand Up @@ -308,10 +308,10 @@ class ExportData:
[[20200101, "monitor"], [20180101, "base"]] or just [[2021010]]. The output
to metadata will from version 0.9 be different (API change)

vertical_domain: Optional. String with vertical domain either "time" or "depth".
It is also possible to provide a reference for the vertical scale, see the
domain_reference key. Note that if the ``content`` is "depth" or "time"
the vertical_domain will be set accordingly.
vertical_domain: Optional. String with vertical domain either "time" or "depth"
(default). It is also possible to provide a reference for the vertical scale,
see the domain_reference key. Note that if the ``content`` is "depth" or
"time" the vertical_domain will be set accordingly.

workflow: Short tag desciption of workflow (as description)

Expand Down Expand Up @@ -403,7 +403,7 @@ class ExportData:
timedata: Optional[List[list]] = None
unit: Optional[str] = ""
verbosity: str = "DEPRECATED" # remove in version 2
vertical_domain: Optional[Union[str, dict]] = None # dict input is deprecated
vertical_domain: Union[str, dict] = "depth" # dict input is deprecated
workflow: Optional[Union[str, Dict[str, str]]] = None # dict input is deprecated
table_index: Optional[list] = None

Expand Down
2 changes: 1 addition & 1 deletion tests/test_units/test_dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def test_vertical_domain(regsurf, globalconfig1):
mymeta = ExportData(config=globalconfig1, content="thickness").generate_metadata(
regsurf
)
assert "vertical_domain" not in mymeta["data"]
assert mymeta["data"]["vertical_domain"] == "depth" # default value
assert mymeta["data"]["domain_reference"] == "msl" # default value

# test invalid input
Expand Down
Loading