--- /tmp/python-gsd-2.4.0-1othdajbb/debian/python-gsd-doc_2.4.0-1_all.deb +++ python-gsd-doc_2.4.0-1_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2020-12-28 05:06:26.000000 debian-binary │ --rw-r--r-- 0 0 0 2360 2020-12-28 05:06:26.000000 control.tar.xz │ --rw-r--r-- 0 0 0 77900 2020-12-28 05:06:26.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 2364 2020-12-28 05:06:26.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 77880 2020-12-28 05:06:26.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -59,15 +59,15 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 7523 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/py-modindex.html │ │ │ -rw-r--r-- 0 root (0) root (0) 11575 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/python-api.html │ │ │ -rw-r--r-- 0 root (0) root (0) 79196 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/python-module-gsd.fl.html │ │ │ -rw-r--r-- 0 root (0) root (0) 61626 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/python-module-gsd.hoomd.html │ │ │ -rw-r--r-- 0 root (0) root (0) 31726 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/python-module-gsd.pygsd.html │ │ │ -rw-r--r-- 0 root (0) root (0) 90713 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/schema-hoomd.html │ │ │ -rw-r--r-- 0 root (0) root (0) 6369 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 30365 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/searchindex.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 30357 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/searchindex.js │ │ │ -rw-r--r-- 0 root (0) root (0) 23188 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/shapes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 10493 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/specification.html │ │ │ -rw-r--r-- 0 root (0) root (0) 14480 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/style.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2020-12-28 05:06:26.000000 ./usr/share/doc-base/ │ │ │ -rw-r--r-- 0 root (0) root (0) 331 2020-12-28 05:06:26.000000 ./usr/share/doc-base/python-gsd │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/_static/css/badge_only.css -> ../../../../../sphinx_rtd_theme/static/css/badge_only.css │ │ │ lrwxrwxrwx 0 root (0) root (0) 0 2020-12-28 05:06:26.000000 ./usr/share/doc/python-gsd-doc/html/_static/css/theme.css -> ../../../../../sphinx_rtd_theme/static/css/theme.css │ │ ├── ./usr/share/doc/python-gsd-doc/html/hoomd-examples.html │ │ │ @@ -269,23 +269,23 @@ │ │ │ Out[15]: 5 │ │ │ │ │ │ In [16]: snap.particles.N │ │ │ Out[16]: 9 │ │ │ │ │ │ In [17]: snap.particles.position │ │ │ Out[17]: │ │ │ -array([[0.1515945 , 0.9367704 , 0.7333441 ], │ │ │ - [0.22183327, 0.8472343 , 0.2952421 ], │ │ │ - [0.18101802, 0.7819205 , 0.06482629], │ │ │ - [0.26719517, 0.10655784, 0.42947844], │ │ │ - [0.48632932, 0.9129343 , 0.31790936], │ │ │ - [0.54367846, 0.37702993, 0.9305233 ], │ │ │ - [0.06567983, 0.37675926, 0.10647734], │ │ │ - [0.16555822, 0.58414435, 0.9748487 ], │ │ │ - [0.41807753, 0.86105645, 0.682212 ]], dtype=float32) │ │ │ +array([[0.5405593 , 0.5722708 , 0.4701502 ], │ │ │ + [0.29569134, 0.5842861 , 0.49971431], │ │ │ + [0.67213047, 0.7922957 , 0.93056166], │ │ │ + [0.9340422 , 0.7365758 , 0.00609643], │ │ │ + [0.3664226 , 0.6803624 , 0.5221259 ], │ │ │ + [0.2420243 , 0.8594084 , 0.62655467], │ │ │ + [0.2660042 , 0.98055583, 0.9364223 ], │ │ │ + [0.5265993 , 0.720935 , 0.11014222], │ │ │ + [0.02007882, 0.1304521 , 0.84817755]], dtype=float32) │ │ │ │ │ │ │ │ │
gsd.hoomd.HOOMDTrajectory
supports random indexing of frames in the file.
│ │ │ Indexing into a trajectory returns a gsd.hoomd.Snapshot
.
In [22]: f = gsd.pygsd.GSDFile(open('test.gsd', 'rb'))
│ │ │
│ │ │ In [23]: t = gsd.hoomd.HOOMDTrajectory(f);
│ │ │
│ │ │ In [24]: t[3].particles.position
│ │ │ Out[24]:
│ │ │ -array([[0.31554416, 0.69834286, 0.62656426],
│ │ │ - [0.207277 , 0.7095887 , 0.5119474 ],
│ │ │ - [0.9295063 , 0.24987099, 0.99276304],
│ │ │ - [0.19698831, 0.797265 , 0.82159126],
│ │ │ - [0.08496086, 0.25481674, 0.02251194],
│ │ │ - [0.57570314, 0.5168436 , 0.31220824],
│ │ │ - [0.11610101, 0.8083972 , 0.39738587]], dtype=float32)
│ │ │ +array([[0.27117798, 0.06008662, 0.4838825 ],
│ │ │ + [0.3875501 , 0.8122152 , 0.33295023],
│ │ │ + [0.26338187, 0.4601376 , 0.7458597 ],
│ │ │ + [0.6132266 , 0.09925145, 0.36877984],
│ │ │ + [0.56911635, 0.42662457, 0.8599034 ],
│ │ │ + [0.81568044, 0.6825648 , 0.26028672],
│ │ │ + [0.7265003 , 0.55404186, 0.7168279 ]], dtype=float32)
│ │ │
You can use GSD without needing to compile C code to read GSD files
│ │ │ using gsd.pygsd.GSDFile
in combination with gsd.hoomd.HOOMDTrajectory
. It
│ │ │ only supports the rb
mode and does not read files as fast as the C
│ │ │ implementation. It takes in a python file-like object, so it can be used with
│ │ │ in-memory IO classes, and grid file classes that access data over the internet.