Dear all,
While following the official OGS tutorial “Reading OGS Output: Diffusion, Sorption, and Decay in a 1D Reactive Transport Model”, I encountered a PyVistaAttributeError
when trying to extract time series data at specific points using ogstools.MeshSeries.extract_probe
.
Tutorial code snippet:
import ogstools as ot
import numpy as np
points = np.array([(0.0, 0.0, 419.4), (0.0, 0.0, 420.7)])
labels = [rf"$p_{{i}}$, $z = {pt[2]}\,$m" for i, pt in enumerate(points)]
# ms_pvd is loaded from the .pvd file as shown in the tutorial
ms_pts = [ot.MeshSeries.extract_probe(ms_pvd, pts, I129) for pts in points]
The error message:
PyVistaAttributeError: Attribute ‘filepath’ does not exist and cannot be added to class ‘PolyData’
Use pv.set_new_attribute
to set new attributes or consider setting a private variable (with _
prefix) instead.
Additional information:
- The
.pvd
file and associated data files exist and can be opened successfully in Jupyter notebook. - Loading the MeshSeries object from the
.pvd
file works without error. - My environment:
- ogstools version: 0.7.0
- pyvista version: 0.46.3
- python version: 3.12.3
- I have tried both passing all points as an array to
extract_probe
and invoking it point by point, but the error persists in both cases. - I suspect the issue could be due to ogstools and pyvista version compatibility, or possibly a problem with file path association within the MeshSeries object.
My questions:
- Is there a recommended or correct usage for
MeshSeries.extract_probe
that avoids this error? - What are the common causes for this PyVistaAttributeError in the context of ogstools?
- Should I downgrade/upgrade ogstools or pyvista, or is there a workaround?
- Any other debugging or troubleshooting suggestions would be greatly appreciated.
Thank you for your help!