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.1.tar.gz (185.3 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.13 Windows x86-64

gsd-3.4.1-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.1-cp313-cp313-macosx_11_0_arm64.whl (259.3 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

gsd-3.4.1-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.1-cp312-cp312-win_amd64.whl (257.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

gsd-3.4.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (260.6 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

gsd-3.4.1-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.1-cp311-cp311-win_amd64.whl (259.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

gsd-3.4.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (261.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

gsd-3.4.1-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.1-cp310-cp310-win_amd64.whl (259.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

gsd-3.4.1-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.1-cp310-cp310-macosx_11_0_arm64.whl (261.1 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

gsd-3.4.1-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.1.tar.gz.

File metadata

  • Download URL: gsd-3.4.1.tar.gz
  • Upload date:
  • Size: 185.3 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.1.tar.gz
Algorithm Hash digest
SHA256 468e513da06bea35efc7013d2341fe2bd2e3fd3be4a9a600f71b4d31e5b2192a
MD5 5a7e86876c6ab4b4d7975f4f0813f032
BLAKE2b-256 b8a295f5a4e5448abe7ace23307691ffd815280eb1182566c396c3194a2672bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-3.4.1-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.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0758195efb2952e383201477edf056e7fb0996da94f213d181f1fce682d79da8
MD5 140353fe4df4aa26ba725ce93b16894f
BLAKE2b-256 5cdc395a82e7b0d56e6c614d3a716470853ffabb31d761e53ecffbb077ec260e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c1dd3d56ca1de14d10fc229f54d2d0b7bde6f2bc94207964a715e4d4fa2e57d
MD5 aa3c170943df7f71fc0d1c1a01e907bc
BLAKE2b-256 7cd9f5842768f78209cef3626528abb21bf96cac4713b1455bb5479560537c43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31b35d2730e97afd6273a887e4e334242c52706af49b171642b3e52339feea88
MD5 720774f163a71c1ee611dab92f517806
BLAKE2b-256 1b373a4f1443d16ba5bbacbca250485a4f35cae34f0744ac3edcc6d99840357f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a2be477717066fcac861778c6887e6f2a0a28f69e96797aad51884579b2b99a9
MD5 a935ff6a83230347c23b2bf6883c5b96
BLAKE2b-256 ae2d0892aa8c9f911f01c934bc5540692070eb356cb4adda7149b19ade4c7ff3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-3.4.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 257.7 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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7b98b8323c5c5f3512ccdc0f47e138dbf04a35fe509b33a95303c6c6ac895c6c
MD5 3451a580bcab13f625e5bf9b66a48900
BLAKE2b-256 863bf1507ff1eff77505e9bbb64c1e52e406e35bf3fb9d27fd3d81bd00241f6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fd36c0ae2656f4471ef7ce8d30584f8b5676c275085f23fc128896191fd21f79
MD5 73ac58d202ccd3c6f80e41ea0ddba782
BLAKE2b-256 8ae56987321a69729e0682949ee65bda12d74a3ed7ef4d80a206886a0dc560f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d5f87c77e245f335fe9cd0f190fe8a5ae71c4a4b8221892aeb9898c79df27ce
MD5 9c80d984bb230ed51dfbe3aebc91ea8e
BLAKE2b-256 0e0ec6571825ae307a7003f5c4f96bc112f866986405970aa0f833ac1dd53a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 912e52ea7f120f62cc9d01894ad4f999c74368450a405ec13d7dc73f7942b72e
MD5 e9e41118e26e00fe31f802fa71ef6720
BLAKE2b-256 09baa5c37bbba419c8ada9c2eccca68a56c5afd66423a25656ab5682b251d74d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-3.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 259.9 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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0e6a99922823144be44042d715ed5650b9e81dfae8068ef1205e40a5bb172418
MD5 f851c37335e8a210365413ff304089b5
BLAKE2b-256 dfaf180e1d59f414e99d8e1530c8b7a6299c017f2eebe88cab91bf85233316ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 76a175c441c34cc9a52c07ef69ec7d589c535bc18a8d72caf6769695ff8707ae
MD5 6fa9bcde152b0f85186c658c9fc96519
BLAKE2b-256 fe34fce489233167c4f8152591a1895e96adababd1f4e83608ae2565c5f7ad89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97b6337e3fde3955ea2290c411a26c2e35d1208f8ca90b8e3b223ecd606d56ca
MD5 58fb7e1f1b1e219a4a29aa8a903806da
BLAKE2b-256 bdd3a12230c8b0c4ce3e98b292d3f41e3d17e4dd9e0b258944b9ec1593c51f26

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f281e7f76e8a6d50cfc30d4899e65d7fa4b71ea99e91c5f614d4ff5497f27f9b
MD5 dcafdca9245b9e573c338829a1d07eab
BLAKE2b-256 99032e6a28fe16fa7a91085af31305e72c6b235d8455dd8229f7e039f7db70f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-3.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 259.8 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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e1cb7ab1b096343b78ab8eceaa92479f6b55be711291bc12b183c49e4c881a97
MD5 ad1a7cabcdcc807ce7c99fafc4d51b0c
BLAKE2b-256 11359a0f3d126b4c1d14b8ccd0939425cfa9f74d72308d330aeca6818510a866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01b152614e12f2c0db3784a5c8191c3d8b94742e18131813a0ade50f6f4913a9
MD5 9ec445cc96b2b4fce6673314f52025d2
BLAKE2b-256 93c24e67c334130d3fe837c140dbd8eeb70f730023bf9d529c2be7a9eaab820c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6f878d6668621bb0b5e95ea6c317eeabfc8edb55b5dbe650c500c8c80c93ab40
MD5 fbdb18fdc8abfcaee8cffb56ade3c85b
BLAKE2b-256 73fe2f69acd6251790314053127f7dc9b476ab6796e4940636467c7be984b2f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-3.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b799fb5266ab4a353b2040957ee2940c2909b8a2fa1a5474437675988eef82af
MD5 0eb5ea83dcaac313ac7a454d65ba6032
BLAKE2b-256 295afb67963f6796c2282f5a82651d1578c6a1e9cd748cf8ab70eefa866aa83e

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