Skip to content

Commit

Permalink
REV: 8396026
Browse files Browse the repository at this point in the history
Revert delimitor -> delimiter as the parameter name is part of the
public API. We'll find a different solution to fix that.
  • Loading branch information
DimitriPapadopoulos committed Sep 21, 2021
1 parent 66d33fa commit cd5c747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions numpy/ma/mrecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def openfile(fname):
raise NotImplementedError("Wow, binary file")


def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='',
def fromtextfile(fname, delimitor=None, commentchar='#', missingchar='',
varnames=None, vartypes=None):
"""
Creates a mrecarray from data stored in the file `filename`.
Expand All @@ -676,7 +676,7 @@ def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='',
----------
fname : {file name/handle}
Handle of an opened file.
delimiter : {None, string}, optional
delimitor : {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
Expand All @@ -699,14 +699,14 @@ def fromtextfile(fname, delimiter=None, commentchar='#', missingchar='',
while True:
line = ftext.readline()
firstline = line[:line.find(commentchar)].strip()
_varnames = firstline.split(delimiter)
_varnames = firstline.split(delimitor)
if len(_varnames) > 1:
break
if varnames is None:
varnames = _varnames

# Get the data.
_variables = masked_array([line.strip().split(delimiter) for line in ftext
_variables = masked_array([line.strip().split(delimitor) for line in ftext
if line[0] != commentchar and len(line) > 1])
(_, nfields) = _variables.shape
ftext.close()
Expand Down
2 changes: 1 addition & 1 deletion numpy/ma/tests/test_mrecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def test_fromtextfile(self):
with temppath() as path:
with open(path, 'w') as f:
f.write(fcontent)
mrectxt = fromtextfile(path, delimiter=',', varnames='ABCDEFG')
mrectxt = fromtextfile(path, delimitor=',', varnames='ABCDEFG')
assert_(isinstance(mrectxt, MaskedRecords))
assert_equal(mrectxt.F, [1, 1, 1, 1])
assert_equal(mrectxt.E._mask, [1, 1, 1, 1])
Expand Down

0 comments on commit cd5c747

Please sign in to comment.