refactor: Use cleaner relative import for top-level `utils`

main
Sofus Albert Høgsbro Rose 2024-04-17 18:16:14 +02:00
parent c6e00dcd7b
commit 6a41683576
Signed by: so-rose
GPG Key ID: AD901CB0F3701434
56 changed files with 66 additions and 66 deletions

View File

@ -8,7 +8,7 @@ import bpy
import typing_extensions as typx
from .. import info
from ..utils import logger
from blender_maxwell.utils import logger
log = logger.get(__name__)

View File

@ -6,7 +6,7 @@ import typing as typ
import bpy
from ...utils import logger, serialize
from blender_maxwell.utils import logger, serialize
log = logger.get(__name__)

View File

@ -11,8 +11,8 @@ import typing as typ
import bpy
import sympy as sp
from ...utils import extra_sympy_units as spux
from ...utils import logger as _logger
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger as _logger
from . import contracts as ct
from . import sockets

View File

@ -1,6 +1,6 @@
import enum
from ....utils.blender_type_enum import BlenderTypeEnum, wrap_values_in_MT
from blender_maxwell.utils.blender_type_enum import BlenderTypeEnum, wrap_values_in_MT
@wrap_values_in_MT

View File

@ -11,7 +11,7 @@ import sympy as sp
import sympy.physics.units as spu
import typing_extensions as typx
from ....utils import extra_sympy_units as spux
from blender_maxwell.utils import extra_sympy_units as spux
from .socket_types import SocketType

View File

@ -1,4 +1,4 @@
from ....utils.blender_type_enum import BlenderTypeEnum
from blender_maxwell.utils.blender_type_enum import BlenderTypeEnum
class Icon(BlenderTypeEnum):

View File

@ -1,6 +1,6 @@
import enum
from ....utils.blender_type_enum import (
from blender_maxwell.utils.blender_type_enum import (
BlenderTypeEnum,
append_cls_name_to_values,
)

View File

@ -1,6 +1,6 @@
import enum
from ....utils.blender_type_enum import (
from blender_maxwell.utils.blender_type_enum import (
BlenderTypeEnum,
append_cls_name_to_values,
)

View File

@ -1,6 +1,6 @@
import sympy.physics.units as spu
from ....utils import extra_sympy_units as spux
from blender_maxwell.utils import extra_sympy_units as spux
from .socket_types import SocketType as ST # noqa: N817
SOCKET_UNITS = {

View File

@ -1,6 +1,6 @@
import enum
from ....utils.blender_type_enum import (
from blender_maxwell.utils.blender_type_enum import (
BlenderTypeEnum,
append_cls_name_to_values,
)

View File

@ -2,8 +2,8 @@ import typing as typ
import sympy.physics.units as spu
from ....utils import extra_sympy_units as spux
from ....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from .socket_types import SocketType as ST # noqa: N817
from .socket_units import SOCKET_UNITS

View File

@ -1,7 +1,7 @@
import bpy
from ....utils import logger
from blender_maxwell.utils import logger
log = logger.get(__name__)

View File

@ -9,7 +9,7 @@ import matplotlib.axis as mpl_ax
import numpy as np
import typing_extensions as typx
from ....utils import logger
from blender_maxwell.utils import logger
from .. import contracts as ct
from . import base

View File

@ -4,7 +4,7 @@ import bmesh
import bpy
import numpy as np
from ....utils import logger
from blender_maxwell.utils import logger
from .. import contracts as ct
from . import base
from .managed_bl_collection import managed_collection, preview_collection

View File

@ -5,7 +5,7 @@ import typing as typ
import bpy
import typing_extensions as typx
from ....utils import analyze_geonodes, logger
from blender_maxwell.utils import analyze_geonodes, logger
from .. import bl_socket_map
from .. import contracts as ct
from . import base

View File

@ -3,7 +3,7 @@ import typing as typ
import bpy
from ...utils import logger
from blender_maxwell.utils import logger
from . import contracts as ct
log = logger.get(__name__)

View File

@ -3,7 +3,7 @@ import typing as typ
import bpy
import jax.numpy as jnp
from .....utils import logger
from blender_maxwell.utils import logger
from ... import contracts as ct
from ... import managed_objs, sockets
from .. import base, events

View File

@ -3,7 +3,7 @@ import inspect
import typing as typ
from types import MappingProxyType
from ....utils import logger
from blender_maxwell.utils import logger
from .. import contracts as ct
log = logger.get(__name__)

View File

@ -2,7 +2,7 @@ import typing as typ
import bpy
from ......utils import sci_constants as constants
from blender_maxwell.utils import sci_constants as constants
from .... import contracts as ct
from .... import sockets
from ... import base, events

View File

@ -5,7 +5,7 @@ import bpy
import tidy3d as td
import tidy3d.plugins.dispersion as td_dispersion
from ......utils import logger
from blender_maxwell.utils import logger
from .... import contracts as ct
from .... import managed_objs, sockets
from ... import base, events

View File

@ -4,9 +4,9 @@ import bpy
import sympy as sp
import sympy.physics.units as spu
from .....utils import extra_sympy_units as spux
from .....utils import logger
from .....utils import sci_constants as constants
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger
from blender_maxwell.utils import sci_constants as constants
from ... import contracts as ct
from ... import sockets
from .. import base, events

View File

@ -3,7 +3,7 @@ from pathlib import Path
from ...... import info
from ......services import tdcloud
from ......utils import logger
from blender_maxwell.utils import logger
from .... import contracts as ct
from .... import sockets
from ... import base, events

View File

@ -6,7 +6,7 @@ import sympy as sp
import sympy.physics.units as spu
import tidy3d as td
from .....utils import extra_sympy_units as spuex
from blender_maxwell.utils import extra_sympy_units as spuex
from ... import contracts as ct
from ... import managed_objs, sockets
from .. import base, events

View File

@ -4,8 +4,8 @@ import sympy as sp
import tidy3d as td
from .....assets.import_geonodes import GeoNodes, import_geonodes
from .....utils import extra_sympy_units as spux
from .....utils import logger
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger
from ... import contracts as ct
from ... import managed_objs, sockets
from .. import base, events

View File

@ -4,8 +4,8 @@ import sympy as sp
import tidy3d as td
from .....assets.import_geonodes import GeoNodes, import_geonodes
from .....utils import extra_sympy_units as spux
from .....utils import logger
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger
from ... import contracts as ct
from ... import managed_objs, sockets
from .. import base, events

View File

@ -3,7 +3,7 @@ import typing as typ
import bpy
import sympy as sp
from .....utils import logger
from blender_maxwell.utils import logger
from ... import contracts as ct
from ... import sockets
from .. import base, events

View File

@ -5,7 +5,7 @@ import numpy as np
import sympy.physics.units as spu
import tidy3d as td
from ......utils import extra_sympy_units as spuex
from blender_maxwell.utils import extra_sympy_units as spuex
from .... import contracts as ct
from .... import managed_objs, sockets
from ... import base, events

View File

@ -2,7 +2,7 @@ import typing as typ
import tidy3d as td
from .....utils import analyze_geonodes, logger
from blender_maxwell.utils import analyze_geonodes, logger
from ... import bl_socket_map, managed_objs, sockets
from ... import contracts as ct
from .. import base, events

View File

@ -1,4 +1,4 @@
from ....utils import logger
from blender_maxwell.utils import logger
from .. import contracts as ct
from . import basic, blender, maxwell, number, physical, tidy3d, vector
from .scan_socket_defs import scan_for_socket_defs

View File

@ -7,7 +7,7 @@ import pydantic as pyd
import sympy as sp
import typing_extensions as typx
from ....utils import logger, serialize
from blender_maxwell.utils import logger, serialize
from .. import contracts as ct
log = logger.get(__name__)

View File

@ -3,7 +3,7 @@ import scipy as sc
import sympy.physics.units as spu
import tidy3d as td
from .....utils.pydantic_sympy import ConstrSympyExpr
from blender_maxwell.utils.pydantic_sympy import ConstrSympyExpr
from ... import contracts as ct
from .. import base

View File

@ -3,7 +3,7 @@ import typing as typ
import bpy
import sympy as sp
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy as sp
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,6 +1,6 @@
import bpy
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,9 +1,9 @@
import bpy
import sympy as sp
from .....utils import extra_sympy_units as spux
from .....utils import logger
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -2,9 +2,9 @@ import bpy
import sympy as sp
import sympy.physics.units as spu
from .....utils import extra_sympy_units as spux
from .....utils import logger
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils import extra_sympy_units as spux
from blender_maxwell.utils import logger
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -4,7 +4,7 @@ import bpy
import sympy as sp
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -3,7 +3,7 @@ import sympy as sp
import sympy.physics.optics.polarization as spo_pol
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -2,7 +2,7 @@ import bpy
import sympy as sp
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -3,7 +3,7 @@ import typing as typ
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,6 +1,6 @@
import bpy
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy.physics.units as spu
from .....utils.pydantic_sympy import SympyExpr
from blender_maxwell.utils.pydantic_sympy import SympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy as sp
from .....utils.pydantic_sympy import ConstrSympyExpr
from blender_maxwell.utils.pydantic_sympy import ConstrSympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy as sp
from .....utils.pydantic_sympy import ConstrSympyExpr
from blender_maxwell.utils.pydantic_sympy import ConstrSympyExpr
from ... import contracts as ct
from .. import base

View File

@ -1,7 +1,7 @@
import bpy
import sympy as sp
from .....utils.pydantic_sympy import ConstrSympyExpr
from blender_maxwell.utils.pydantic_sympy import ConstrSympyExpr
from ... import contracts as ct
from .. import base

View File

@ -5,7 +5,7 @@ from pathlib import Path
import bpy
from ... import registration
from ..utils import pydeps, simple_logger
from blender_maxwell.utils import pydeps, simple_logger
log = simple_logger.get(__name__)

View File

@ -5,7 +5,7 @@ from pathlib import Path
import bpy
from .. import registration
from ..utils import logger as _logger
from blender_maxwell.utils import logger as _logger
log = _logger.get(__name__)

View File

@ -3,7 +3,7 @@ from pathlib import Path
import bpy
from ..utils import pydeps
from blender_maxwell.utils import pydeps
class UninstallPyDeps(bpy.types.Operator):

View File

@ -1,6 +1,6 @@
import bpy
from ..utils import logger as logger
from blender_maxwell.utils import logger as logger
log = logger.get(__name__)

View File

@ -127,7 +127,7 @@ class BLMaxwellAddonPrefs(bpy.types.AddonPreferences):
if pydeps.DEPS_OK:
log.info('Getting Logger (DEPS_OK = %s)', str(pydeps.DEPS_OK))
with pydeps.importable_addon_deps(self.pydeps_path):
from .utils import logger
from blender_maxwell.utils import logger
else:
log.info('Getting Simple Logger (DEPS_OK = %s)', str(pydeps.DEPS_OK))
logger = simple_logger

View File

@ -14,7 +14,7 @@ from pathlib import Path
import tidy3d as td
import tidy3d.web as td_web
from ..utils import logger
from blender_maxwell.utils import logger
log = logger.get(__name__)