From 5063a9a375208f33b819af5dc232d00396dd4923 Mon Sep 17 00:00:00 2001 From: "Oddvar Lia (ST MSU GEO)" Date: Sun, 17 Dec 2023 21:41:25 +0100 Subject: [PATCH] Type annotation in local_script_lib.py Updated doc-string for test_full.py --- semeio/workflows/localisation/local_script_lib.py | 11 ++++++----- tests/jobs/localisation/example_case/test_full.py | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/semeio/workflows/localisation/local_script_lib.py b/semeio/workflows/localisation/local_script_lib.py index 2c4a2aab2..62c0dcd26 100644 --- a/semeio/workflows/localisation/local_script_lib.py +++ b/semeio/workflows/localisation/local_script_lib.py @@ -6,7 +6,7 @@ import math from collections import defaultdict from dataclasses import dataclass, field -from typing import Dict, List +from typing import Dict, List, Any import cwrap import numpy as np @@ -262,7 +262,7 @@ def write_qc_parameter_surface( reference_surface_file: str, param_for_surface: object, log_level=LogLevel.OFF, - ): + ) -> None: # pylint: disable=too-many-arguments if param_for_surface is None or surface_scale is None: @@ -365,8 +365,9 @@ def build_decay_object( grid: object, use_cutoff: bool, tapering_range: float = 1.5, -) -> Decay: +) -> Any: # pylint: disable=too-many-arguments + decay_obj = None if method == "gaussian_decay": decay_obj = GaussianDecay( ref_pos, @@ -463,7 +464,7 @@ def apply_decay( perp_range: float, azimuth: float, use_cutoff: bool = False, - tapering_range: float = None, + tapering_range: float = 1.5, calculate_qc_parameter: bool = False, ): # pylint: disable=too-many-arguments,too-many-locals @@ -507,7 +508,7 @@ def apply_constant( grid: object, value: float, log_level: LogLevel, - calculate_qc_parameter=False, + calculate_qc_parameter: bool = False, ): # pylint: disable=too-many-arguments,too-many-locals """ diff --git a/tests/jobs/localisation/example_case/test_full.py b/tests/jobs/localisation/example_case/test_full.py index 64980844d..a702ba0c7 100644 --- a/tests/jobs/localisation/example_case/test_full.py +++ b/tests/jobs/localisation/example_case/test_full.py @@ -2,14 +2,14 @@ Test of full workflow using non-adaptive localisation - Gaussian fields are simulated - Response variables are upscaled values of simulated gaussian fields -- Some selected positions within the upscaled grid is used to extract +- Some selected positions within the upscaled grid are used to extract synthetic observations. - Localisation config file is generated. - Running ERT using the generated localisation file. -- The ERT forward model (simulating gaussian fields, - and upscale it is done using the script sim_fields.py) +- The ERT forward model (simulating and upscaling gaussian fields + is done by the script 'sim_fields.py') - For iteration > 0, the updated field parameter is imported from ERT - and upscaled and predictions of observed values are extracted and + and upscaled. Predictions of observed values are extracted and saved to ERT using GEN_DATA keyword. - The final intial and updated ensemble is used when comparing with reference values for the field. One selected realization is used