Skip to content

Commit e8fd90e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 43eee8b commit e8fd90e

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

crystal_toolkit/apps/examples/mpcontribs/catalysis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ def get_search_layout(self, payload=None):
436436
"Surface Formula": unicodeify(contribution["formula"]),
437437
"Surface Material ID": dcc.Link(
438438
contribution["data"]["mpid"],
439-
href=f'/materials/{contribution["data"]["mpid"]}',
439+
href=f"/materials/{contribution['data']['mpid']}",
440440
),
441441
"Adsorbate SMILES": adsorbate_smiles,
442442
"Adsorbate IUPAC Formula": contribution["data"]["adsorbateIUPACFormula"],
443443
"Adsorption Energy": contribution["data"]["adsorptionEnergy"]["value"],
444444
"Miller Index": unicodeify_spacegroup(
445-
f'({int(contribution["data"]["h"]["value"])} '
446-
f'{int(contribution["data"]["k"]["value"])} '
447-
f'{int(contribution["data"]["l"]["value"])})'
445+
f"({int(contribution['data']['h']['value'])} "
446+
f"{int(contribution['data']['k']['value'])} "
447+
f"{int(contribution['data']['l']['value'])})"
448448
),
449449
"Surface Shift": contribution["data"]["surfaceShift"]["value"],
450450
}

crystal_toolkit/components/diffraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def _sub_layouts(self) -> dict[str, Component]:
207207
help_str="This defines the wavelength of the incident X-ray radiation.",
208208
options=[
209209
{
210-
"label": f'{name.replace("a", "α").replace("b", "β")} ({wavelength:.3f} Å)', # noqa: RUF001
210+
"label": f"{name.replace('a', 'α').replace('b', 'β')} ({wavelength:.3f} Å)", # noqa: RUF001
211211
"value": name,
212212
}
213213
for name, wavelength in WAVELENGTHS.items()

crystal_toolkit/components/diffraction_tem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def get_plot_2d(
294294
pattern, thickness=thickness, zone_axis_lattice=beam_direction
295295
)
296296

297-
print(f"Generated pattern in {time()-t0:.3f} seconds")
297+
print(f"Generated pattern in {time() - t0:.3f} seconds")
298298

299299
# generate plotly Figure
300300
return self.pointlist_to_spots(pattern, beam_direction, gamma)

crystal_toolkit/components/submit_snl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def generate_description(structure, comments, panel_open, url):
115115
description = dcc.Markdown(
116116
f"""
117117
> **Structure to upload:** {structure.composition.reduced_formula} ({len(structure)} sites)
118-
> **Name:** {contents['first_name']} {contents['last_name']}
119-
> **Email:** {contents['email']}
118+
> **Name:** {contents["first_name"]} {contents["last_name"]}
119+
> **Email:** {contents["email"]}
120120
> **Comment:** {comments}
121121
122122
This information is stored so that we can give credit to you on the Materials

crystal_toolkit/core/legend.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ def get_color(self, sp: Species | Element, site: Site | None = None) -> str:
279279
elif self.color_scheme in self.site_prop_types.get("scalar", []):
280280
if not site:
281281
raise ValueError(
282-
"Requires a site for context to get the "
283-
"appropriate site property."
282+
"Requires a site for context to get the appropriate site property."
284283
)
285284

286285
prop = site.properties[self.color_scheme]
@@ -301,8 +300,7 @@ def get_color(self, sp: Species | Element, site: Site | None = None) -> str:
301300
elif self.color_scheme in self.site_prop_types.get("categorical", []):
302301
if not site:
303302
raise ValueError(
304-
"Requires a site for context to get the "
305-
"appropriate site property."
303+
"Requires a site for context to get the appropriate site property."
306304
)
307305

308306
prop = site.properties[self.color_scheme]

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from crystal_toolkit.helpers.utils import hook_up_fig_with_struct_viewer
1111

1212

13-
@pytest.fixture()
13+
@pytest.fixture
1414
def sample_df() -> pd.DataFrame:
1515
"""Create sample data for testing."""
1616
# Create a simple structure
@@ -33,7 +33,7 @@ def sample_df() -> pd.DataFrame:
3333
).set_index("material_id", drop=False)
3434

3535

36-
@pytest.fixture()
36+
@pytest.fixture
3737
def fig(sample_df: pd.DataFrame) -> go.Figure:
3838
# Create a simple scatter plot
3939
return px.scatter(

0 commit comments

Comments
 (0)