llg3d 3.0.0__py3-none-any.whl → 3.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
llg3d/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  """Main llg3d package."""
2
2
 
3
- __version__ = "3.0.0"
3
+ __version__ = "3.1.0"
4
4
  __all__ = ["__version__"]
llg3d/post/extract.py CHANGED
@@ -1,18 +1,23 @@
1
1
  """
2
2
  Extract scalar values from .npz result files.
3
3
 
4
- The extraction paths correspond to the hierarchical structure returned by
5
- `load_results()` (see io.py), where metrics and observables are JSON-decoded
6
- and stored under the 'results' key.
4
+ Use the ``llg3d.extract`` command line tool to extract scalar values from .npz result
5
+ files:
7
6
 
8
- Usage:
7
+ .. command-output:: llg3d.extract --help
9
8
 
10
- .. code-block:: sh
11
9
 
12
- llg3d.extract run.npz params/np results/metrics/total_time
10
+ Extract the total execution time from a ``run.npz`` file:
13
11
 
14
- This will extract the number of processes and total simulation time from the run.npz file.
15
- Paths are separated by '/' and navigate through nested dictionaries and object attributes.
12
+ .. command-output:: llg3d.extract run.npz results/metrics/total_time
13
+ :cwd: ../execute
14
+
15
+
16
+ Extract both the total execution time and the time per iteration:
17
+
18
+ .. command-output:: llg3d.extract run.npz results/metrics/total_time \
19
+ results/metrics/time_per_ite
20
+ :cwd: ../execute
16
21
  """
17
22
 
18
23
  import argparse
@@ -49,8 +54,10 @@ def _navigate(value: object, levels: list[str]):
49
54
 
50
55
  return _navigate(next_value, levels[1:])
51
56
 
57
+
52
58
  ExtractedValue = float | int | str | bool | np.integer | np.floating
53
59
 
60
+
54
61
  def extract_values(npz_file: Path, *keys: str) -> list[ExtractedValue]:
55
62
  """
56
63
  Extract scalar values from a .npz file.
llg3d/post/info.py CHANGED
@@ -1,4 +1,18 @@
1
- """Dump simulation results from a .npz file."""
1
+ """
2
+ Dump simulation results from a .npz file.
3
+
4
+ To browse the content of the ``run.npz`` file, use the ``llg3d.info`` command:
5
+
6
+ .. command-output:: llg3d.info run.npz
7
+ :cwd: ../execute/
8
+
9
+ The numpy arrays cans be previewed with more detailed information using the ``--verbose``
10
+ option:
11
+
12
+ .. command-output:: llg3d.info run.npz --verbose
13
+ :cwd: ../execute/
14
+
15
+ """
2
16
 
3
17
  import argparse
4
18
  import textwrap
llg3d/post/m1_vs_T.py CHANGED
@@ -1,4 +1,21 @@
1
- """Plot the magnetization vs temperature and determine the Curie temperature."""
1
+ """
2
+ Plot the magnetization vs temperature and determine the Curie temperature.
3
+
4
+ Use the ``llg3d.m1_vs_T`` command line tool to plot the average magnetization versus
5
+ temperature from multiple result files:
6
+
7
+ .. command-output:: llg3d.m1_vs_T -h
8
+ :cwd: ../execute/temperatures
9
+
10
+ When calling the tool on a selection of result files:
11
+
12
+ .. command-output:: llg3d.m1_vs_T run_*.npz -i m1_vs_T.png
13
+ :cwd: ../execute/temperatures
14
+ :shell:
15
+
16
+ .. image:: ../execute/temperatures/m1_vs_T.png
17
+ :alt: Magnetization versus temperature for multiple files
18
+ """
2
19
 
3
20
  from pathlib import Path
4
21
 
@@ -82,7 +99,7 @@ def main(): # pragma: no cover
82
99
  from .utils import get_cli_args
83
100
 
84
101
  args = get_cli_args(
85
- description=__doc__,
102
+ description="Plot the magnetization vs temperature and determine the Curie temperature.",
86
103
  default_image_filepath=Path("m1_vs_T.png"),
87
104
  )
88
105
 
llg3d/post/m1_vs_time.py CHANGED
@@ -1,4 +1,29 @@
1
- """Plot m1 vs time from one or more result files."""
1
+ """
2
+ Plot m1 vs time from one or more result files.
3
+
4
+ Use the ``llg3d.m1_vs_time`` command line tool to plot the average magnetization versus time from multiple result files:
5
+
6
+ .. command-output:: llg3d.m1_vs_time -h
7
+ :cwd: ../execute/temperatures
8
+
9
+ When calling the tool on a result files:
10
+
11
+ .. command-output:: llg3d.m1_vs_time run_1100K.npz -i m1_vs_time.png
12
+ :cwd: ../execute/temperatures
13
+ :shell:
14
+
15
+ .. image:: ../execute/temperatures/m1_vs_time.png
16
+ :alt: Magnetization versus time for a single file
17
+
18
+ Now when calling the tool on a selection of result files:
19
+
20
+ .. command-output:: llg3d.m1_vs_time run_*.npz -i m1_vs_time_multiple.png
21
+ :cwd: ../execute/temperatures
22
+ :shell:
23
+
24
+ .. image:: ../execute/temperatures/m1_vs_time_multiple.png
25
+ :alt: Magnetization versus time for multiple files
26
+ """
2
27
 
3
28
  from pathlib import Path
4
29
 
@@ -45,7 +70,7 @@ def plot_m1_vs_time(
45
70
  def main(): # pragma: no cover
46
71
  """Parse CLI arguments and call the plot function."""
47
72
  args = get_cli_args(
48
- description=__doc__,
73
+ description="Plot m1 vs time from one or more result files.",
49
74
  default_image_filepath=Path("m1_vs_time.png"),
50
75
  )
51
76
 
llg3d/post/x_profiles.py CHANGED
@@ -1,4 +1,24 @@
1
- """Plot x-profiles of magnetization from a result file."""
1
+ """
2
+ Plot x-profiles of magnetization from a result file.
3
+
4
+ Use the ``llg3d.x_profiles`` command line tool to plot the x-profiles of magnetization
5
+ from a result file:
6
+
7
+ .. command-output:: llg3d.x_profiles -h
8
+ :cwd: ../execute/domain_wall
9
+
10
+ See :doc:`here </execute/domain_wall/index>` for how to generate the ``run.npz`` file
11
+ used in this example.
12
+
13
+ When calling the tool on a result file:
14
+
15
+ .. command-output:: llg3d.x_profiles run.npz -m 1 -t ::4 -i x_profiles_4.png
16
+ :cwd: ../execute/domain_wall
17
+ :shell:
18
+
19
+ .. image:: ../execute/domain_wall/x_profiles_4.png
20
+ :alt: Longitudinal profiles of magnetization
21
+ """
2
22
 
3
23
  import argparse
4
24
  from pathlib import Path
@@ -128,7 +148,7 @@ def get_cli_args(
128
148
  def main(): # pragma: no cover
129
149
  """Parse CLI arguments and call the plot function."""
130
150
  args = get_cli_args(
131
- description=__doc__,
151
+ description="Plot x-profiles of magnetization from a result file.",
132
152
  default_image_filepath=Path("x_profile.png"),
133
153
  )
134
154
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: llg3d
3
- Version: 3.0.0
3
+ Version: 3.1.0
4
4
  Summary: A solver for the stochastic Landau-Lifshitz-Gilbert equation in 3D
5
5
  Author-email: Clémentine Courtès <clementine.courtes@math.unistra.fr>, Matthieu Boileau <matthieu.boileau@math.unistra.fr>
6
6
  Project-URL: Homepage, https://gitlab.math.unistra.fr/llg3d/llg3d
@@ -1,4 +1,4 @@
1
- llg3d/__init__.py,sha256=MssuCTRN-5px2s7MXHPvkp4Mo7HxaGQ_Hsy2HW9bg8Q,75
1
+ llg3d/__init__.py,sha256=WFiJ87Ng-E_9zla-6KjvxFzq8xI8SluspEH02TTQgvM,75
2
2
  llg3d/__main__.py,sha256=3D1q7AG5vU6gr-V0iuo5oNYl-Og2SvJ4YaBTdqOVVaw,115
3
3
  llg3d/element.py,sha256=GnafEd8vrDr59ixi05zyMesUCUAFhFccdZ-I1y-NAlA,7259
4
4
  llg3d/grid.py,sha256=iaT8QUZPAjt1fD39H64-c4EF4SY-qt4406pbHlO8l0s,4158
@@ -11,13 +11,13 @@ llg3d/benchmarks/compare_commits.py,sha256=9fY6RMXlEfDKKvz4D5NO3jtuf4JB26zIF5L9m
11
11
  llg3d/benchmarks/efficiency.py,sha256=PrDE3KxVAtWVRotcod0CiegQ_2PZa6qI9ByRRadHq7s,15461
12
12
  llg3d/benchmarks/utils.py,sha256=XSECFgoquWu7LcgCsPYx5YG3CtRlPHXUewMPGthP5wY,708
13
13
  llg3d/post/__init__.py,sha256=S4UiquBtCm_iHQ0vaU0E4T69TZfhiYq7i26AOz7Vs40,29
14
- llg3d/post/extract.py,sha256=73FWYE1-HYLzU1tjjAOvhHrZFe6SVLMLa78jJxgz0pM,3301
15
- llg3d/post/info.py,sha256=7dAWsfO9IkCkiWgBVxVm36Y3rK78PBzL_rb6LuajANU,5232
16
- llg3d/post/m1_vs_T.py,sha256=t7HAPlcH_v1iLmbFplhZRmHRVoQLSA9t287ITZ47Fhw,2715
17
- llg3d/post/m1_vs_time.py,sha256=6ynl4OK4lPPDLnhY_k-qSBovldO4Wa95-Z8LfiohIr0,1507
14
+ llg3d/post/extract.py,sha256=45J2mfVU6wR2j-Vr_fNoouQsr65aRWG4knZ-B4L_pFQ,3321
15
+ llg3d/post/info.py,sha256=sCaGJR7nxqrpWjZMINWFJR8unZ83ISCtrfP-URKCUIE,5548
16
+ llg3d/post/m1_vs_T.py,sha256=WZK1wL66yGOFZgKcgESA564V7qwzNMSAlTTu16APNw8,3251
17
+ llg3d/post/m1_vs_time.py,sha256=VtwyAAjuUPQO2Kl1H-5DeOwS5xj_DdUo6wi5rs9VDxo,2298
18
18
  llg3d/post/process.py,sha256=usvRLnvHDqaV3EKiP6il3se7ha_G_PHVS0LP_8c87KM,3845
19
19
  llg3d/post/utils.py,sha256=oZBYbPhJJYzHsRrnENyxmZotylLlYVOOFePr3zc-Fo0,1114
20
- llg3d/post/x_profiles.py,sha256=pexMn2hUPPNvdTOsc5ilXm6JN3zlV5xu4xU2LXXOp4I,3993
20
+ llg3d/post/x_profiles.py,sha256=wRTz7IDrM_3A-259SV-SduU8-n0mmS_EFUYsalwz-OE,4594
21
21
  llg3d/solvers/__init__.py,sha256=aNn3LjP1nDZj7PqJ_KGxY3hj-BDa-RrOcE00DnjLgDk,3436
22
22
  llg3d/solvers/base.py,sha256=cucNTqBSbl9MgArGbmlYORKPWrsJFuZRQCZYgACuj8U,11879
23
23
  llg3d/solvers/math_utils.py,sha256=F1uwrfNCg0tCLlkXKoMFHcOaSFsIrrvzO768IpfvZx4,1014
@@ -27,10 +27,10 @@ llg3d/solvers/opencl.py,sha256=i7y50uQ8bV5EcV3PDcEvJoPo3Qt6pvAq_awy7mgHDGk,15190
27
27
  llg3d/solvers/profiling.py,sha256=B5PgxtE3xCcv7Qi51VVYAToBzR5HwjS4j9LPKg1ajyc,991
28
28
  llg3d/solvers/experimental/__init__.py,sha256=F4smHsF9_hR5KXIsh6Xd46sSzJE6N7yFuH0vmj0ygGA,147
29
29
  llg3d/solvers/experimental/jax.py,sha256=FrcdQYMVroPbYBbqvZMPIH9gv8n-PkT2vdUO5u5aYHg,11249
30
- llg3d-3.0.0.dist-info/licenses/AUTHORS,sha256=vhJ88HikYvOrGiB_l1xH2X6hyn9ZJafx6mpoMYNhh1I,297
31
- llg3d-3.0.0.dist-info/licenses/LICENSE,sha256=aFxTGAyyve8nM9T2jWTarJzQhdSSC3MbbN1heNAev9c,1062
32
- llg3d-3.0.0.dist-info/METADATA,sha256=dD3kJMCX07AFNIHAud5mEILEzBzdNZLfvaK065sH9FM,2030
33
- llg3d-3.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
34
- llg3d-3.0.0.dist-info/entry_points.txt,sha256=28japzG2aS2e_J42LXw7SAK4ufbG22LGHcI2D6zVz9Y,374
35
- llg3d-3.0.0.dist-info/top_level.txt,sha256=cBZ0roaXt3CAXqYojuO84lGPCtWuLlXxLGLYRKmHZy0,6
36
- llg3d-3.0.0.dist-info/RECORD,,
30
+ llg3d-3.1.0.dist-info/licenses/AUTHORS,sha256=vhJ88HikYvOrGiB_l1xH2X6hyn9ZJafx6mpoMYNhh1I,297
31
+ llg3d-3.1.0.dist-info/licenses/LICENSE,sha256=aFxTGAyyve8nM9T2jWTarJzQhdSSC3MbbN1heNAev9c,1062
32
+ llg3d-3.1.0.dist-info/METADATA,sha256=s7tmZU9PdngZQW7gDRP-AgokwiI-oAhjc33U9UC1oiY,2030
33
+ llg3d-3.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
34
+ llg3d-3.1.0.dist-info/entry_points.txt,sha256=28japzG2aS2e_J42LXw7SAK4ufbG22LGHcI2D6zVz9Y,374
35
+ llg3d-3.1.0.dist-info/top_level.txt,sha256=cBZ0roaXt3CAXqYojuO84lGPCtWuLlXxLGLYRKmHZy0,6
36
+ llg3d-3.1.0.dist-info/RECORD,,
File without changes