Skip to content

Commit ba49fb5

Browse files
committed
edit Docstring
1 parent a491d0b commit ba49fb5

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

src/diffpy/clusterrender/structuredf.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@ class StructureDF(pd.DataFrame):
1717
coordination shells, specifying the central atom (0) and its
1818
neighboring atoms (1, 2, ...).
1919
20-
Parameters
20+
Methods
21+
-------
22+
from_structure(structure, site_index=None)
23+
Load structure data from a pymatgen Structure object.
24+
from_file(filename, site_index=None)
25+
Load structure data from a file.
26+
27+
Attributes
2128
----------
22-
*args, **kwargs
23-
Arguments passed to the pandas DataFrame constructor to initialize
24-
the DataFrame.
25-
These are ignored if `structure` or `filename` is provided.
26-
structure : pymatgen.core.Structure, optional
27-
A Structure object from pymatgen.core to initialize the DataFrame.
28-
filename : str, optional
29-
Path to a file to read the structure (or cluster) from.
30-
Accepted file formats include cif and xyz.
31-
site_index : int, optional
32-
Index of the central atom in the structure.
29+
_constructor : property
30+
Ensures that DataFrame operations return StructureDF objects.
3331
"""
3432

3533
@property
@@ -39,6 +37,25 @@ def _constructor(self):
3937
def __init__(
4038
self, *args, structure=None, site_index=None, filename=None, **kwargs
4139
):
40+
"""Initialize StructureDF from a Structure object, a file, or
41+
generic DataFrame arguments.
42+
43+
Parameters
44+
----------
45+
structure : pymatgen.core.Structure, optional
46+
The pymatgen Structure object to load the structure from.
47+
site_index : int, optional
48+
The index of atom in the structure to be treated as the
49+
central atom.
50+
filename : str, optional
51+
The path to the structure file.
52+
Accepted formats include CIF and XYZ.
53+
*args, **kwargs
54+
The arguments to initialize a pandas DataFrame with a
55+
generic pandas constructor.
56+
Accepted arguments are described in
57+
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html.
58+
"""
4259
# load from Structure object if provided
4360
if isinstance(structure, Structure):
4461
self.from_structure(structure, site_index)

0 commit comments

Comments
 (0)