Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 20, 2025
1 parent ff7c01d commit 8c6adc6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions src/aiida_sssp_workflow/calculations/calculate_bands_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def calculate_eta_and_max_diff(
weight_a = bandsdata_a.get("weights")
weight_b = bandsdata_b.get("weights")
weight = weight_a
assert np.allclose(
weight_a, weight_b
), "Different weight of kpoints of two calculation."
assert np.allclose(weight_a, weight_b), (
"Different weight of kpoints of two calculation."
)

bands_a = bandsdata_a.get("bands")
bands_b = bandsdata_b.get("bands")
Expand Down Expand Up @@ -205,10 +205,11 @@ def get_bands_distance(
# swap to make sure a is less electrons pseudo
bandsdata_a, bandsdata_b = bandsdata_b, bandsdata_a

assert (
int(bandsdata_b["number_of_electrons"])
>= int(bandsdata_a["number_of_electrons"])
), f"Need to be less num_bands in a {bandsdata_a['number_of_electrons']} than b {bandsdata_b['number_of_electrons']}"
assert int(bandsdata_b["number_of_electrons"]) >= int(
bandsdata_a["number_of_electrons"]
), (
f"Need to be less num_bands in a {bandsdata_a['number_of_electrons']} than b {bandsdata_b['number_of_electrons']}"
)

num_electrons_a = int(bandsdata_a["number_of_electrons"])
num_electrons_b = int(bandsdata_b["number_of_electrons"])
Expand Down Expand Up @@ -238,9 +239,9 @@ def get_bands_distance(

# after cut and align in retrive band, the shapes are same now
# import ipdb; ipdb.set_trace()
assert np.shape(bandsdata_a["bands"]) == np.shape(
bandsdata_b["bands"]
), f'{np.shape(bandsdata_a["bands"])} != {np.shape(bandsdata_b["bands"])}'
assert np.shape(bandsdata_a["bands"]) == np.shape(bandsdata_b["bands"]), (
f"{np.shape(bandsdata_a['bands'])} != {np.shape(bandsdata_b['bands'])}"
)

# eta_v
fermi_shift_v = 0.0
Expand Down
2 changes: 1 addition & 1 deletion src/aiida_sssp_workflow/cli/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def inspect(node, output):

color = "red" if wfc_scan_healthy != 1 or rho_scan_healthy != 1 else "green"
click.secho(
f"Convergence scan healthy check for {property}: wavefunction scan = {round(wfc_scan_healthy*100, 2)}%, charge density scan = {round(rho_scan_healthy*100, 2)}%",
f"Convergence scan healthy check for {property}: wavefunction scan = {round(wfc_scan_healthy * 100, 2)}%, charge density scan = {round(rho_scan_healthy * 100, 2)}%",
fg=color,
)

Expand Down
2 changes: 1 addition & 1 deletion src/aiida_sssp_workflow/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get_magnetic_inputs(structure: orm.StructureData):
if kind_name in ["Mn", "O", "Cr"]:
for i, site in enumerate(structure.sites):
mag_structure.append_atom(
position=site.position, symbols=kind_name, name=f"{kind_name}{i+1}"
position=site.position, symbols=kind_name, name=f"{kind_name}{i + 1}"
)

if kind_name == "Mn":
Expand Down

0 comments on commit 8c6adc6

Please sign in to comment.