Skip to content
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
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: v5.0.0
rev: v6.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.12.0
rev: v0.16.0
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"source": [
"# Some initial configurations\n",
"%config InlineBackend.figure_formats = ['svg'] # output matplotlib plots as SVG\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import pandas as pd\n",
"\n",
"pd.options.display.max_rows = 5\n",
"pd.options.display.float_format = \"{:,.2e}\".format"
Expand Down
6 changes: 2 additions & 4 deletions examples/08-tutorial-standard-problem4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,10 @@
}
],
"source": [
"print(\"The average magnetisation is {}.\".format(system.m.mean()))\n",
"print(f\"The average magnetisation is {system.m.mean()}.\")\n",
"\n",
"print(\n",
" \"The magnetisation at the mesh centre {}\\nis {}.\".format(\n",
" system.m.mesh.region.centre, system.m(system.m.mesh.region.centre)\n",
" )\n",
" f\"The magnetisation at the mesh centre {system.m.mesh.region.centre}\\nis {system.m(system.m.mesh.region.centre)}.\"\n",
")"
]
},
Expand Down
4 changes: 2 additions & 2 deletions examples/10-tutorial-standard-problem-fmr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
},
"outputs": [],
"source": [
"import oommfc as oc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as oc"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions examples/11-tutorial-deriving-fields.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as oc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as oc"
]
},
{
Expand Down Expand Up @@ -330,7 +330,7 @@
],
"source": [
"E = oc.compute(system.energy.energy, system)\n",
"print(\"The system's energy is {} J.\".format(E))\n",
"print(f\"The system's energy is {E} J.\")\n",
"\n",
"system.m.sel(\"x\").mpl()"
]
Expand Down Expand Up @@ -419,8 +419,8 @@
"for term in system.energy:\n",
" total_energy += oc.compute(term.energy, system)\n",
"\n",
"print(\"The sum of energy terms is {} J.\".format(total_energy))\n",
"print(\"The system's energy is {} J.\".format(oc.compute(system.energy.energy, system)))"
"print(f\"The sum of energy terms is {total_energy} J.\")\n",
"print(f\"The system's energy is {oc.compute(system.energy.energy, system)} J.\")"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions examples/13-tutorial-skyrmion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as oc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as oc"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/STT-dw-motion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"# Definition of parameters\n",
"L = 500e-9 # sample length (m)\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/choosing-runner.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as mc"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/energy-term-computations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as mc"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/fixed-subregions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"region = df.Region(p1=(-30e-9, 0, 0), p2=(30e-9, 3e-9, 3e-9))\n",
"cell = (3e-9, 3e-9, 3e-9)\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/hysteresis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"region = df.Region(p1=(-50e-9, -50e-9, -50e-9), p2=(50e-9, 50e-9, 50e-9))\n",
"mesh = df.Mesh(region=region, cell=(5e-9, 5e-9, 5e-9))\n",
Expand Down
3 changes: 2 additions & 1 deletion examples/multiple-terms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"outputs": [],
"source": [
"import random\n",
"import oommfc as mc\n",
"\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"p1 = (-10e-9, 0, 0)\n",
"p2 = (10e-9, 1e-9, 1e-9)\n",
Expand Down
1 change: 1 addition & 0 deletions examples/negative-A.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"outputs": [],
"source": [
"import random\n",
"\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc"
Expand Down
4 changes: 2 additions & 2 deletions examples/periodic-boundary-conditions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as mc"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions examples/rkky.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"outputs": [],
"source": [
"import random\n",
"\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/sine-hysteresis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"region = df.Region(p1=(-50e-9, -50e-9, 0), p2=(50e-9, 50e-9, 10e-9))\n",
"mesh = df.Mesh(region=region, cell=(5e-9, 5e-9, 5e-9))\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/space-time-field.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"region = df.Region(p1=(-50e-9, -50e-9, 0), p2=(50e-9, 50e-9, 10e-9))\n",
"mesh = df.Mesh(region=region, cell=(5e-9, 5e-9, 5e-9))\n",
Expand Down
3 changes: 2 additions & 1 deletion examples/spatially-varying-parameters1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"p1 = (-10e-9, 0, 0)\n",
"p2 = (10e-9, 1e-9, 1e-9)\n",
Expand Down Expand Up @@ -74,6 +74,7 @@
"outputs": [],
"source": [
"import random\n",
"\n",
"import discretisedfield as df\n",
"\n",
"Ms = 8e5 # saturation magnetisation (A/m)\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/spatially-varying-parameters2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"d = 150e-9\n",
"hb = 20e-9\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/time-dependent-field-current.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"outputs": [],
"source": [
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"import matplotlib.pyplot as plt\n",
"import micromagneticdata\n",
"import micromagneticmodel as mm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"import oommfc as mc"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions examples/time-dependent-field.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as mc"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion getting-started/dw-pair-conversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
}
],
"source": [
"import oommfc as oc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as oc\n",
"\n",
"Ms = 5.8e5 # saturation magnetisation (A/m)\n",
"A = 15e-12 # exchange energy constant (J/)\n",
Expand Down
2 changes: 1 addition & 1 deletion getting-started/dynamics-equation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as mc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm\n",
"import oommfc as mc\n",
"\n",
"# Define a macrospin mesh (i.e. one discretisation cell).\n",
"p1 = (0, 0, 0) # first point of the mesh domain (m)\n",
Expand Down
4 changes: 2 additions & 2 deletions getting-started/energy-equation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"metadata": {},
"outputs": [],
"source": [
"import oommfc as oc\n",
"import discretisedfield as df\n",
"import micromagneticmodel as mm"
"import micromagneticmodel as mm\n",
"import oommfc as oc"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions getting-started/first-ubermag-simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"metadata": {},
"outputs": [],
"source": [
"import micromagneticmodel as mm # mm is just a shorter name we want to use later\n",
"import discretisedfield as df # df is just a shorter name we want to use later"
"import discretisedfield as df # df is just a shorter name we want to use later\n",
"import micromagneticmodel as mm # mm is just a shorter name we want to use later"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion getting-started/mag2exp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
],
"source": [
"import discretisedfield as df\n",
"import numpy as np\n",
"import micromagneticmodel as mm\n",
"import numpy as np\n",
"\n",
"np.random.seed(2)\n",
"\n",
Expand Down
Loading