Skip to content

Commit

Permalink
Increase similarity to old version
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Nov 7, 2024
1 parent 6edc0b3 commit 0598875
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/instamatic/TEMController/TEMController.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

from instamatic.controller import TEMController
from instamatic.controller import TEMController, get_instance, initialize
14 changes: 3 additions & 11 deletions src/instamatic/TEMController/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@

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',
VisibleDeprecationWarning,
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
10 changes: 10 additions & 0 deletions src/instamatic/TEMController/microscope.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0598875

Please sign in to comment.