diff options
| author | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2021-09-21 09:18:37 +0200 |
|---|---|---|
| committer | Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> | 2021-09-21 20:29:43 +0200 |
| commit | 83960267dc097742cb67ef575504afa56f82b102 (patch) | |
| tree | 5de763d6385fc3fc630db0992cd6b2d2ff765ea6 /numpy/ma | |
| parent | e467a284d1a2055337ce73cd92aadb491aa9a776 (diff) | |
| download | numpy-83960267dc097742cb67ef575504afa56f82b102.tar.gz | |
DOC: Typos found by codespell
Diffstat (limited to 'numpy/ma')
| -rw-r--r-- | numpy/ma/mrecords.py | 8 | ||||
| -rw-r--r-- | numpy/ma/mrecords.pyi | 2 | ||||
| -rw-r--r-- | numpy/ma/tests/test_core.py | 12 | ||||
| -rw-r--r-- | numpy/ma/tests/test_mrecords.py | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py index 10b1b209c..bdce8b3bd 100644 --- a/numpy/ma/mrecords.py +++ b/numpy/ma/mrecords.py @@ -667,7 +667,7 @@ def openfile(fname): raise NotImplementedError("Wow, binary file") -def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='', +def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='', varnames=None, vartypes=None): """ Creates a mrecarray from data stored in the file `filename`. @@ -676,7 +676,7 @@ def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='', ---------- fname : {file name/handle} Handle of an opened file. - delimitor : {None, string}, optional + delimiter : {None, string}, optional Alphanumeric character used to separate columns in the file. If None, any (group of) white spacestring(s) will be used. commentchar : {'#', string}, optional @@ -699,14 +699,14 @@ def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='', while True: line = ftext.readline() firstline = line[:line.find(commentchar)].strip() - _varnames = firstline.split(delimitor) + _varnames = firstline.split(delimiter) if len(_varnames) > 1: break if varnames is None: varnames = _varnames # Get the data. - _variables = masked_array([line.strip().split(delimitor) for line in ftext + _variables = masked_array([line.strip().split(delimiter) for line in ftext if line[0] != commentchar and len(line) > 1]) (_, nfields) = _variables.shape ftext.close() diff --git a/numpy/ma/mrecords.pyi b/numpy/ma/mrecords.pyi index 92d5afb89..cdd5347d6 100644 --- a/numpy/ma/mrecords.pyi +++ b/numpy/ma/mrecords.pyi @@ -78,7 +78,7 @@ def fromrecords( def fromtextfile( fname, - delimitor=..., + delimiter=..., commentchar=..., missingchar=..., varnames=..., diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 2fd353d23..7e9522b3a 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -1071,7 +1071,7 @@ class TestMaskedArrayArithmetic: assert_equal(z.mask, [[1, 1, 1], [0, 0, 0]]) def test_mixed_arithmetic(self): - # Tests mixed arithmetics. + # Tests mixed arithmetic. na = np.array([1]) ma = array([1]) assert_(isinstance(na + ma, MaskedArray)) @@ -1084,7 +1084,7 @@ class TestMaskedArrayArithmetic: assert_equal(getmaskarray(2 / a), [1, 0, 1]) def test_masked_singleton_arithmetic(self): - # Tests some scalar arithmetics on MaskedArrays. + # Tests some scalar arithmetic on MaskedArrays. # Masked singleton should remain masked no matter what xm = array(0, mask=1) assert_((1 / array(0)).mask) @@ -1804,7 +1804,7 @@ class TestMaskedArrayArithmetic: assert_equal(test.mask, [[False, True], [False, True]]) - def test_numpyarithmetics(self): + def test_numpyarithmetic(self): # Check that the mask is not back-propagated when using numpy functions a = masked_array([-1, 0, 1, 2, 3], mask=[0, 0, 0, 0, 1]) control = masked_array([np.nan, np.nan, 0, np.log(2), -1], @@ -2479,8 +2479,8 @@ class TestUfuncs: # also check that allclose uses ma ufuncs, to avoid warning allclose(m, 0.5) -class TestMaskedArrayInPlaceArithmetics: - # Test MaskedArray Arithmetics +class TestMaskedArrayInPlaceArithmetic: + # Test MaskedArray Arithmetic def setup(self): x = arange(10) @@ -3464,7 +3464,7 @@ class TestMaskedArrayMethods: # Test sort on dtype with subarray (gh-8069) # Just check that the sort does not error, structured array subarrays # are treated as byte strings and that leads to differing behavior - # depending on endianess and `endwith`. + # depending on endianness and `endwith`. dt = np.dtype([('v', int, 2)]) a = a.view(dt) test = sort(a) diff --git a/numpy/ma/tests/test_mrecords.py b/numpy/ma/tests/test_mrecords.py index 27df519d2..4b2c01df9 100644 --- a/numpy/ma/tests/test_mrecords.py +++ b/numpy/ma/tests/test_mrecords.py @@ -468,7 +468,7 @@ class TestMRecordsImport: with temppath() as path: with open(path, 'w') as f: f.write(fcontent) - mrectxt = fromtextfile(path, delimitor=',', varnames='ABCDEFG') + mrectxt = fromtextfile(path, delimiter=',', varnames='ABCDEFG') assert_(isinstance(mrectxt, MaskedRecords)) assert_equal(mrectxt.F, [1, 1, 1, 1]) assert_equal(mrectxt.E._mask, [1, 1, 1, 1]) |
