Skip to content

Commit 1529214

Browse files
committed
renamed the LArray class as Array -> deprecated LArray class
1 parent 4a856a3 commit 1529214

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

larray/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
from larray.core.axis import x
9595
from larray.core.group import PGroup
96-
from larray.core.array import (create_sequential, ndrange, larray_equal, larray_nan_equal,
96+
from larray.core.array import (LArray, create_sequential, ndrange, larray_equal, larray_nan_equal,
9797
nan_equal, element_equal)
9898

9999

@@ -103,7 +103,9 @@
103103
# group
104104
'PGroup',
105105
# array
106-
'create_sequential', 'ndrange', 'larray_equal', 'larray_nan_equal', 'nan_equal', 'element_equal',
106+
'LArray',
107+
'create_sequential', 'ndrange',
108+
'larray_equal', 'larray_nan_equal', 'nan_equal', 'element_equal',
107109
]
108110

109111
__all__ += _deprecated

larray/core/array.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8028,6 +8028,9 @@ def transform(v):
80288028
return self.apply(transform, dtype=dtype)
80298029

80308030

8031+
LArray = renamed_to(Array, 'LArray')
8032+
8033+
80318034
def larray_equal(a1, a2):
80328035
import warnings
80338036
msg = "larray_equal() is deprecated. Use Array.equals() instead."

larray/tests/test_array.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from larray.tests.common import (inputpath, assert_array_equal, assert_array_nan_equal, assert_larray_equiv,
1919
tmp_path, meta, needs_xlwings, needs_python35, needs_python36, needs_python37,
2020
assert_larray_equal)
21-
from larray import (Array, Axis, LGroup, union, zeros, zeros_like, ndtest, empty, ones, eye, diag, stack,
21+
from larray import (Array, LArray, Axis, LGroup, union, zeros, zeros_like, ndtest, empty, ones, eye, diag, stack,
2222
clip, exp, where, X, mean, isnan, round, read_hdf, read_csv, read_eurostat, read_excel,
2323
from_lists, from_string, open_excel, from_frame, sequence, nan, IGroup)
2424
from larray.inout.pandas import from_series
@@ -182,6 +182,14 @@ def small_array():
182182
io_narrow_missing_values[2, 'b1', 'c1'] = nan
183183

184184

185+
def test_larray_renamed_as_array():
186+
with pytest.warns(FutureWarning) as caught_warnings:
187+
arr = LArray([0, 1, 2, 3], 'a=a0..a3')
188+
assert len(caught_warnings) == 1
189+
assert caught_warnings[0].message.args[0] == "LArray() is deprecated. Use Array() instead."
190+
assert caught_warnings[0].filename == __file__
191+
192+
185193
def test_ndtest():
186194
arr = ndtest('a=a0..a2')
187195
assert arr.shape == (3,)

0 commit comments

Comments
 (0)