Skip to content

Commit 65ffe2b

Browse files
committed
update ovito gif tutorial
1 parent 3b67869 commit 65ffe2b

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

ionerdss/ovito_visualizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def visualize_trajectory_ovito(
7777
for filename in frame_paths:
7878
images.append(imageio.imread(filename))
7979

80-
imageio.mimsave(gif_name, images, fps=fps)
80+
imageio.mimsave(gif_name, images, fps=fps, loop=0)
8181
logger.info(f"Successfully saved animation to {os.path.abspath(gif_name)}")
8282

8383
# Clean up temporary frames

tutorials/ionerdss_tutorial_ovito_gif.ipynb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": null,
26+
"execution_count": 1,
2727
"id": "070429f3",
2828
"metadata": {
2929
"execution": {
@@ -59,7 +59,7 @@
5959
},
6060
{
6161
"cell_type": "code",
62-
"execution_count": null,
62+
"execution_count": 2,
6363
"id": "308c2c11",
6464
"metadata": {
6565
"execution": {
@@ -98,15 +98,23 @@
9898
"shell.execute_reply": "2026-03-26T16:01:40.576157Z"
9999
}
100100
},
101-
"outputs": [],
101+
"outputs": [
102+
{
103+
"name": "stdout",
104+
"output_type": "stream",
105+
"text": [
106+
"Beginning rendering for: ./6bno_dir/nerdss_files/DATA/trajectory.xyz\n"
107+
]
108+
}
109+
],
102110
"source": [
103111
"try:\n",
104112
" print(f\"Beginning rendering for: {trajectory_file_path}\")\n",
105113
" ionerdss.visualize_trajectory_ovito(\n",
106114
" trajectory_path=trajectory_file_path,\n",
107115
" save_gif=True, \n",
108116
" gif_name=\"6bno.gif\", # The requested name of your output file\n",
109-
" fps=10, # The speed of your animation (Frames per second)\n",
117+
" fps=2, # The speed of your animation (Frames per second)\n",
110118
" show_simulation_box=False # Set to True to display the simulation cell bounding box\n",
111119
" )\n",
112120
" \n",
@@ -130,7 +138,7 @@
130138
],
131139
"metadata": {
132140
"kernelspec": {
133-
"display_name": "ionerdss_torch22",
141+
"display_name": "ovito-ionerdss-dev",
134142
"language": "python",
135143
"name": "python3"
136144
},
@@ -144,7 +152,7 @@
144152
"name": "python",
145153
"nbconvert_exporter": "python",
146154
"pygments_lexer": "ipython3",
147-
"version": "3.10.19"
155+
"version": "3.14.3"
148156
}
149157
},
150158
"nbformat": 4,

0 commit comments

Comments
 (0)