Skip to content

Commit 97f6a3f

Browse files
committed
ENH: Remove ma.full and ma.full_like
1 parent 57d33cf commit 97f6a3f

4 files changed

Lines changed: 4 additions & 55 deletions

File tree

‎doc/source/reference/routines.ma.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ Ones and zeros
4141

4242
ma.empty
4343
ma.empty_like
44-
ma.full
45-
ma.full_like
4644
ma.masked_all
4745
ma.masked_all_like
4846
ma.ones

‎numpy/ma/__init__.pyi‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ fmod: Any
7676
frombuffer: Any
7777
fromflex: Any
7878
fromfunction: Any
79-
full: Any
80-
full_like: Any
8179
getdata: Any
8280
getmask: Any
8381
getmaskarray: Any

‎numpy/ma/core.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
'diff', 'divide', 'empty', 'empty_like', 'equal', 'exp',
5757
'expand_dims', 'fabs', 'filled', 'fix_invalid', 'flatten_mask',
5858
'flatten_structured_array', 'floor', 'floor_divide', 'fmod',
59-
'frombuffer', 'fromflex', 'fromfunction', 'full', 'full_like', 'getdata',
60-
'getmask', 'getmaskarray', 'greater', 'greater_equal', 'harden_mask',
61-
'hypot', 'identity', 'ids', 'indices', 'inner', 'innerproduct', 'isMA',
59+
'frombuffer', 'fromflex', 'fromfunction', 'getdata', 'getmask',
60+
'getmaskarray', 'greater', 'greater_equal', 'harden_mask', 'hypot',
61+
'identity', 'ids', 'indices', 'inner', 'innerproduct', 'isMA',
6262
'isMaskedArray', 'is_mask', 'is_masked', 'isarray', 'left_shift',
6363
'less', 'less_equal', 'log', 'log10', 'log2',
6464
'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'make_mask',
@@ -8123,8 +8123,6 @@ def __call__(self, *args, **params):
81238123
empty_like = _convert2ma('empty_like')
81248124
frombuffer = _convert2ma('frombuffer')
81258125
fromfunction = _convert2ma('fromfunction')
8126-
full = _convert2ma('full', params=dict(fill_value=None, hardmask=False))
8127-
full_like = _convert2ma('full_like')
81288126
identity = _convert2ma(
81298127
'identity', params=dict(fill_value=None, hardmask=False))
81308128
indices = np.indices

‎numpy/ma/tests/test_core.py‎

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
arcsin, arctan, argsort, array, asarray, choose, concatenate,
3737
conjugate, cos, cosh, count, default_fill_value, diag, divide, doc_note,
3838
empty, empty_like, equal, exp, flatten_mask, filled, fix_invalid,
39-
flatten_structured_array, fromflex, full, full_like, getmask, getmaskarray, greater,
39+
flatten_structured_array, fromflex, getmask, getmaskarray, greater,
4040
greater_equal, identity, inner, isMaskedArray, less, less_equal, log,
4141
log10, make_mask, make_mask_descr, mask_or, masked, masked_array,
4242
masked_equal, masked_greater, masked_greater_equal, masked_inside,
@@ -3252,51 +3252,6 @@ def test_ones_like(self):
32523252
b = a.view(masked_array)
32533253
assert_(np.may_share_memory(a.mask, b.mask))
32543254

3255-
def test_full(self):
3256-
# Tests full
3257-
datatype = [('a', int), ('b', float), ('c', '|S8')]
3258-
a = masked_array([(1, 1.1, '1.1'), (2, 2.2, '2.2'), (3, 3.3, '3.3')],
3259-
dtype=datatype)
3260-
assert_equal(len(a.fill_value.item()), len(datatype))
3261-
3262-
b = full(len(a), 0, dtype=datatype)
3263-
assert_equal(b.shape, a.shape)
3264-
assert_equal(b.fill_value, a.fill_value)
3265-
assert_equal(b.data, array([(0, 0.0, b'0'), (0, 0.0, b'0'), (0, 0.0, b'0')],
3266-
dtype=datatype))
3267-
3268-
b = full(len(a), 1, dtype=datatype)
3269-
assert_equal(b.shape, a.shape)
3270-
assert_equal(b.fill_value, a.fill_value)
3271-
assert_equal(b.data, array([(1, 1.0, b'1'), (1, 1.0, b'1'), (1, 1.0, b'1')],
3272-
dtype=datatype))
3273-
3274-
def test_full_like(self):
3275-
# Tests full_like
3276-
datatype = [('a', int), ('b', float), ('c', '|S8')]
3277-
a = masked_array([(1, 1.1, '1.1'), (2, 2.2, '2.2'), (3, 3.3, '3.3')],
3278-
dtype=datatype)
3279-
assert_equal(len(a.fill_value.item()), len(datatype))
3280-
3281-
b = full_like(a, 0)
3282-
assert_equal(b.shape, a.shape)
3283-
assert_equal(b.fill_value, a.fill_value)
3284-
assert_equal(b.data, array([(0, 0.0, b'0'), (0, 0.0, b'0'), (0, 0.0, b'0')],
3285-
dtype=datatype))
3286-
3287-
b = full_like(a, 1)
3288-
assert_equal(b.shape, a.shape)
3289-
assert_equal(b.fill_value, a.fill_value)
3290-
assert_equal(b.data, array([(1, 1.0, b'1'), (1, 1.0, b'1'), (1, 1.0, b'1')],
3291-
dtype=datatype))
3292-
3293-
# check full_like mask handling
3294-
a = masked_array([1, 2, 3], mask=[False, True, False])
3295-
b = full_like(a, 2)
3296-
assert_(not np.may_share_memory(a.mask, b.mask))
3297-
b = a.view(masked_array)
3298-
assert_(np.may_share_memory(a.mask, b.mask))
3299-
33003255
@suppress_copy_mask_on_assignment
33013256
def test_put(self):
33023257
# Tests put.

0 commit comments

Comments
 (0)