Skip to content

Commit 7734ed2

Browse files
authored
Merge pull request #588 from scipp/remote-attrs
Remove uses of attrs and meta and remove deprecated Mantid functions
2 parents cb602e1 + 80ae9f1 commit 7734ed2

File tree

8 files changed

+33
-792
lines changed

8 files changed

+33
-792
lines changed

docs/api-reference/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
:toctree: ../generated/functions
1212
:recursive:
1313
14-
array_from_mantid
1514
from_mantid
1615
load_with_mantid
1716
to_mantid

src/scippneutron/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@
3333
from .core import convert
3434
from .mantid import (
3535
from_mantid,
36-
array_from_mantid,
3736
to_mantid,
3837
load_with_mantid,
39-
load,
4038
fit,
4139
)
4240
from .instrument_view import instrument_view
@@ -59,11 +57,9 @@
5957
"two_theta",
6058
"convert",
6159
"from_mantid",
62-
"array_from_mantid",
6360
"to_mantid",
6461
"io",
6562
"load_with_mantid",
66-
"load",
6763
"fit",
6864
"instrument_view",
6965
"atoms",

src/scippneutron/_utils/__init__.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
Internal utilities; do not use outside scippneutron!
66
"""
77

8-
from collections.abc import MutableMapping
9-
108
import scipp as sc
119
from scipp.typing import VariableLike
1210

@@ -28,29 +26,3 @@ def float_dtype(var: VariableLike) -> sc.DType:
2826

2927
def as_float_type(var: VariableLike, ref: VariableLike) -> VariableLike:
3028
return var.astype(float_dtype(ref), copy=False)
31-
32-
33-
def get_attrs(da: sc.DataArray) -> MutableMapping[str, sc.Variable]:
34-
try:
35-
# During deprecation phase
36-
return da.deprecated_attrs
37-
except AttributeError:
38-
try:
39-
# Before deprecation phase
40-
return da.attrs
41-
except AttributeError:
42-
# After deprecation phase / removal of attrs
43-
return da.coords
44-
45-
46-
def get_meta(da: sc.DataArray) -> MutableMapping[str, sc.Variable]:
47-
try:
48-
# During deprecation phase
49-
return da.deprecated_meta
50-
except AttributeError:
51-
try:
52-
# Before deprecation phase
53-
return da.meta
54-
except AttributeError:
55-
# After deprecation phase / removal of attrs
56-
return da.coords

src/scippneutron/instrument_view.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import scipp as sc
77
from scipy.spatial.transform import Rotation as Rot
88

9-
from ._utils import get_meta
10-
119
try:
1210
import pythreejs as p3
1311
except ImportError as ex:
@@ -274,7 +272,7 @@ def instrument_view(
274272

275273
import plopp as pp
276274

277-
positions_var = get_meta(scipp_obj)[positions]
275+
positions_var = scipp_obj.coords[positions]
278276
if pixel_size is None:
279277
pos_array = positions_var.values
280278
if len(pos_array) > 1:

0 commit comments

Comments
 (0)