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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gsd-5.0.0-cp311-abi3-win_amd64.whl (261.3 kB view details)

Uploaded CPython 3.11+Windows x86-64

gsd-5.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (606.0 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

gsd-5.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (595.2 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

gsd-5.0.0-cp311-abi3-macosx_11_0_arm64.whl (267.7 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

gsd-5.0.0-cp311-abi3-macosx_10_9_x86_64.whl (265.4 kB view details)

Uploaded CPython 3.11+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: gsd-5.0.0.tar.gz
  • Upload date:
  • Size: 202.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gsd-5.0.0.tar.gz
Algorithm Hash digest
SHA256 985f876ed68c6e78ac2339470ecae4a129639a81a2fe72a90b442e415541b790
MD5 e8e3f83cd7c9822ad6cefe211c18aecd
BLAKE2b-256 ab09029e428bf53ff7ecddb35c77f66d8593f776e1e34b07b6bb7f8b1df511c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0.tar.gz:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsd-5.0.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: gsd-5.0.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 261.3 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gsd-5.0.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 10bf59522cf9f78db052bc9958fee505425b0689c2749f4a34434290614292ce
MD5 d9eab9e3f02746c351cada59a08ff93e
BLAKE2b-256 8aff73f5b00e4a0be6556d51873643543e8c12581295a14549b02a84056cc029

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0-cp311-abi3-win_amd64.whl:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsd-5.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gsd-5.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1793229fe6ee8788fe3e22827ea91c44f64079b446ac7d50adbf9c545f5ebdb5
MD5 fff321e1a5c93a81ff8611b20ea2461d
BLAKE2b-256 479c988c599b0b62f01562f174462ddfdbfa3e3977d14a125e19d3d74c54bb95

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsd-5.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for gsd-5.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d117552b045bee3fd5e91fe6904e3444c866563448780ddec9b3e8375fd9d353
MD5 567f075ac1ea2d2850e04f050dc6cf2e
BLAKE2b-256 6baedec8ece5fa86e8991d6f5584f8ebf425f730182e441878b8d8531989a422

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsd-5.0.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gsd-5.0.0-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 267.7 kB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gsd-5.0.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73ae1b7c6c7b188ed91ac43a729c6d6d2e520715624fbbfa2fbfae54aea0ad40
MD5 c4877d23f49ce9bdb24ca201ae2cf678
BLAKE2b-256 cceaf9b1378be427521482e30b0193f54ea8dc83b300c98485ffaaad64a129c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsd-5.0.0-cp311-abi3-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: gsd-5.0.0-cp311-abi3-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 265.4 kB
  • Tags: CPython 3.11+, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gsd-5.0.0-cp311-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a7f01e489923a53251dd2322bec9a119651231db933ae522aa9caa88a24a7575
MD5 d4c8eef7aa1331cc97f2a23726811f3a
BLAKE2b-256 bc2892d259a777c73c28cfd41235ebf859588e10dcff196276c4cf627559f6c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsd-5.0.0-cp311-abi3-macosx_10_9_x86_64.whl:

Publisher: build_wheels.yaml on glotzerlab/gsd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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