Skip to content

Commit

Permalink
MNT: Address deprecation warning in CI
Browse files Browse the repository at this point in the history
	FutureWarning: The 'delim_whitespace' keyword in pd.read_csv
	is deprecated and will be removed in a future version. Use
	``sep='\s+'`` instead

The sep parameter has been available since Pandas 1.0 at least.
  • Loading branch information
DimitriPapadopoulos committed Apr 17, 2024
1 parent dc783d8 commit ff52ee1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions niworkflows/interfaces/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ class AddTSVHeader(SimpleInterface):
>>> addheader.inputs.in_file = 'data.tsv'
>>> addheader.inputs.columns = ['a', 'b', 'c', 'd', 'e']
>>> res = addheader.run()
>>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True,
... index_col=None)
>>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None)
>>> df.columns.ravel().tolist()
['a', 'b', 'c', 'd', 'e']
Expand Down Expand Up @@ -311,7 +310,7 @@ class JoinTSVColumns(SimpleInterface):
>>> join.inputs.in_file = 'data.tsv'
>>> join.inputs.join_file = 'add.tsv'
>>> res = join.run()
>>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True,
>>> df = pd.read_csv(res.outputs.out_file, sep='\s+',
... index_col=None, dtype=float, header=None)
>>> df.columns.ravel().tolist() == list(range(5))
True
Expand All @@ -328,8 +327,7 @@ class JoinTSVColumns(SimpleInterface):
>>> res = join.run()
>>> res.outputs.out_file # doctest: +ELLIPSIS
'...data_joined.tsv'
>>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True,
... index_col=None)
>>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None)
>>> df.columns.ravel().tolist()
['a', 'b', 'c', 'd', 'e']
Expand All @@ -342,8 +340,7 @@ class JoinTSVColumns(SimpleInterface):
>>> join.inputs.side = 'left'
>>> join.inputs.columns = ['a', 'b', 'c', 'd', 'e']
>>> res = join.run()
>>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True,
... index_col=None)
>>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None)
>>> df.columns.ravel().tolist()
['a', 'b', 'c', 'd', 'e']
Expand Down

0 comments on commit ff52ee1

Please sign in to comment.