Skip to content

Commit

Permalink
Improve docstring, default kwarg for get_bonded_structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Jul 6, 2019
1 parent 7094d07 commit f1b9318
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pymatgen/analysis/local_env.py
Expand Up @@ -515,7 +515,7 @@ def _get_original_site(structure, site):
return i
raise Exception('Site not found!')

def get_bonded_structure(self, structure, decorate=False):
def get_bonded_structure(self, structure, decorate=False, weights=True):
"""
Obtain a StructureGraph object using this NearNeighbor
class. Requires the optional dependency networkx
Expand All @@ -526,8 +526,10 @@ def get_bonded_structure(self, structure, decorate=False):
decorate (bool): whether to annotate site properties
with order parameters using neighbors determined by
this NearNeighbor class
weights (bool): whether to include edge weights from
NearNeighbor class in StructureGraph
Returns: a pymatgen.analysis.graphs.BondedStructure object
Returns: a pymatgen.analysis.graphs.StructureGraph object
"""

# requires optional dependency which is why it's not a top-level import
Expand All @@ -542,7 +544,7 @@ def get_bonded_structure(self, structure, decorate=False):
for n in range(len(structure))]
structure.add_site_property('order_parameters', order_parameters)

sg = StructureGraph.with_local_env_strategy(structure, self, weights=True)
sg = StructureGraph.with_local_env_strategy(structure, self, weights=weights)

return sg

Expand Down

0 comments on commit f1b9318

Please sign in to comment.