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] authored and lang-m committed Feb 3, 2025
1 parent 42b396e commit 1c39fec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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 1c39fec

Please sign in to comment.