Skip to main content

General simulation data file format.

Project description

GSD

The GSD file format is the native file format for HOOMD-blue. GSD files store trajectories of the HOOMD-blue system state in a binary file with efficient random access to frames. GSD allows all particle and topology properties to vary from one frame to the next. Use the GSD Python API to specify the initial condition for a HOOMD-blue simulation or analyze trajectory output with a script. Read a GSD trajectory with a visualization tool to explore the behavior of the simulation.

Resources

HOOMD examples

Create a hoomd gsd file.

>>> s = gsd.hoomd.Frame()
>>> s.particles.N = 4
>>> s.particles.types = ['A', 'B']
>>> s.particles.typeid = [0,0,1,1]
>>> s.particles.position = [[0,0,0],[1,1,1], [-1,-1,-1], [1,-1,-1]]
>>> s.configuration.box = [3, 3, 3, 0, 0, 0]
>>> traj = gsd.hoomd.open(name='test.gsd', mode='w')
>>> traj.append(s)

Append frames to a gsd file:

>>> def create_frame(i):
...     s = gsd.hoomd.Frame();
...     s.configuration.step = i;
...     s.particles.N = 4+i;
...     s.particles.position = numpy.random.random(size=(4+i,3))
...     return s;
>>> with gsd.hoomd.open('test.gsd', 'a') as t:
...     t.extend( (create_frame(i) for i in range(10)) )
...     print(len(t))
11

Randomly index frames:

>>> with gsd.hoomd.open('test.gsd', 'r') as t:
...     frame = t[5]
...     print(frame.configuration.step)
4
...     print(frame.particles.N)
8
...     print(frame.particles.position)
[[ 0.56993282  0.42243481  0.5502916 ]
 [ 0.36892486  0.38167036  0.27310368]
 [ 0.04739023  0.13603486  0.196539  ]
 [ 0.120232    0.91591144  0.99463677]
 [ 0.79806316  0.16991436  0.15228257]
 [ 0.13724308  0.14253527  0.02505   ]
 [ 0.39287439  0.82519054  0.01613089]
 [ 0.23150323  0.95167434  0.7715748 ]]

Slice frames:

>>> with gsd.hoomd.open('test.gsd', 'r') as t:
...     for s in t[5:-2]:
...         print(s.configuration.step, end=' ')
4 5 6 7

File layer examples

with gsd.fl.open(name='file.gsd', mode='w') as f:
    f.write_chunk(name='position', data=numpy.array([[1,2,3],[4,5,6]], dtype=numpy.float32));
    f.write_chunk(name='angle', data=numpy.array([0, 1], dtype=numpy.float32));
    f.write_chunk(name='box', data=numpy.array([10, 10, 10], dtype=numpy.float32));
    f.end_frame()
with gsd.fl.open(name='file.gsd', mode='r') as f:
    for i in range(1,f.nframes):
        position = f.read_chunk(frame=i, name='position');
        do_something(position);

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsd-3.4.2.tar.gz (185.4 kB view details)

Uploaded Source

Built Distributions

gsd-3.4.2-cp313-cp313-win_amd64.whl (257.0 kB view details)

Uploaded CPython 3.13 Windows x86-64

gsd-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (664.9 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

gsd-3.4.2-cp313-cp313-macosx_11_0_arm64.whl (259.4 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

gsd-3.4.2-cp313-cp313-macosx_10_13_x86_64.whl (263.1 kB view details)

Uploaded CPython 3.13 macOS 10.13+ x86-64

gsd-3.4.2-cp312-cp312-win_amd64.whl (257.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

gsd-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (669.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

gsd-3.4.2-cp312-cp312-macosx_11_0_arm64.whl (260.7 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

gsd-3.4.2-cp312-cp312-macosx_10_13_x86_64.whl (264.5 kB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

gsd-3.4.2-cp311-cp311-win_amd64.whl (260.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

gsd-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (667.1 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

gsd-3.4.2-cp311-cp311-macosx_11_0_arm64.whl (261.3 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

gsd-3.4.2-cp311-cp311-macosx_10_9_x86_64.whl (265.9 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

gsd-3.4.2-cp310-cp310-win_amd64.whl (259.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

gsd-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (644.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

gsd-3.4.2-cp310-cp310-macosx_11_0_arm64.whl (261.1 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

gsd-3.4.2-cp310-cp310-macosx_10_9_x86_64.whl (265.7 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file gsd-3.4.2.tar.gz.

File metadata

  • Download URL: gsd-3.4.2.tar.gz
  • Upload date:
  • Size: 185.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gsd-3.4.2.tar.gz
Algorithm Hash digest
SHA256 38bac42e4eedbd91ac5d2e9d18ab8978d16f10490f4268ef0e23d89a66d3d097
MD5 db56e329386c0448d8a63f05e0e605d2
BLAKE2b-256 1018db3bb11b186123afbdcacfd6b83a19c118e2d25f11b7de8792c8bf3ff313

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gsd-3.4.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 257.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gsd-3.4.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4832a659fed9a852f91b57c66cdd1991311a28a971728225d50de0d71bf76634
MD5 c7302c127b7ce32148d3cd154eff6886
BLAKE2b-256 a29cdc58ed4fa29b26fec3371adee4ded2baadb72c7471ae924910539a416d9e

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b16659c638c359ddf9877b97c3bcf516427f7e36ccb11178d7a9e5ef6dbfc037
MD5 7f5993ffd890203652796b2278bd2dd7
BLAKE2b-256 d05b5ecd1620815b25eee926e4f888e8f3e695fae46246d5ee7a402be710b061

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f427d4039dc1463750a976b44fa7be637f949337a03ce6de6ca7792461ba4a0
MD5 02ef8440fe2a95c7000062a1e83dd12a
BLAKE2b-256 236d6a30f4a67776b38f574cae8b9c47b34949fcf5adf0aa688dec9e441a9eef

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 457e2cff4032d3b151baa16dc33271e1050cd8923db85c89ce12d662d2ecff42
MD5 1025305023e5c4f1a3973b9e48a79511
BLAKE2b-256 9a5d565001039b87d76c728aec6b5dfa4f5e855cc9ff18cd4ca89d2ac74d6dd3

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gsd-3.4.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 257.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gsd-3.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cb80b7942533b924282120eaa68340f581a590011f95812bc7f5e30f174be7d5
MD5 712c2a0ac2dee5b2e8c356d8490e0b43
BLAKE2b-256 669f9eb99e403fb6f12da6289d303b2bc05bb85402cafdc416c5a0ac6a421e61

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8189bbdf65e7a74f6ea1578e2c05ea928ce65ada3fcb57ebe1470e42631c8e4c
MD5 d0587a1b20138e3e051f20b133e0dbc7
BLAKE2b-256 97aa4efef2d48c2da8757d86297515a409a3c819fc37189f9d8db9c6d66d7fd2

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 121b4bbc94a3a0156ad9ad3432db6de822465b7de823cfb07348a5a040e07d00
MD5 dea2f8fd222278d85357d8c650eb212b
BLAKE2b-256 f6b60eb7ad41bc0e882daea46c31963b29bad5d268134124d87a5d0d194cd90d

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0ef6336f1072ba47b7759ed02662fe33af87aa555174d69d0fcbb4fecfeed394
MD5 d3da6fa29f5d1cbac035f0f451be37ad
BLAKE2b-256 763203e33f01a64f1318cb436b6c32ff1b8ebbf2ad8f6b8bbce0211e5ff16085

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gsd-3.4.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 260.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gsd-3.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e9ee56a15f50749d88a6f1d75707ec0fe44a1a521088b9cb5aac1999e6d6fd54
MD5 f8da12fa1bdd131258b7563cfd5cd787
BLAKE2b-256 55b7dfc893fd087cf9254203df8e8f1b44ad0b170b4d512c6fceadf6629fae1c

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 698e64514a576d86800b6646d6a79562232646495af08629548ca9c51db4f8f0
MD5 513887a18bbaf1fe370bea629d076d6e
BLAKE2b-256 d798a28b905c21ff88a7ca5d9dcb6be83d3366a8f177f9c481ccd89f8e3555f8

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 88139f669fabfc07b259ed1985b59fe8fcafe7c0aad0cebbba17150957a0ce4b
MD5 f910201ebe2a07f8836190aa609d907b
BLAKE2b-256 68753fa57df8aff1f64e02d4154b07d66df87070fd45c206cce04cca6c54959a

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 05ac5b9bf47bdd3cf8a6d8cf7673a6d38b1de8fbfdb9dcdb0071db1467b38ade
MD5 a1fc44f7df88585f9d54903b643a8503
BLAKE2b-256 6bcec54fddd65eb4554f568eac83b676f181863c1b412d53762add86db2ab60a

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: gsd-3.4.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 259.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gsd-3.4.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6adf113997643590d52638ab872105a6cb797b659bdbcd06407625b8eadbce9d
MD5 97225bb3e7ce520f85c21b4d9e4b7abc
BLAKE2b-256 fcac8f214150fda3ee8a5cfc05ae75fedb0de21819dd3c4353994a0dfa68b953

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fdb9700478003032cbc2804089a5cdf6f905ea24942a97cd5abfecd59135612f
MD5 c0938973c8fbdc8f09e20fbb7bb8e7ef
BLAKE2b-256 d19dc6931917cd3efc5d17b1683d241ab2aa768d0855e3667838b9bfcf33708d

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 045cd28a2dd1acdc11d961aeb5586a55d333ac5d900074fdc10dca2deda039a6
MD5 491764ad1797edeec14241781048b44b
BLAKE2b-256 12176b4a9b44cc08774029ed2970c9e7429f1c93e18a1c274389f75c732ed863

See more details on using hashes here.

File details

Details for the file gsd-3.4.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for gsd-3.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 21e9eec1c3ce29bb578e1369227e7ea9ba8c1fc1922e820475a21cbc63870f2f
MD5 403a88b043fa7ee7ed6e901390427c1d
BLAKE2b-256 fe46824a54e962fc0353e1f1803fdb6ab23a01fdacc55e76bb1131a944fed56e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page