Skip to content

Commit 5f57849

Browse files
committed
add LocalEnvironmentPanel doc strings
1 parent f931b7e commit 5f57849

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

crystal_toolkit/components/localenv.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ def _get_local_order_parameters(structure_graph, n):
104104

105105

106106
class LocalEnvironmentPanel(PanelComponent):
107+
"""A panel to analyze the local chemical environments in a crystal."""
108+
107109
def __init__(self, *args, **kwargs) -> None:
108110
super().__init__(*args, **kwargs)
109111
self.create_store("graph")
@@ -114,17 +116,21 @@ def __init__(self, *args, **kwargs) -> None:
114116

115117
@property
116118
def title(self) -> str:
119+
"""Title of the panel."""
117120
return "Local Environments"
118121

119122
@property
120123
def description(self) -> str:
124+
"""Description of the panel."""
121125
return "Analyze the local chemical environments in your crystal."
122126

123127
@property
124128
def loading_text(self):
129+
"""Text to display while loading."""
125130
return "Analyzing environments"
126131

127132
def contents_layout(self) -> html.Div:
133+
"""HTML layout of the panel contents."""
128134
algorithm_choices = self.get_choice_input(
129135
label="Analysis method",
130136
kwarg_label="algorithm",
@@ -145,6 +151,7 @@ def contents_layout(self) -> html.Div:
145151

146152
@staticmethod
147153
def get_graph_data(graph, display_options):
154+
"""Get the data for the graph visualization."""
148155
color_scheme = display_options.get("color_scheme", "Jmol")
149156

150157
nodes = []
@@ -197,6 +204,7 @@ def get_graph_data(graph, display_options):
197204
return {"nodes": nodes, "edges": edges}
198205

199206
def generate_callbacks(self, app, cache):
207+
"""Generate the callbacks for the panel interactions."""
200208
super().generate_callbacks(app, cache)
201209

202210
@app.callback(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ exclude = ["docs_rst"]
5656

5757
[tool.setuptools_scm]
5858
write_to = "crystal_toolkit/_version.py"
59-
write_to_template = '__version__ = "{version}"\n'
59+
write_to_template = '__version__ = "{version}"'
6060
local_scheme = "no-local-version"
6161

6262
[build-system]

0 commit comments

Comments
 (0)