Skip to content

Commit 49a3291

Browse files
committed
add method to create animations of FES flooding
1 parent 0cc0378 commit 49a3291

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requirements:
1717
- matplotlib >=3.5.3
1818
- pyvista >=0.38.5
1919
- numpy >=1.21.6
20-
- imageio >=2.31.5
20+
- imageio >=2.31.1
2121

2222
about:
2323
home: https://github.com/Jan8be/metadynminer.py

metadynminer/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,8 +1774,10 @@ def flooding_animation(self, gif_name = "flooding.gif", use_vmax_from_end = True
17741774
except ValueError:
17751775
print("Warning: The first frame of animation would be blank with the current ettings, but PyVista 3D plotter can not plot empty meshes. Try to increase the timestep between frames or decrease the spacing between isosurfaces.")
17761776
print("\n")
1777+
1778+
duration = 1000/fps
17771779
if enable_loop:
1778-
with imageio.get_writer(gif_name, format="GIF", fps = fps, loop=0) as writer:
1780+
with imageio.get_writer(gif_name, format="GIF", duration=duration, loop=0) as writer:
17791781
for image_file in image_files:
17801782
try:
17811783
image = imageio.imread(image_file)
@@ -2501,6 +2503,8 @@ def plot(self, png_name=None, contours=True, contours_spacing=0.0, aspect = 1.0,
25012503
min_ar = self.minima.iloc[:,5:8].values
25022504
min_ar = min_ar.astype(np.float32)
25032505
min_pv = pv.PolyData(min_ar)
2506+
2507+
25042508
grid = pv.UniformGrid(
25052509
dimensions=(self.res, self.res, self.res),
25062510
spacing=((cv1max-cv1min)/self.res,(cv2max-cv2min)/self.res,(cv3max-cv3min)/self.res),

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'matplotlib>=3.5.3',
2020
'pandas>=1.3.5',
2121
'pyvista>=0.38.5',
22-
'imageio>=2.31.5'
22+
'imageio>=2.31.1'
2323
],
2424

2525
classifiers=[

0 commit comments

Comments
 (0)