Skip to content

Commit

Permalink
Merge pull request #158 from ubermag/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
lang-m authored Feb 3, 2025
2 parents 9904ff3 + 1c39fec commit 513e419
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ exclude: 'dev'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict # checks for files that contain merge conflict strings
- id: check-toml # checks toml files for parseable syntax
- id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.9.3
hooks:
# Run the linter.
- id: ruff
Expand Down
8 changes: 4 additions & 4 deletions oommfc/scripts/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def driver_script(

# Fixed spins
if fixed_subregions is not None:
resstr = f'{{main_atlas {" ".join(fixed_subregions)}}}'
resstr = f"{{main_atlas {' '.join(fixed_subregions)}}}"
driver.evolver.fixed_spins = resstr

mif += oc.scripts.evolver_script(driver.evolver)
Expand Down Expand Up @@ -70,7 +70,7 @@ def driver_script(

# Fixed spins
if fixed_subregions is not None:
resstr = f'{{main_atlas {" ".join(fixed_subregions)}}}'
resstr = f"{{main_atlas {' '.join(fixed_subregions)}}}"
driver.evolver.fixed_spins = resstr

# What is saved in output?
Expand Down Expand Up @@ -177,7 +177,7 @@ def driver_script(

# Fixed spins
if fixed_subregions is not None:
resstr = f'{{main_atlas {" ".join(fixed_subregions)}}}'
resstr = f"{{main_atlas {' '.join(fixed_subregions)}}}"
driver.evolver.fixed_spins = resstr

mif += oc.scripts.evolver_script(driver.evolver, **kwargs)
Expand All @@ -192,7 +192,7 @@ def driver_script(
mif += " mesh :mesh\n"
mif += " Ms :m0_norm\n"
mif += " m0 :m0\n"
mif += f" stopping_time {t/n}\n"
mif += f" stopping_time {t / n}\n"
mif += f" stage_count {n}\n"
for attr, value in driver:
if attr != "evolver":
Expand Down
10 changes: 5 additions & 5 deletions oommfc/scripts/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def zeeman_script(term, system):
mif += f"proc TimeFunction:{term.name} {{ total_time }} {{\n"
mif += f" set tstep {term.dt}\n"
mif += " set index [expr round($total_time/$tstep)]\n"
mif += f' set H_t_fac {{ {" ".join(map(str, term.tlist))} }}\n'
mif += f' set dH_t_fac {{ {" ".join(map(str, term.dtlist))} }}\n'
mif += f" set H_t_fac {{ {' '.join(map(str, term.tlist))} }}\n"
mif += f" set dH_t_fac {{ {' '.join(map(str, term.dtlist))} }}\n"
mif += " set H_fac [lindex $H_t_fac $index]\n"
mif += " set dH_fac [lindex $dH_t_fac $index]\n"
mif += f" set Hx [expr {{ {term.H[0]}*$H_fac }}]\n"
Expand All @@ -216,9 +216,9 @@ def zeeman_script(term, system):
mif += "}\n\n"
elif isinstance(term.tcl_strings, dict):
mif += term.tcl_strings["script"]
mif += f'\n# {term.tcl_strings["energy"][4:]}\n' # 3.9 removeprefix
mif += f'Specify {term.tcl_strings["energy"]}:{term.name} {{\n'
mif += f' script {term.tcl_strings["script_name"]}\n'
mif += f"\n# {term.tcl_strings['energy'][4:]}\n" # 3.9 removeprefix
mif += f"Specify {term.tcl_strings['energy']}:{term.name} {{\n"
mif += f" script {term.tcl_strings['script_name']}\n"
for key in ["type", "script_args"]:
with contextlib.suppress(KeyError):
mif += f" {key} {term.tcl_strings[key]}\n"
Expand Down
2 changes: 1 addition & 1 deletion oommfc/scripts/evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def evolver_script(evolver, **kwargs):
mif += "proc TimeFunction { total_time } {\n"
mif += f" set tstep {evolver.dt}\n"
mif += " set index [expr round($total_time/$tstep)]\n"
mif += f' set profile {{ {" ".join(map(str, tlist))} }}\n'
mif += f" set profile {{ {' '.join(map(str, tlist))} }}\n"
mif += " set factor [lindex $profile $index]\n"
mif += " return $factor\n"
mif += "}\n\n"
Expand Down

0 comments on commit 513e419

Please sign in to comment.