From 81af438cbef061777808c641e970f662c64fa80d Mon Sep 17 00:00:00 2001 From: oddvarlia <77153131+oddvarlia@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:13:14 +0100 Subject: [PATCH] Updated formatting with new ruff version (#269) --- src/fmu/tools/rms/create_rft_ertobs.py | 12 ++++++------ .../rms/test_generate_petro_jobs_for_field_update.py | 2 +- tests/rms/test_rename_rms_scripts.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fmu/tools/rms/create_rft_ertobs.py b/src/fmu/tools/rms/create_rft_ertobs.py index 111b25ec..01f75b26 100644 --- a/src/fmu/tools/rms/create_rft_ertobs.py +++ b/src/fmu/tools/rms/create_rft_ertobs.py @@ -78,9 +78,9 @@ def check_and_parse_config(config: Dict[str, Any]) -> Dict[str, Any]: else: config["loglevel"] = logging.WARNING - assert not ( - "input_dframe" not in config and "input_file" not in config - ), "Specify either input_file or input_dframe" + assert not ("input_dframe" not in config and "input_file" not in config), ( + "Specify either input_file or input_dframe" + ) if "input_dframe" in config and "input_file" in config: raise ValueError("Do not specify both input_dframe and input_file") @@ -137,9 +137,9 @@ def check_and_parse_config(config: Dict[str, Any]) -> Dict[str, Any]: assert isinstance(config["rft_prefix"], str), "rft_prefix must be a string" config["trajectory_name"] = config.get("trajectory_name", "Drilled trajectory") - assert isinstance( - config["trajectory_name"], str - ), "trajectory_name must be a string" + assert isinstance(config["trajectory_name"], str), ( + "trajectory_name must be a string" + ) return config diff --git a/tests/rms/test_generate_petro_jobs_for_field_update.py b/tests/rms/test_generate_petro_jobs_for_field_update.py index 90e0a99b..caea0998 100644 --- a/tests/rms/test_generate_petro_jobs_for_field_update.py +++ b/tests/rms/test_generate_petro_jobs_for_field_update.py @@ -262,7 +262,7 @@ def rename_subgrids(xtgeo_grd: xtgeo.Grid) -> None: nsubgrids = len(list(xtgeo_grd.subgrids.keys())) subgrid_names = [] for i in range(nsubgrids): - name_of_subgrid = f"Zone{i+1}" + name_of_subgrid = f"Zone{i + 1}" subgrid_names.append(name_of_subgrid) xtgeo_grd.rename_subgrids(subgrid_names) diff --git a/tests/rms/test_rename_rms_scripts.py b/tests/rms/test_rename_rms_scripts.py index c2c9bbe4..e068b487 100644 --- a/tests/rms/test_rename_rms_scripts.py +++ b/tests/rms/test_rename_rms_scripts.py @@ -213,7 +213,7 @@ def test_fix_standalone_filenames(tmp_path): assert e["instance_name"] == e["standalonefilename"] with open(e["path"], "r", encoding="utf-8") as f: code = f.read().strip() - assert code == f"print(\"{entry.split('.')[0]}\")" + assert code == f'print("{entry.split(".")[0]}")' unfixed = project.get_inconsistent_entries() assert len(unfixed) - len(skipped) == 0