Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #240

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v5.0.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -15,12 +15,12 @@ repos:
exclude: *exclude_pre_commit_hooks

- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
rev: 0.8.1
hooks:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.9.3
hooks:
- id: ruff-format
exclude: &exclude_ruff >
Expand Down
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
Loading