From 7001086430d9616ede53e6b8ccc9681676ea518b Mon Sep 17 00:00:00 2001 From: Sam Vente Date: Tue, 25 Jul 2023 10:34:11 +0200 Subject: [PATCH] reorder __init__ to fix circular import --- hydromt/__init__.py | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/hydromt/__init__.py b/hydromt/__init__.py index e8b2117dc..dffa19a07 100644 --- a/hydromt/__init__.py +++ b/hydromt/__init__.py @@ -4,28 +4,9 @@ # Set environment variables (this will be temporary) # to use shapely 2.0 in favor of pygeos (if installed) import os - -os.environ["USE_PYGEOS"] = "0" - -# pkg_resource deprication warnings originate from dependencies -# so silence them for now -import warnings - -warnings.filterwarnings("ignore", category=DeprecationWarning) - - -# required for accessor style documentation from subprocess import run -from xarray import DataArray, Dataset - -# submodules -from . import cli, flw, raster, stats, vector, workflows -from .data_catalog import * -from .io import * - -# high-level methods -from .models import * +os.environ["USE_PYGEOS"] = "0" def _run_clean(s: str) -> str: @@ -52,3 +33,21 @@ def _run_clean(s: str) -> str: __version__ = f"{base_version}.dev{num_commits_since_release}" except Exception: __version__ = base_version + +# pkg_resource deprication warnings originate from dependencies +# so silence them for now +import warnings + +warnings.filterwarnings("ignore", category=DeprecationWarning) + + +# required for accessor style documentation +from xarray import DataArray, Dataset + +# submodules +from . import cli, flw, raster, stats, vector, workflows +from .data_catalog import * +from .io import * + +# high-level methods +from .models import *