From dd4e9ab0082b359d4c6bfe63394567df3748a455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eide?= Date: Wed, 18 Dec 2024 10:35:52 +0100 Subject: [PATCH] Remove unused test data --- test-data/ert/batch_sim/batch_sim.ert | 18 --------- .../batch_sim/batch_sim_sleep_and_fail.ert | 15 ------- test-data/ert/batch_sim/jobs/ODD_FAIL | 1 - test-data/ert/batch_sim/jobs/SLEEP | 1 - test-data/ert/batch_sim/jobs/SQUARE_PARAMS | 4 -- test-data/ert/batch_sim/jobs/odd_fail.py | 7 ---- test-data/ert/batch_sim/jobs/square_params.py | 27 ------------- test-data/ert/batch_sim/jobs/super_sleep.sh | 3 -- test-data/ert/batch_sim/sleepy_time.ert | 11 ----- .../workflows/REALIZATION_NUMBER_WORKFLOW | 1 - .../workflows/jobs/REALIZATION_NUMBER | 4 -- .../workflows/jobs/realization_number.py | 40 ------------------- 12 files changed, 132 deletions(-) delete mode 100644 test-data/ert/batch_sim/batch_sim.ert delete mode 100644 test-data/ert/batch_sim/batch_sim_sleep_and_fail.ert delete mode 100644 test-data/ert/batch_sim/jobs/ODD_FAIL delete mode 100644 test-data/ert/batch_sim/jobs/SLEEP delete mode 100644 test-data/ert/batch_sim/jobs/SQUARE_PARAMS delete mode 100755 test-data/ert/batch_sim/jobs/odd_fail.py delete mode 100755 test-data/ert/batch_sim/jobs/square_params.py delete mode 100755 test-data/ert/batch_sim/jobs/super_sleep.sh delete mode 100644 test-data/ert/batch_sim/sleepy_time.ert delete mode 100644 test-data/ert/batch_sim/workflows/REALIZATION_NUMBER_WORKFLOW delete mode 100644 test-data/ert/batch_sim/workflows/jobs/REALIZATION_NUMBER delete mode 100755 test-data/ert/batch_sim/workflows/jobs/realization_number.py diff --git a/test-data/ert/batch_sim/batch_sim.ert b/test-data/ert/batch_sim/batch_sim.ert deleted file mode 100644 index 4d386dd6b6a..00000000000 --- a/test-data/ert/batch_sim/batch_sim.ert +++ /dev/null @@ -1,18 +0,0 @@ -QUEUE_SYSTEM LOCAL -QUEUE_OPTION LOCAL MAX_RUNNING 2 - -NUM_REALIZATIONS 25 - -DEFINE storage/ - -RUNPATH /runpath//realization-/iter- -ENSPATH /ensemble -JOBNAME SNAKE_OIL_FIELD - -INSTALL_JOB SQUARE_PARAMS jobs/SQUARE_PARAMS - -LOAD_WORKFLOW workflows/REALIZATION_NUMBER_WORKFLOW -HOOK_WORKFLOW REALIZATION_NUMBER_WORKFLOW PRE_SIMULATION -LOAD_WORKFLOW_JOB workflows/jobs/REALIZATION_NUMBER - -FORWARD_MODEL SQUARE_PARAMS diff --git a/test-data/ert/batch_sim/batch_sim_sleep_and_fail.ert b/test-data/ert/batch_sim/batch_sim_sleep_and_fail.ert deleted file mode 100644 index 097d2c0d476..00000000000 --- a/test-data/ert/batch_sim/batch_sim_sleep_and_fail.ert +++ /dev/null @@ -1,15 +0,0 @@ -QUEUE_SYSTEM LOCAL -QUEUE_OPTION LOCAL MAX_RUNNING 10 - -NUM_REALIZATIONS 10 - -RUNPATH runpath/realization-/iter- -JOBNAME SNAKE_OIL_FIELD - -INSTALL_JOB SQUARE_PARAMS jobs/SQUARE_PARAMS -INSTALL_JOB SLEEP jobs/SLEEP -INSTALL_JOB ODD_FAIL jobs/ODD_FAIL - -SIMULATION_JOB SQUARE_PARAMS -SIMULATION_JOB SLEEP -SIMULATION_JOB ODD_FAIL diff --git a/test-data/ert/batch_sim/jobs/ODD_FAIL b/test-data/ert/batch_sim/jobs/ODD_FAIL deleted file mode 100644 index cbfbf0d58c9..00000000000 --- a/test-data/ert/batch_sim/jobs/ODD_FAIL +++ /dev/null @@ -1 +0,0 @@ -EXECUTABLE odd_fail.py diff --git a/test-data/ert/batch_sim/jobs/SLEEP b/test-data/ert/batch_sim/jobs/SLEEP deleted file mode 100644 index f86ab647834..00000000000 --- a/test-data/ert/batch_sim/jobs/SLEEP +++ /dev/null @@ -1 +0,0 @@ -EXECUTABLE super_sleep.sh diff --git a/test-data/ert/batch_sim/jobs/SQUARE_PARAMS b/test-data/ert/batch_sim/jobs/SQUARE_PARAMS deleted file mode 100644 index 928bd453110..00000000000 --- a/test-data/ert/batch_sim/jobs/SQUARE_PARAMS +++ /dev/null @@ -1,4 +0,0 @@ -STDOUT square_params.stdout -STDERR square_params.stderr - -EXECUTABLE square_params.py diff --git a/test-data/ert/batch_sim/jobs/odd_fail.py b/test-data/ert/batch_sim/jobs/odd_fail.py deleted file mode 100755 index 0fc9648a728..00000000000 --- a/test-data/ert/batch_sim/jobs/odd_fail.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -import sys - -if __name__ == "__main__": - iens = int(sys.argv[1]) - sys.exit(iens % 2) diff --git a/test-data/ert/batch_sim/jobs/square_params.py b/test-data/ert/batch_sim/jobs/square_params.py deleted file mode 100755 index c3f2b5c6b53..00000000000 --- a/test-data/ert/batch_sim/jobs/square_params.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -import json -import random -import time - -keys = ["W1", "W2", "W3"] - - -def square_file(input_file, output_file): - with open(input_file, encoding="utf-8") as fin: - data0 = json.load(fin) - out = [] - for key in keys: - data1 = data0[key] - try: - out.extend([str(v**2) for _, v in data1.items()]) - except AttributeError: - out.append(str(data1**2)) - with open(output_file, "w", encoding="utf-8") as fout: - fout.write("\n".join(out)) - - -if __name__ == "__main__": - square_file("WELL_ORDER.json", "ORDER") - time.sleep(random.randint(0, 2)) - square_file("WELL_ON_OFF.json", "ON_OFF") - time.sleep(random.randint(0, 2)) diff --git a/test-data/ert/batch_sim/jobs/super_sleep.sh b/test-data/ert/batch_sim/jobs/super_sleep.sh deleted file mode 100755 index 52c5ca5ada7..00000000000 --- a/test-data/ert/batch_sim/jobs/super_sleep.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -let sleep_interval=$1/2 -sleep $sleep_interval diff --git a/test-data/ert/batch_sim/sleepy_time.ert b/test-data/ert/batch_sim/sleepy_time.ert deleted file mode 100644 index 1cfa6dec312..00000000000 --- a/test-data/ert/batch_sim/sleepy_time.ert +++ /dev/null @@ -1,11 +0,0 @@ -QUEUE_SYSTEM LOCAL -QUEUE_OPTION LOCAL MAX_RUNNING 10 - -NUM_REALIZATIONS 10 - -RUNPATH runpath/realization--/iter- -JOBNAME OLE_LUKKOYE - -INSTALL_JOB SLEEP jobs/SLEEP - -SIMULATION_JOB SLEEP 2 diff --git a/test-data/ert/batch_sim/workflows/REALIZATION_NUMBER_WORKFLOW b/test-data/ert/batch_sim/workflows/REALIZATION_NUMBER_WORKFLOW deleted file mode 100644 index 2d2c67a2a18..00000000000 --- a/test-data/ert/batch_sim/workflows/REALIZATION_NUMBER_WORKFLOW +++ /dev/null @@ -1 +0,0 @@ -REALIZATION_NUMBER diff --git a/test-data/ert/batch_sim/workflows/jobs/REALIZATION_NUMBER b/test-data/ert/batch_sim/workflows/jobs/REALIZATION_NUMBER deleted file mode 100644 index 6b92b1dc25b..00000000000 --- a/test-data/ert/batch_sim/workflows/jobs/REALIZATION_NUMBER +++ /dev/null @@ -1,4 +0,0 @@ -INTERNAL FALSE -EXECUTABLE realization_number.py -MIN_ARG 1 -MAX_ARG 1 diff --git a/test-data/ert/batch_sim/workflows/jobs/realization_number.py b/test-data/ert/batch_sim/workflows/jobs/realization_number.py deleted file mode 100755 index 687bbd15f1b..00000000000 --- a/test-data/ert/batch_sim/workflows/jobs/realization_number.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -import argparse -import re -from pathlib import Path - -TARGET_FILE = "realization.number" -REGEX = r"realization-(\d+)" - - -def add_file_to_realization_runpaths(runpath_file): - with open(runpath_file, encoding="utf-8") as fh: - runpath_file_lines = fh.readlines() - - for line in runpath_file_lines: - realization_path = line.split()[1] - realization_nr = re.findall(REGEX, realization_path) - (Path(realization_path) / TARGET_FILE).write_text( - f"{realization_nr[0]}", encoding="utf-8" - ) - - -def job_parser(): - description = ( - "A workflow job that, if the komodo version is set, " - "adds a file with the current Komodo version to the " - "runpath of each realization." - ) - parser = argparse.ArgumentParser(description=description) - parser.add_argument( - "runpath_file", - type=str, - help="Path to the file containing the runpath of all the realizations.", - ) - return parser - - -if __name__ == "__main__": - parser = job_parser() - args = parser.parse_args() - add_file_to_realization_runpaths(args.runpath_file)