Skip to content

Commit 4f0591f

Browse files
committed
update with pre-commit
1 parent aa57614 commit 4f0591f

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

crystal_toolkit/components/phonon.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from __future__ import annotations
22

33
import itertools
4-
import json
54
from copy import deepcopy
6-
from datetime import datetime
75
from typing import TYPE_CHECKING, Any
86

97
import numpy as np
@@ -194,10 +192,10 @@ def _sub_layouts(self) -> dict[str, Component]:
194192
)
195193

196194
hr = html.Hr(
197-
style={
198-
"backgroundColor": "#C5C5C6",
199-
}
200-
)
195+
style={
196+
"backgroundColor": "#C5C5C6",
197+
}
198+
)
201199

202200
crystal_animation_controls = html.Div(
203201
[
@@ -206,7 +204,7 @@ def _sub_layouts(self) -> dict[str, Component]:
206204
hr,
207205
html.H6("Supercell modification", style={"textAlign": "center"}),
208206
html.Div(
209-
[
207+
[
210208
self.get_numerical_input(
211209
kwarg_label="scale-x",
212210
default=1,
@@ -242,7 +240,6 @@ def _sub_layouts(self) -> dict[str, Component]:
242240
},
243241
),
244242
hr,
245-
246243
html.Div(
247244
self.get_slider_input(
248245
kwarg_label="magnitude",
@@ -373,7 +370,7 @@ def _get_time_function_json(
373370

374371
# atoms
375372
contents0 = json_data["contents"][0]["contents"]
376-
for cidx, content in enumerate(contents0):
373+
for cidx, _ in enumerate(contents0):
377374
rcontent = rdata["contents"][0]["contents"][cidx]
378375
# put required data to the given atom index
379376
rcontent[
@@ -390,7 +387,7 @@ def _get_time_function_json(
390387
# remove unused sense (polyhedra and magmoms)
391388
del rdata["contents"][2:4]
392389

393-
# displacement formula: u(R,t) = A * e^(i(q⋅Rωt))
390+
# displacement formula: u(R,t) = A * e^(i(q⋅R-ωt))
394391
rdata["app"] = "phonon"
395392

396393
# omega (ω)
@@ -404,7 +401,9 @@ def _get_time_function_json(
404401
# the size of q: (149, 3)
405402
# q:
406403
q = np.einsum(
407-
"ij,kj->ik", ph_bs.structure.lattice.reciprocal_lattice.matrix, np.array(ph_bs.qpoints)
404+
"ij,kj->ik",
405+
ph_bs.structure.lattice.reciprocal_lattice.matrix,
406+
np.array(ph_bs.qpoints),
408407
).T
409408

410409
# phases (q⋅R): should be a number
@@ -672,7 +671,6 @@ def get_ph_dos_traces(dos: CompletePhononDos, freq_range: tuple[float, float]):
672671
"xaxis": "x2",
673672
"yaxis": "y2",
674673
}
675-
676674
dos_traces.append(trace_tdos)
677675

678676
# Projected DOS

0 commit comments

Comments
 (0)