Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: Move providers to providers subpackage #546

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions src/fmu/dataio/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,26 @@

from pydantic import AnyHttpUrl, TypeAdapter

from fmu import dataio
from fmu.dataio._definitions import SCHEMA, SOURCE, VERSION
from fmu.dataio._filedata_provider import FileDataProvider
from fmu.dataio._fmu_provider import FmuProvider
from fmu.dataio._utils import (
from . import types
from ._definitions import SCHEMA, SOURCE, VERSION, FmuContext
from ._logging import null_logger
from ._utils import (
drop_nones,
export_file_compute_checksum_md5,
glue_metadata_preprocessed,
read_metadata_from_file,
)
from fmu.dataio.datastructure._internal import internal
from fmu.dataio.datastructure.configuration import global_configuration
from fmu.dataio.datastructure.meta import meta
from fmu.dataio.providers._objectdata import objectdata_provider_factory

from . import types
from ._definitions import FmuContext
from ._logging import null_logger
from .datastructure._internal import internal
from .datastructure.configuration import global_configuration
from .datastructure.meta import meta
from .providers._filedata import FileDataProvider
from .providers._fmu import FmuProvider
from .providers._objectdata import objectdata_provider_factory
from .version import __version__

if TYPE_CHECKING:
from fmu.dataio.providers._objectdata_base import ObjectDataProvider
from .dataio import ExportData
from .providers._objectdata_base import ObjectDataProvider

logger: Final = null_logger(__name__)

Expand All @@ -65,9 +64,7 @@ def generate_meta_tracklog() -> list[meta.TracklogEvent]:
event="created",
user=meta.User.model_construct(id=getpass.getuser()),
sysinfo=meta.SystemInformation.model_construct(
fmu_dataio=meta.VersionInformation.model_construct(
version=dataio.__version__,
),
fmu_dataio=meta.VersionInformation.model_construct(version=__version__),
komodo=meta.VersionInformation.model_construct(version=kr)
if (kr := os.environ.get("KOMODO_RELEASE"))
else None,
Expand Down Expand Up @@ -113,7 +110,7 @@ class MetaData:

# input variables
obj: types.Inferrable
dataio: dataio.ExportData
dataio: ExportData
compute_md5: bool = True

# storage state variables
Expand Down
2 changes: 1 addition & 1 deletion src/fmu/dataio/dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
FmuContext,
ValidationError,
)
from ._fmu_provider import FmuEnv
from ._logging import null_logger
from ._utils import (
create_symlink,
Expand All @@ -38,6 +37,7 @@
AllowedContent,
)
from .datastructure.configuration import global_configuration
from .providers._fmu import FmuEnv

# DATAIO_EXAMPLES: Final = dataio_examples()
INSIDE_RMS: Final = detect_inside_rms()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from typing import TYPE_CHECKING, Final, Optional
from warnings import warn

from ._definitions import FmuContext
from ._logging import null_logger
from fmu.dataio._definitions import FmuContext
from fmu.dataio._logging import null_logger

logger: Final = null_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
from warnings import warn

from fmu.config import utilities as ut

from . import _utils
from ._definitions import FmuContext
from ._logging import null_logger
from fmu.dataio import _utils
from fmu.dataio._definitions import FmuContext
from fmu.dataio._logging import null_logger

# case metadata relative to casepath
ERT_RELATIVE_CASE_METADATA_FILE: Final = "share/metadata/fmu_case.yml"
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import xtgeo
import yaml
from fmu.config import utilities as ut
from fmu.dataio._fmu_provider import FmuEnv
from fmu.dataio.dataio import ExportData, read_metadata
from fmu.dataio.datastructure.configuration import global_configuration
from fmu.dataio.providers._fmu import FmuEnv

from .utils import _metadata_examples

Expand Down
2 changes: 1 addition & 1 deletion tests/test_units/test_dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import pytest
import yaml
from fmu.dataio._definitions import FmuContext
from fmu.dataio._fmu_provider import FmuEnv
from fmu.dataio._utils import prettyprint_dict
from fmu.dataio.dataio import ExportData, ValidationError, read_metadata
from fmu.dataio.providers._fmu import FmuEnv

# pylint: disable=no-member

Expand Down
2 changes: 1 addition & 1 deletion tests/test_units/test_filedataprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pytest
from fmu.dataio import ExportData
from fmu.dataio._filedata_provider import FileDataProvider
from fmu.dataio.providers._filedata import FileDataProvider
from fmu.dataio.providers._objectdata import objectdata_provider_factory
from fmu.dataio.providers._objectdata_base import derive_name
from xtgeo.cube import Cube
Expand Down
2 changes: 1 addition & 1 deletion tests/test_units/test_fmuprovider_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# from conftest import pretend_ert_env_run1
from fmu.dataio._definitions import FmuContext
from fmu.dataio._fmu_provider import RESTART_PATH_ENVNAME, FmuEnv, FmuProvider
from fmu.dataio.providers._fmu import RESTART_PATH_ENVNAME, FmuEnv, FmuProvider

logger = logging.getLogger(__name__)

Expand Down
Loading