Skip to content

Commit df22035

Browse files
committed
to_df() backwards compatibility
Specifically for `to_df(np.s[...])` calls that did not name an argument
1 parent 3120d7f commit df22035

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/binding/python/openpmd_api/DataFrame.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
import numpy as np
1111

1212

13-
def particles_to_dataframe(particle_species, *legacy_args, attributes=None, slice=None):
13+
def particles_to_dataframe(particle_species,
14+
*legacy_args,
15+
attributes=None,
16+
slice=None):
1417
"""
1518
Load all records of a particle species into a Pandas DataFrame.
1619
@@ -52,10 +55,10 @@ def particles_to_dataframe(particle_species, *legacy_args, attributes=None, slic
5255
slice = legacy_args[0]
5356
import warnings
5457
warnings.warn("The to_df() argument order changed in "
55-
"openPMD-api 0.17.0!\n"
56-
"The slice= argument must be passed as a named argument.",
57-
DeprecationWarning
58-
)
58+
"openPMD-api 0.17.0!\n"
59+
"The slice= argument must be passed as a named argument.",
60+
DeprecationWarning
61+
)
5962
else:
6063
raise RuntimeError("to_df() does not support unnamed arguments!")
6164

0 commit comments

Comments
 (0)