Skip to content
Snippets Groups Projects
Commit f61a059d authored by joergbuchwald's avatar joergbuchwald Committed by Tobias Meisel
Browse files

rename i -> tv as animate only accepts timevalues as arguments

parent 7819a0e7
No related branches found
No related tags found
No related merge requests found
......@@ -619,14 +619,14 @@ class MeshSeries:
def init() -> None:
pass
def animate_func(i: int | float, fig: plt.Figure) -> None:
def animate_func(tv: float, fig: plt.Figure) -> None:
fig.axes[-1].remove() # remove colorbar
for ax in np.ravel(np.asarray(fig.axes)):
ax.clear()
mesh = self[i] if isinstance(i, int) else self.read_interp(i, True)
mesh = self.read_interp(tv, True)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
plot_func(fig.axes[0], i)
plot_func(fig.axes[0], tv)
plot.contourplots.draw_plot(
mesh, variable, fig=fig, axes=fig.axes[0], **kwargs
) # type: ignore[assignment]
......
......@@ -499,12 +499,8 @@ class TestUtils:
pvd_entries = tree.findall("./Collection/DataSet")
for i in range(num_slices):
assert ms[i].filepath.name == pvd_entries[i].attrib["file"]
assert (
np.abs(
ms.timevalues[i] - float(pvd_entries[i].attrib["timestep"])
)
< 1e-14
)
ts = float(pvd_entries[i].attrib["timestep"])
assert np.abs(ms.timevalues[i] - ts) < 1e-14
def test_save_xdmf_mesh_series(self):
temp = Path(mkdtemp())
......@@ -532,9 +528,5 @@ class TestUtils:
num_slices_test = len(pvd_entries)
assert num_slices == num_slices_test
for i in range(num_slices):
assert (
np.abs(
ms.timevalues[i] - float(pvd_entries[i].attrib["timestep"])
)
< 1e-14
)
ts = float(pvd_entries[i].attrib["timestep"])
assert np.abs(ms.timevalues[i] - ts) < 1e-14
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment