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

Uploaded Source

Built Distributions

gsd-4.0.0-cp313-cp313-win_amd64.whl (259.4 kB view details)

Uploaded CPython 3.13Windows x86-64

gsd-4.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (677.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

gsd-4.0.0-cp313-cp313-macosx_11_0_arm64.whl (260.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gsd-4.0.0-cp313-cp313-macosx_10_13_x86_64.whl (264.5 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

gsd-4.0.0-cp312-cp312-win_amd64.whl (260.1 kB view details)

Uploaded CPython 3.12Windows x86-64

gsd-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (682.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

gsd-4.0.0-cp312-cp312-macosx_11_0_arm64.whl (261.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gsd-4.0.0-cp312-cp312-macosx_10_13_x86_64.whl (265.3 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

gsd-4.0.0-cp311-cp311-win_amd64.whl (261.6 kB view details)

Uploaded CPython 3.11Windows x86-64

gsd-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (687.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

gsd-4.0.0-cp311-cp311-macosx_11_0_arm64.whl (262.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gsd-4.0.0-cp311-cp311-macosx_10_9_x86_64.whl (267.7 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

gsd-4.0.0-cp310-cp310-win_amd64.whl (261.6 kB view details)

Uploaded CPython 3.10Windows x86-64

gsd-4.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (656.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

gsd-4.0.0-cp310-cp310-macosx_11_0_arm64.whl (262.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

gsd-4.0.0-cp310-cp310-macosx_10_9_x86_64.whl (266.7 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: gsd-4.0.0.tar.gz
  • Upload date:
  • Size: 192.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0.tar.gz
Algorithm Hash digest
SHA256 1575bd1452c812c7546ab3f2c0726be9a1340fe3a4f2c88298b3361d3b6e73d8
MD5 50cd291b3c88a3e8001bdfa8b1234228
BLAKE2b-256 1a4901efb80a99d75946887c47759c7c43f63ce985c5d0827d6361b710b4a756

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 259.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 14a1bcba7088130bc3ae7a4f77618685644ac04d66357fa43e025ec316053cc1
MD5 a32b757f6d553cf652d00750d2584586
BLAKE2b-256 ecb06dc47dcfb7439496092b57eb678bccfecf43ac617a8399a90440a2ac8f02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2453137d63cc85e1559a88b6f69527513152a782130198ed6e77a976dac27f43
MD5 b2e13f138ce2a9a753e48f859712498c
BLAKE2b-256 2ab3105f4421714979b903cea27fd38071f5c98adcd46f6ea0a507c5e110eb96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 260.5 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51d41a4bfd324b56dd6bdfaa3b1b922ee6c5f97222d6a4e4f332c804931bd8f9
MD5 88a970725dc6b2f0475abbe0342d6d24
BLAKE2b-256 1c75d1e45516be7681fb82a3f0224aed42ce711735e8201d58371facfd61200f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6b89e183b8750a1694d4b9a08ae3e75a0cd1e6e549ce9e2b00ec406cdad99bca
MD5 6eccd38eee3862d4e6ec425630d9433c
BLAKE2b-256 ba5fe25676b9740fc6aee408711aab3bbb91df7f225f85919e63d015075bba0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 260.1 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b751d342bab4aaa13f2d5d623f8af534006715b7d91bdbfb82d225a3d5d4048
MD5 36d53399b01ed22041a4ac1f057a79da
BLAKE2b-256 337ea5e5eb702fb63d2af47753cf007212a1467873d27c0ce51691bd84fe054b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d61cdafc56e955bda0e372201c6372407ba490a0db498fd2004339db57894f8
MD5 0e78265426e9ab0888f8b09da1b31e69
BLAKE2b-256 eee8f4951529167229b335ff64511787dbe0980887f7557ef8d7e08afd0f4efa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 261.3 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65089f688471a7801a220b6eca56af0664bc61283a7af353bb48bbbf8f451584
MD5 370f89e0409398c5da98a96fc5c44bc9
BLAKE2b-256 0bc2ec3191d8868abd6ce11e80997baa528a8626dd35c930331aaedd7476ed3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e6dacddb4c21c37ad7d5e9a5075bfaff533ed4485c30a02b873acac081245cb2
MD5 596754777dc1553d4aa41c51ee96e983
BLAKE2b-256 4a497dfc60df6963daac20c0f42a1658bbac8f33a38d457cd6ef66829f58b60f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 261.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a91374554857b637bb37ba5b54180bbdd0aaca842990e7eeea366347cac68831
MD5 09f2bddcd023f1c7337e8b78bc6cce48
BLAKE2b-256 36c1a55934ce76f33ccff20ad99e1203fe18da89878e70281bffe980f7a26ed2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b518cfc2fe6abd7c06d636d892c330dec11a1f038c7a8d4fe5d23a54a9ff37e
MD5 c7b56e645462ff9ac762ce29031c26d2
BLAKE2b-256 06529c19de779b51af4e3d947fd02dab424f9dd772288b28f65fbc03134ece47

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 262.7 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 62a2553a61e8ef361d7b9387bcc7e9625432a4b7785eba570b59e2d8449dae37
MD5 b3142cfb19367fc61bf8b4c0b25c07ee
BLAKE2b-256 c8d79415a512c65391d12072cacdeda4b15f2e94598a50ae803ac1d10b703538

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 45930efdf74b641e568de520d34bf552e8e32e9e7d9257a969f4578175d05f26
MD5 786550c2ca5f5ced464ba883c2dde8dd
BLAKE2b-256 8b5fd3da871da0da8084c46ad07b892afe6c0f230f7e91984b5f95f37dfcc1b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 261.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 837c92e0e834111e02b0fd976ecd33cd7c253233c7f116b3c557ecfa9e02e5b9
MD5 dda76ee40c659f01598cec59d9b3cb96
BLAKE2b-256 2501a52afaebebc9b91345381fcb0b8db9ba31d4f92d8d3c12dd761fae31f286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c7b61debee4c6ca6829ef37df74a3b1bd07f2fcff685f49128cc9fc7d15225f
MD5 154e61895d2eb30b7952491dcd8dac49
BLAKE2b-256 6f790b87be1f9f0aa9ccd0e4c8c7992d4b77e212c1e297ae638a17ab07877754

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gsd-4.0.0-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 262.1 kB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsd-4.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee4e6f85fb43b1d7eb37bda6e49981e16ad3ac0202f3909c6fec23d808fc7ec9
MD5 b134d3c1d9798668cda740e1a261979d
BLAKE2b-256 e878a446ea03791fbdacd8acdc3f2fd0200bd22221dcbc1033a0199cecff0cf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gsd-4.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c2d98441f0d34d3af0769fc1f72ffeb2d71ba404ed4e2a64ad79794ab92cff86
MD5 05656e89d08a191d106a0f264151ee35
BLAKE2b-256 5b3e24985d0d715e07660bc00878e91652530a1062d06a3c72dea715f54d4cbc

See more details on using hashes here.

Supported by

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