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 ERT WF to copy preprocessed data #716

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

tnatt
Copy link
Collaborator

@tnatt tnatt commented Jun 28, 2024

PR that adds an ERT plugin workflow WF_COPY_PREPROCESSED_DATAIO to replace the use of the locally installed workflow showcased in Drogon:

Naming and arguments were kept the same as in Drogon to make this a drop-in replacement for the users that have implemented the Drogon workflow.

Main differences with the Drogon script is that this PR uses the new ExportPreprocessedData class to export the data. This enables:

  • no need for the global configuration file - hence deprecation warning implemented
  • if no metadata present a pure copy of the file is performed - needed for SIM2SEIS users that are currently not producing metadata due to lack of masterdata in the global config.

Addresses #702

@tnatt tnatt self-assigned this Jun 28, 2024
@tnatt tnatt requested review from mferrera and jcrivenaes June 28, 2024 13:17
Copy link
Collaborator

@jcrivenaes jcrivenaes left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@mferrera mferrera left a comment

Choose a reason for hiding this comment

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

LGTM. Some small comments but I know much of this is adopted from existing things. Nice job with the tests

src/fmu/dataio/scripts/copy_preprocessed.py Outdated Show resolved Hide resolved
Comment on lines +148 to +149
parser.add_argument(
"--verbosity", type=str, help="Set log level", default="WARNING"
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be deprecated like other verbosity options in dataio?


if not Path(args.ert_caseroot).is_absolute():
logger.debug("Argument 'ert_caseroot' was not absolute: %s", args.ert_caseroot)
raise ValueError("'ert_caseroot' must be an absolute path")
Copy link
Collaborator

Choose a reason for hiding this comment

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

argparse.ArgumentError is another option here, but I see this is most likely taken from create_case_metadata

logger.setLevel(args.verbosity)

searchpath = Path(args.ert_config_path) / args.inpath
match_pattern = "[!.]*" # ignore metafiles (starts with '.')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any possibility this ignores other files we want? (I assume not: but just a sanity check)

@tnatt tnatt merged commit 8d16670 into equinor:main Jul 2, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants