File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44"""Backward-compatible import location for BEER McStas helpers."""
55
6+ import warnings
7+
68from . import mcstas as _mcstas
79from .mcstas import * # noqa: F403
810from .mcstas import __all__ # noqa: F401
911
12+ warnings .warn (
13+ "ess.beer.io is deprecated; use ess.beer.mcstas instead." ,
14+ DeprecationWarning ,
15+ stacklevel = 2 ,
16+ )
17+
1018
1119def __getattr__ (name : str ):
1220 """Return attributes from the replacement :mod:`ess.beer.mcstas` module."""
Original file line number Diff line number Diff line change 1+ import importlib
2+ import sys
3+
14import numpy as np
25import pytest
36import scipp as sc
@@ -162,9 +165,12 @@ def test_can_load_monitor():
162165
163166
164167def test_io_module_reexports_mcstas_loaders ():
165- from ess .beer .io import load_beer_mcstas as load_beer_mcstas_from_io
168+ sys .modules .pop ('ess.beer.io' , None )
169+
170+ with pytest .warns (DeprecationWarning , match = 'ess.beer.io' ):
171+ io = importlib .import_module ('ess.beer.io' )
166172
167- assert load_beer_mcstas_from_io is load_beer_mcstas
173+ assert io . load_beer_mcstas is load_beer_mcstas
168174
169175
170176@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments