From b12447b902938ebcbdf9bfe1bc716010c0db458f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Therese=20Natter=C3=B8y?= <61694854+tnatt@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:47:12 +0200 Subject: [PATCH] STY: Update to latest ruff (#758) --- examples/s/d/nn/_project/aggregate_surfaces.py | 5 +++-- .../d/nn/xcase/realization-0/iter-0/any/bin/export_grid3d.py | 3 ++- .../realization-0/iter-0/any/bin/export_volumetables.py | 3 ++- .../xcase/realization-0/iter-0/rms/bin/export_a_surface.py | 3 ++- .../realization-0/iter-0/rms/bin/export_faultpolygons.py | 3 ++- .../nn/xcase/realization-0/iter-0/rms/bin/export_propmaps.py | 3 ++- .../xcase/realization-1/iter-0/rms/bin/export_a_surface.py | 3 ++- .../xcase/realization-9/iter-0/rms/bin/export_a_surface.py | 3 ++- tests/conftest.py | 3 ++- tests/test_export_rms/test_export_rms_volumetrics.py | 4 ++-- tests/test_integration/test_hook_implementations.py | 3 ++- tests/test_integration/test_wf_copy_preprocessed_data.py | 3 ++- tests/test_schema/test_pydantic_logic.py | 3 ++- tests/test_units/test_aggregated_surfaces.py | 5 +++-- tests/test_units/test_contents.py | 3 ++- tests/test_units/test_dataio.py | 1 + tests/test_units/test_dictionary.py | 1 + tests/test_units/test_ert_context.py | 3 ++- tests/test_units/test_filedataprovider_class.py | 1 + tests/test_units/test_fmuprovider_class.py | 3 ++- tests/test_units/test_global_configuration.py | 3 ++- tests/test_units/test_initialize_case.py | 3 ++- tests/test_units/test_metadata_class.py | 3 ++- tests/test_units/test_objectdataprovider_class.py | 3 ++- tests/test_units/test_preprocessed.py | 3 ++- tests/test_units/test_prerealization_surfaces.py | 3 ++- tests/test_units/test_readers.py | 1 + tests/test_units/test_rms_context.py | 5 +++-- tests/test_units/test_table.py | 1 + tests/test_units/test_utils.py | 3 ++- tools/schema-validate.py | 3 ++- tools/sumo-explorer-validate.py | 5 +++-- 32 files changed, 63 insertions(+), 32 deletions(-) diff --git a/examples/s/d/nn/_project/aggregate_surfaces.py b/examples/s/d/nn/_project/aggregate_surfaces.py index c7b71d88e..f8d308d6d 100644 --- a/examples/s/d/nn/_project/aggregate_surfaces.py +++ b/examples/s/d/nn/_project/aggregate_surfaces.py @@ -4,12 +4,13 @@ from pathlib import Path -import fmu.dataio -import fmu.dataio._utils import numpy as np import xtgeo import yaml +import fmu.dataio +import fmu.dataio._utils + def main(): """Aggregate one surface across X realizations from the example case and store the diff --git a/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_grid3d.py b/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_grid3d.py index 232fa0730..cf4262461 100644 --- a/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_grid3d.py +++ b/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_grid3d.py @@ -3,8 +3,9 @@ import logging import pathlib -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as ut logging.basicConfig(level=logging.DEBUG) diff --git a/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_volumetables.py b/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_volumetables.py index 26435c74e..dd3815efc 100644 --- a/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_volumetables.py +++ b/examples/s/d/nn/xcase/realization-0/iter-0/any/bin/export_volumetables.py @@ -9,8 +9,9 @@ import logging import pathlib -import fmu.dataio import pandas as pd + +import fmu.dataio from fmu.config import utilities as ut logger = logging.getLogger(__name__) diff --git a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_a_surface.py b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_a_surface.py index 466a7e4d9..38ec91c33 100644 --- a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_a_surface.py +++ b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_a_surface.py @@ -8,8 +8,9 @@ import logging from pathlib import Path -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as ut logger = logging.getLogger(__name__) diff --git a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_faultpolygons.py b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_faultpolygons.py index 04fcc96b0..9900cebb9 100644 --- a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_faultpolygons.py +++ b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_faultpolygons.py @@ -3,8 +3,9 @@ import logging from pathlib import Path -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as utils logger = logging.getLogger(__name__) diff --git a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_propmaps.py b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_propmaps.py index 0307423aa..1318a5f17 100644 --- a/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_propmaps.py +++ b/examples/s/d/nn/xcase/realization-0/iter-0/rms/bin/export_propmaps.py @@ -14,8 +14,9 @@ import logging from pathlib import Path -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as ut logger = logging.getLogger(__name__) diff --git a/examples/s/d/nn/xcase/realization-1/iter-0/rms/bin/export_a_surface.py b/examples/s/d/nn/xcase/realization-1/iter-0/rms/bin/export_a_surface.py index 466a7e4d9..38ec91c33 100644 --- a/examples/s/d/nn/xcase/realization-1/iter-0/rms/bin/export_a_surface.py +++ b/examples/s/d/nn/xcase/realization-1/iter-0/rms/bin/export_a_surface.py @@ -8,8 +8,9 @@ import logging from pathlib import Path -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as ut logger = logging.getLogger(__name__) diff --git a/examples/s/d/nn/xcase/realization-9/iter-0/rms/bin/export_a_surface.py b/examples/s/d/nn/xcase/realization-9/iter-0/rms/bin/export_a_surface.py index 466a7e4d9..38ec91c33 100644 --- a/examples/s/d/nn/xcase/realization-9/iter-0/rms/bin/export_a_surface.py +++ b/examples/s/d/nn/xcase/realization-9/iter-0/rms/bin/export_a_surface.py @@ -8,8 +8,9 @@ import logging from pathlib import Path -import fmu.dataio as dataio import xtgeo + +import fmu.dataio as dataio from fmu.config import utilities as ut logger = logging.getLogger(__name__) diff --git a/tests/conftest.py b/tests/conftest.py index 6f604bb27..0dc0096bd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,12 +7,13 @@ import shutil from pathlib import Path -import fmu.dataio as dio import numpy as np import pandas as pd import pytest import xtgeo import yaml + +import fmu.dataio as dio from fmu.config import utilities as ut from fmu.dataio._model import fields, global_configuration from fmu.dataio.dataio import ExportData, read_metadata diff --git a/tests/test_export_rms/test_export_rms_volumetrics.py b/tests/test_export_rms/test_export_rms_volumetrics.py index 0d8f9535c..20fd40746 100644 --- a/tests/test_export_rms/test_export_rms_volumetrics.py +++ b/tests/test_export_rms/test_export_rms_volumetrics.py @@ -3,11 +3,11 @@ import os from pathlib import Path -import fmu.dataio as dataio import pandas as pd import pytest -from fmu.dataio._logging import null_logger +import fmu.dataio as dataio +from fmu.dataio._logging import null_logger from tests.utils import inside_rms logger = null_logger(__name__) diff --git a/tests/test_integration/test_hook_implementations.py b/tests/test_integration/test_hook_implementations.py index 64a3625da..1c5283c5e 100644 --- a/tests/test_integration/test_hook_implementations.py +++ b/tests/test_integration/test_hook_implementations.py @@ -1,7 +1,8 @@ import os -import fmu.dataio.hook_implementations.jobs from ert.shared.plugins.plugin_manager import ErtPluginManager + +import fmu.dataio.hook_implementations.jobs from fmu.dataio.scripts import copy_preprocessed, create_case_metadata diff --git a/tests/test_integration/test_wf_copy_preprocessed_data.py b/tests/test_integration/test_wf_copy_preprocessed_data.py index 75fa323d3..5f9b48719 100644 --- a/tests/test_integration/test_wf_copy_preprocessed_data.py +++ b/tests/test_integration/test_wf_copy_preprocessed_data.py @@ -1,8 +1,9 @@ import ert.__main__ -import fmu.dataio as dataio import pytest import yaml +import fmu.dataio as dataio + def _export_preprocessed_data(config, regsurf): """Export preprocessed surfaces""" diff --git a/tests/test_schema/test_pydantic_logic.py b/tests/test_schema/test_pydantic_logic.py index c729da5c4..af6d6894b 100644 --- a/tests/test_schema/test_pydantic_logic.py +++ b/tests/test_schema/test_pydantic_logic.py @@ -4,9 +4,10 @@ from copy import deepcopy import pytest -from fmu.dataio._model import Root, data from pydantic import ValidationError +from fmu.dataio._model import Root, data + from ..utils import _metadata_examples # pylint: disable=no-member diff --git a/tests/test_units/test_aggregated_surfaces.py b/tests/test_units/test_aggregated_surfaces.py index 584a31c75..81c6ac203 100644 --- a/tests/test_units/test_aggregated_surfaces.py +++ b/tests/test_units/test_aggregated_surfaces.py @@ -3,11 +3,12 @@ import logging import os -import fmu.dataio._utils as utils -import fmu.dataio.dataio as dataio import pytest import xtgeo +import fmu.dataio._utils as utils +import fmu.dataio.dataio as dataio + logger = logging.getLogger(__name__) diff --git a/tests/test_units/test_contents.py b/tests/test_units/test_contents.py index 611cb085f..2d8de6437 100644 --- a/tests/test_units/test_contents.py +++ b/tests/test_units/test_contents.py @@ -1,9 +1,10 @@ """Explicitly test all allowed contents.""" import pytest -from fmu.dataio.dataio import ExportData from pydantic import ValidationError +from fmu.dataio.dataio import ExportData + # generic testing of functionality related to content is done elsewhere, # mainly in test_dataio.py. diff --git a/tests/test_units/test_dataio.py b/tests/test_units/test_dataio.py index c77c3ac2e..75b71e13b 100644 --- a/tests/test_units/test_dataio.py +++ b/tests/test_units/test_dataio.py @@ -10,6 +10,7 @@ import pydantic import pytest import yaml + from fmu.dataio._model.enums import FMUContext from fmu.dataio._utils import prettyprint_dict from fmu.dataio.dataio import ExportData, read_metadata diff --git a/tests/test_units/test_dictionary.py b/tests/test_units/test_dictionary.py index a5e57c957..a4e8a7c1d 100644 --- a/tests/test_units/test_dictionary.py +++ b/tests/test_units/test_dictionary.py @@ -7,6 +7,7 @@ import pytest import yaml + from fmu.dataio import ExportData from fmu.dataio._utils import nested_parameters_dict, read_parameters_txt diff --git a/tests/test_units/test_ert_context.py b/tests/test_units/test_ert_context.py index 6d4bef83e..cc39d2698 100644 --- a/tests/test_units/test_ert_context.py +++ b/tests/test_units/test_ert_context.py @@ -10,10 +10,11 @@ import sys from pathlib import Path -import fmu.dataio.dataio as dataio import pandas as pd import pytest import yaml + +import fmu.dataio.dataio as dataio from fmu.dataio._utils import prettyprint_dict logger = logging.getLogger(__name__) diff --git a/tests/test_units/test_filedataprovider_class.py b/tests/test_units/test_filedataprovider_class.py index b882beddd..99e7a3d7a 100644 --- a/tests/test_units/test_filedataprovider_class.py +++ b/tests/test_units/test_filedataprovider_class.py @@ -6,6 +6,7 @@ from pathlib import Path import pytest + from fmu.dataio import ExportData from fmu.dataio._definitions import ExportFolder from fmu.dataio._model import fields diff --git a/tests/test_units/test_fmuprovider_class.py b/tests/test_units/test_fmuprovider_class.py index e429132bb..635287706 100644 --- a/tests/test_units/test_fmuprovider_class.py +++ b/tests/test_units/test_fmuprovider_class.py @@ -3,10 +3,11 @@ import logging import os -import fmu.dataio as dataio import pydantic import pytest +import fmu.dataio as dataio + # from conftest import pretend_ert_env_run1 from fmu.dataio._model.enums import FMUContext from fmu.dataio.exceptions import InvalidMetadataError diff --git a/tests/test_units/test_global_configuration.py b/tests/test_units/test_global_configuration.py index f58945ab5..f1e2daaf9 100644 --- a/tests/test_units/test_global_configuration.py +++ b/tests/test_units/test_global_configuration.py @@ -1,7 +1,8 @@ import pytest -from fmu.dataio._model import global_configuration from hypothesis import given, strategies +from fmu.dataio._model import global_configuration + @given( name=strategies.text(min_size=1), diff --git a/tests/test_units/test_initialize_case.py b/tests/test_units/test_initialize_case.py index 784a8929a..93302f795 100644 --- a/tests/test_units/test_initialize_case.py +++ b/tests/test_units/test_initialize_case.py @@ -10,9 +10,10 @@ import pytest import yaml -from fmu.dataio import CreateCaseMetadata from pydantic import ValidationError +from fmu.dataio import CreateCaseMetadata + logger = logging.getLogger(__name__) diff --git a/tests/test_units/test_metadata_class.py b/tests/test_units/test_metadata_class.py index 9827495c6..8a310dd51 100644 --- a/tests/test_units/test_metadata_class.py +++ b/tests/test_units/test_metadata_class.py @@ -3,8 +3,9 @@ import logging from copy import deepcopy -import fmu.dataio as dio import pytest + +import fmu.dataio as dio from fmu.dataio._metadata import ( SCHEMA, SOURCE, diff --git a/tests/test_units/test_objectdataprovider_class.py b/tests/test_units/test_objectdataprovider_class.py index 403fba907..17db71d2c 100644 --- a/tests/test_units/test_objectdataprovider_class.py +++ b/tests/test_units/test_objectdataprovider_class.py @@ -3,9 +3,10 @@ import os from pathlib import Path -import fmu.dataio as dataio import pytest import yaml + +import fmu.dataio as dataio from fmu.dataio._definitions import ConfigurationError, ValidFormats from fmu.dataio.providers.objectdata._provider import ( objectdata_provider_factory, diff --git a/tests/test_units/test_preprocessed.py b/tests/test_units/test_preprocessed.py index 3e2f34984..114b09978 100644 --- a/tests/test_units/test_preprocessed.py +++ b/tests/test_units/test_preprocessed.py @@ -3,9 +3,10 @@ import logging from pathlib import Path -import fmu.dataio as dataio import pytest import yaml + +import fmu.dataio as dataio from fmu.dataio import _utils as utils from fmu.dataio.exceptions import InvalidMetadataError from fmu.dataio.providers._fmu import ERT_RELATIVE_CASE_METADATA_FILE diff --git a/tests/test_units/test_prerealization_surfaces.py b/tests/test_units/test_prerealization_surfaces.py index a7842d0a7..3d0324a8d 100644 --- a/tests/test_units/test_prerealization_surfaces.py +++ b/tests/test_units/test_prerealization_surfaces.py @@ -13,8 +13,9 @@ import logging import os -import fmu.dataio as dataio import pytest + +import fmu.dataio as dataio from fmu.dataio import _utils as utils from ..conftest import remove_ert_env, set_ert_env_prehook diff --git a/tests/test_units/test_readers.py b/tests/test_units/test_readers.py index 15af38bcb..801b52f38 100644 --- a/tests/test_units/test_readers.py +++ b/tests/test_units/test_readers.py @@ -1,6 +1,7 @@ """Test the readers module""" import pytest + from fmu.dataio import readers diff --git a/tests/test_units/test_rms_context.py b/tests/test_units/test_rms_context.py index 114a6dbe4..045cd176e 100644 --- a/tests/test_units/test_rms_context.py +++ b/tests/test_units/test_rms_context.py @@ -9,11 +9,12 @@ import shutil from pathlib import Path -import fmu.dataio.dataio as dataio -import fmu.dataio.readers as readers import pandas as pd import pytest import yaml + +import fmu.dataio.dataio as dataio +import fmu.dataio.readers as readers from fmu.dataio._utils import prettyprint_dict from fmu.dataio.dataio import ValidationError diff --git a/tests/test_units/test_table.py b/tests/test_units/test_table.py index 50cf33e7a..2a63a1862 100644 --- a/tests/test_units/test_table.py +++ b/tests/test_units/test_table.py @@ -3,6 +3,7 @@ from pathlib import Path import pytest + from fmu.config.utilities import yaml_load from fmu.dataio import ExportData from fmu.dataio.providers.objectdata._provider import objectdata_provider_factory diff --git a/tests/test_units/test_utils.py b/tests/test_units/test_utils.py index a17bf9540..1b24ef9cd 100644 --- a/tests/test_units/test_utils.py +++ b/tests/test_units/test_utils.py @@ -6,9 +6,10 @@ import numpy as np import pytest -from fmu.dataio import _utils as utils from xtgeo import Grid, Polygons, RegularSurface +from fmu.dataio import _utils as utils + from ..utils import inside_rms diff --git a/tools/schema-validate.py b/tools/schema-validate.py index a6cc81818..6813baa9c 100644 --- a/tools/schema-validate.py +++ b/tools/schema-validate.py @@ -3,10 +3,11 @@ import sys -from fmu.dataio._model import Root from orjson import dumps from yaml import safe_load +from fmu.dataio._model import Root + def read(file): with open(file) as f: diff --git a/tools/sumo-explorer-validate.py b/tools/sumo-explorer-validate.py index 993be3850..d362b279f 100644 --- a/tools/sumo-explorer-validate.py +++ b/tools/sumo-explorer-validate.py @@ -10,11 +10,12 @@ from pprint import pformat import pytz -from fmu.dataio._model import Root -from fmu.sumo.explorer import Explorer from pydantic import ValidationError from tqdm import tqdm +from fmu.dataio._model import Root +from fmu.sumo.explorer import Explorer + async def get( explorer: Explorer,