Skip to content
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ ignore = [
"PLR0904", # too-many-public-methods
"PLR1702", # too-many-nested-blocks
"RUF067", # non empty init module
"RUF069", # unreliable-floating-point-equality
"PLC1901", # compare-to-empty-string
]

Expand Down
2 changes: 1 addition & 1 deletion src/subscript/eclcompress/eclcompress.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def file_is_binary(filename: str | Path) -> bool:
Args:
filename: File to check
"""
# https://stackoverflow.com/questions/898669/how-can-i-detect-if-a-file-is-binary-non-text-in-python # noqa
# https://stackoverflow.com/questions/898669/how-can-i-detect-if-a-file-is-binary-non-text-in-python
textchars = bytearray({7, 8, 9, 10, 12, 13, 27} | set(range(0x20, 0x100)) - {0x7F})
with open(filename, "rb") as filehandle:
return bool(filehandle.read(1024).translate(None, textchars))
Expand Down
11 changes: 10 additions & 1 deletion src/subscript/hook_implementations/forward_model_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,16 @@ def __init__(self) -> None:
"--rename2fipnum",
"--fipname",
"<FIPNAME>",
"--date",
"<REPORT_DATE>",
"<DATAFILE>",
],
default_mapping={
"<DIR>": "share/results/volumes",
"<OUTPUTFILENAME>": "simulator_volume_fipnum.csv",
"<REGIONS>": "",
"<FIPNAME>": "FIPNUM",
"<REPORT_DATE>": "first",
},
)

Expand All @@ -708,7 +711,8 @@ def documentation() -> ForwardModelStepDocumentation | None:
.. code-block:: console

FORWARD_MODEL PRTVOL2CSV(<DATAFILE>=<ECLBASE>, <REGIONS>=regions.yml, \
<FIPNAME>=FIPNUM, <DIR>=., <OUTPUTFILENAME>=simulator_volume_fipnum.csv)
<FIPNAME>=FIPNUM, <DATE>=first, <DIR>=., \
<OUTPUTFILENAME>=simulator_volume_fipnum.csv)

where ``ECLBASE`` is already defined in your ERT config, pointing to the Eclipse
basename relative to ``RUNPATH`` and ``regions.yml`` is a YAML file defining
Expand All @@ -724,6 +728,11 @@ def documentation() -> ForwardModelStepDocumentation | None:
``VolumetricAnalysis``. This renaming is not needed for ``Webviz-Sumo``. An additional
column with the actual FIPNAME is included for information.

The ``DATE`` argument is by default the first available BALANCE report
in the PRT file, but any valid date for existing BALANCE report can be
specified. Dates must be in ISO-8601 format (yyyy-mm-dd), or as one of the strings
"first" and "last".

Using anything else than "." in the ``DIR`` argument is deprecated. To write to a CSV
file in a specific directory, add the path in the ``OUTPUTFILENAME`` argument.
The directory to export to must exist.
Expand Down
Loading