Skip to content

Commit

Permalink
STY: Update to latest ruff (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnatt authored Aug 21, 2024
1 parent 66e9683 commit b12447b
Show file tree
Hide file tree
Showing 32 changed files with 63 additions and 32 deletions.
5 changes: 3 additions & 2 deletions examples/s/d/nn/_project/aggregate_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_export_rms/test_export_rms_volumetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration/test_hook_implementations.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration/test_wf_copy_preprocessed_data.py
Original file line number Diff line number Diff line change
@@ -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"""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_schema/test_pydantic_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/test_units/test_aggregated_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_contents.py
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import pytest
import yaml

from fmu.dataio import ExportData
from fmu.dataio._utils import nested_parameters_dict, read_parameters_txt

Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_ert_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_filedataprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_fmuprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_global_configuration.py
Original file line number Diff line number Diff line change
@@ -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),
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_initialize_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_metadata_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_objectdataprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_preprocessed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_prerealization_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_readers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test the readers module"""

import pytest

from fmu.dataio import readers


Expand Down
5 changes: 3 additions & 2 deletions tests/test_units/test_rms_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/test_units/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_units/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion tools/schema-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions tools/sumo-explorer-validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b12447b

Please sign in to comment.