From 0598875cb30cd36b632ff1fe2d4ea08d7382936f Mon Sep 17 00:00:00 2001 From: Viljar Femoen Date: Thu, 7 Nov 2024 14:07:22 +0100 Subject: [PATCH] Increase similarity to old version --- src/instamatic/TEMController/TEMController.py | 2 +- src/instamatic/TEMController/__init__.py | 14 +++----------- src/instamatic/TEMController/microscope.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/instamatic/TEMController/TEMController.py b/src/instamatic/TEMController/TEMController.py index fc633455..316588a4 100644 --- a/src/instamatic/TEMController/TEMController.py +++ b/src/instamatic/TEMController/TEMController.py @@ -1,3 +1,3 @@ from __future__ import annotations -from instamatic.controller import TEMController +from instamatic.controller import TEMController, get_instance, initialize diff --git a/src/instamatic/TEMController/__init__.py b/src/instamatic/TEMController/__init__.py index 2bc4ea6f..b5d9cf4b 100644 --- a/src/instamatic/TEMController/__init__.py +++ b/src/instamatic/TEMController/__init__.py @@ -3,7 +3,7 @@ import warnings -from instamatic.utils.deprecated import VisibleDeprecationWarning, deprecated +from instamatic.utils.deprecated import VisibleDeprecationWarning warnings.warn( 'The `TEMController` module is deprecated since version 2.0.6. Use the `controller`-module instead', @@ -11,13 +11,5 @@ stacklevel=2, ) - -from instamatic.controller import get_instance, initialize -from instamatic.microscope.base import MicroscopeBase - - -@deprecated(since='2.0.6', alternative='instamatic.microscope.get_microscope') -def Microscope(name: str = None, use_server: bool = False) -> MicroscopeBase: - from instamatic.microscope import get_microscope - - return get_microscope(name=name, use_server=use_server) +from .microscope import Microscope +from .TEMController import get_instance, initialize diff --git a/src/instamatic/TEMController/microscope.py b/src/instamatic/TEMController/microscope.py index 5562732b..230dd7ce 100644 --- a/src/instamatic/TEMController/microscope.py +++ b/src/instamatic/TEMController/microscope.py @@ -1,10 +1,20 @@ from __future__ import annotations +from instamatic.microscope.base import MicroscopeBase from instamatic.utils.deprecated import deprecated +__all__ = ['Microscope', 'get_tem'] + @deprecated(since='2.0.6', alternative='instamatic.microscope.get_microscope_class') def get_tem(interface: str) -> 'type[MicroscopeBase]': from instamatic.microscope import get_microscope_class return get_microscope_class(interface=interface) + + +@deprecated(since='2.0.6', alternative='instamatic.microscope.get_microscope') +def Microscope(name: str = None, use_server: bool = False) -> MicroscopeBase: + from instamatic.microscope import get_microscope + + return get_microscope(name=name, use_server=use_server)