Skip to content
Merged
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
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent" ]
dependencies = ["pint", "numpy", "scipy", "numba", "tabulate", "meshio", "h5py"]
dependencies = [
"pint",
"numpy>=1.22,<2.6",
"scipy",
"numba>=0.67",
"tabulate",
"meshio",
"h5py",
]

[project.scripts]
nmeshimport = "nmesh.cli.nmeshimport:main"
Expand All @@ -25,7 +33,7 @@ docs = [
"mkdocs==1.6.1",
"mkdocs-material==9.7.7",
"mkdocstrings==1.0.6",
"mkdocstrings-python==2.0.5",
"mkdocstrings-python==2.0.8",
]
dev = [
"maturin>=1.14,<2",
Expand Down
5 changes: 3 additions & 2 deletions src/nmag/vtk_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import h5py
import meshio
import numpy as np
from numpy.typing import ArrayLike

import nmesh

Expand Down Expand Up @@ -77,7 +78,7 @@ def export_vtk(
if np.any(simplices < 0) or np.any(simplices >= len(points)):
raise ValueError("Mesh cell indices are outside the snapshot point range.")

point_data: dict[str, np.ndarray] = {}
point_data: dict[str, ArrayLike] = {}
field_group = handle.get("fields")
if not isinstance(field_group, h5py.Group):
raise ValueError("Snapshot is missing the /fields group.")
Expand All @@ -97,7 +98,7 @@ def export_vtk(
)
point_data[field_name] = np.asarray(values, dtype=float)

cell_data: dict[str, list[np.ndarray]] = {}
cell_data: dict[str, list[ArrayLike]] = {}
if regions is not None:
cell_data["region"] = [regions]
mesh = meshio.Mesh(
Expand Down