gsd


Namegsd JSON
Version 4.2.0 PyPI version JSON
download
home_pageNone
SummaryGeneral simulation data file format.
upload_time2025-10-07 23:30:45
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GSD

The **GSD** file format is the native file format for [HOOMD-blue](https://glotzerlab.engin.umich.edu/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

* [GSD documentation](http://gsd.readthedocs.io): Tutorials, Python API, C API, usage information, and format
  specification.
* [Installation Guide](INSTALLING.rst): Instructions for installing and compiling **GSD**.
* [HOOMD-blue](https://glotzerlab.engin.umich.edu/hoomd-blue/): Simulation engine that reads and writes **GSD** files.
* [GSD discussion board](https://github.com/glotzerlab/gsd/discussions/):
  Ask the **GSD** community for help.
* [freud](https://freud.readthedocs.io): A powerful set of tools for analyzing trajectories.
* [OVITO](https://www.ovito.org/): The Open Visualization Tool works with **GSD** files.
* [gsd-vmd plugin](https://github.com/mphoward/gsd-vmd): VMD plugin to support **GSD** files.

## HOOMD examples

Create a hoomd gsd file.
```python
>>> 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:
```python
>>> 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:
```python
>>> 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:
```python
>>> 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

```python
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()
```

```python
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);
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gsd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "\"Joshua A. Anderson\" <joaander@umich.edu>",
    "download_url": "https://files.pythonhosted.org/packages/15/fb/9d4d99d7a456f830660112b9c369fb4281793f8284f99ca9b2bfabcd4ed5/gsd-4.2.0.tar.gz",
    "platform": null,
    "description": "# GSD\n\nThe **GSD** file format is the native file format for [HOOMD-blue](https://glotzerlab.engin.umich.edu/hoomd-blue/).\n**GSD** files store trajectories of the **HOOMD-blue** system state in a binary file with efficient random access to\nframes. **GSD** allows all particle and topology properties to vary from one frame to the next. Use the **GSD** Python\nAPI to specify the initial condition for a **HOOMD-blue** simulation or analyze trajectory output with a script. Read a\n**GSD** trajectory with a visualization tool to explore the behavior of the simulation.\n\n## Resources\n\n* [GSD documentation](http://gsd.readthedocs.io): Tutorials, Python API, C API, usage information, and format\n  specification.\n* [Installation Guide](INSTALLING.rst): Instructions for installing and compiling **GSD**.\n* [HOOMD-blue](https://glotzerlab.engin.umich.edu/hoomd-blue/): Simulation engine that reads and writes **GSD** files.\n* [GSD discussion board](https://github.com/glotzerlab/gsd/discussions/):\n  Ask the **GSD** community for help.\n* [freud](https://freud.readthedocs.io): A powerful set of tools for analyzing trajectories.\n* [OVITO](https://www.ovito.org/): The Open Visualization Tool works with **GSD** files.\n* [gsd-vmd plugin](https://github.com/mphoward/gsd-vmd): VMD plugin to support **GSD** files.\n\n## HOOMD examples\n\nCreate a hoomd gsd file.\n```python\n>>> s = gsd.hoomd.Frame()\n>>> s.particles.N = 4\n>>> s.particles.types = ['A', 'B']\n>>> s.particles.typeid = [0,0,1,1]\n>>> s.particles.position = [[0,0,0],[1,1,1], [-1,-1,-1], [1,-1,-1]]\n>>> s.configuration.box = [3, 3, 3, 0, 0, 0]\n>>> traj = gsd.hoomd.open(name='test.gsd', mode='w')\n>>> traj.append(s)\n```\n\nAppend frames to a gsd file:\n```python\n>>> def create_frame(i):\n...     s = gsd.hoomd.Frame();\n...     s.configuration.step = i;\n...     s.particles.N = 4+i;\n...     s.particles.position = numpy.random.random(size=(4+i,3))\n...     return s;\n>>> with gsd.hoomd.open('test.gsd', 'a') as t:\n...     t.extend( (create_frame(i) for i in range(10)) )\n...     print(len(t))\n11\n```\n\nRandomly index frames:\n```python\n>>> with gsd.hoomd.open('test.gsd', 'r') as t:\n...     frame = t[5]\n...     print(frame.configuration.step)\n4\n...     print(frame.particles.N)\n8\n...     print(frame.particles.position)\n[[ 0.56993282  0.42243481  0.5502916 ]\n [ 0.36892486  0.38167036  0.27310368]\n [ 0.04739023  0.13603486  0.196539  ]\n [ 0.120232    0.91591144  0.99463677]\n [ 0.79806316  0.16991436  0.15228257]\n [ 0.13724308  0.14253527  0.02505   ]\n [ 0.39287439  0.82519054  0.01613089]\n [ 0.23150323  0.95167434  0.7715748 ]]\n```\n\nSlice frames:\n```python\n>>> with gsd.hoomd.open('test.gsd', 'r') as t:\n...     for s in t[5:-2]:\n...         print(s.configuration.step, end=' ')\n4 5 6 7\n```\n\n## File layer examples\n\n```python\nwith gsd.fl.open(name='file.gsd', mode='w') as f:\n    f.write_chunk(name='position', data=numpy.array([[1,2,3],[4,5,6]], dtype=numpy.float32));\n    f.write_chunk(name='angle', data=numpy.array([0, 1], dtype=numpy.float32));\n    f.write_chunk(name='box', data=numpy.array([10, 10, 10], dtype=numpy.float32));\n    f.end_frame()\n```\n\n```python\nwith gsd.fl.open(name='file.gsd', mode='r') as f:\n    for i in range(1,f.nframes):\n        position = f.read_chunk(frame=i, name='position');\n        do_something(position);\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "General simulation data file format.",
    "version": "4.2.0",
    "project_urls": {
        "Documentation": "https://gsd.readthedocs.io",
        "Homepage": "https://gsd.readthedocs.io",
        "Issues": "https://github.com/glotzerlab/gsd/issues",
        "Source": "https://github.com/glotzerlab/gsd"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c8a0a55e9b178d65eb00eac02bf94612f89f9d859f683d68f4a80b64a8267d9c",
                "md5": "c7440856291375ca4d8cafcb09a37b84",
                "sha256": "f97d41eb780c1635180c6df934977280252307fa1ecfc84c4d73d87e27cfb56b"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0-cp311-abi3-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "c7440856291375ca4d8cafcb09a37b84",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.11",
            "size": 262709,
            "upload_time": "2025-10-07T23:30:39",
            "upload_time_iso_8601": "2025-10-07T23:30:39.167863Z",
            "url": "https://files.pythonhosted.org/packages/c8/a0/a55e9b178d65eb00eac02bf94612f89f9d859f683d68f4a80b64a8267d9c/gsd-4.2.0-cp311-abi3-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "20b20808049f31b207ea4909c4ecfabca809e1f8f030933c5397905c86dd08e7",
                "md5": "2c938554db6485305f8d38131c3e0454",
                "sha256": "86044ad658665486abc50a0b60322e9d502f1e15c438c40977d8afccb0117934"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0-cp311-abi3-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "2c938554db6485305f8d38131c3e0454",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.11",
            "size": 264624,
            "upload_time": "2025-10-07T23:30:40",
            "upload_time_iso_8601": "2025-10-07T23:30:40.775454Z",
            "url": "https://files.pythonhosted.org/packages/20/b2/0808049f31b207ea4909c4ecfabca809e1f8f030933c5397905c86dd08e7/gsd-4.2.0-cp311-abi3-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "218a8dc6019a8cb5513c22d07d99669a1e77f76369d82144d3f37f5e1125ac19",
                "md5": "b3e101b0d877a12d198d39173d90ee1d",
                "sha256": "46a9dfa772131c57d0ee3f390a72b809e29bb91cb569f31883d324ed7343650a"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "b3e101b0d877a12d198d39173d90ee1d",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.11",
            "size": 606287,
            "upload_time": "2025-10-07T23:30:42",
            "upload_time_iso_8601": "2025-10-07T23:30:42.101897Z",
            "url": "https://files.pythonhosted.org/packages/21/8a/8dc6019a8cb5513c22d07d99669a1e77f76369d82144d3f37f5e1125ac19/gsd-4.2.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "180713885db43a85efe6ff9e67f54d416efd3cb50de5ee18ab176b288c91e4b8",
                "md5": "5160558cb5aa0da9dd23afa9a0e51733",
                "sha256": "7bb37fe16926377e479c1c3a8ff9817d160a085231bf7fc9fb9a9cfee97fdb07"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5160558cb5aa0da9dd23afa9a0e51733",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.11",
            "size": 619077,
            "upload_time": "2025-10-07T23:30:43",
            "upload_time_iso_8601": "2025-10-07T23:30:43.155644Z",
            "url": "https://files.pythonhosted.org/packages/18/07/13885db43a85efe6ff9e67f54d416efd3cb50de5ee18ab176b288c91e4b8/gsd-4.2.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "63a78d13240a109b9f73d5723565eca024c087d0e7cbad6ac096598acaeb4421",
                "md5": "6fa278d924747c7a1a1d865821370f11",
                "sha256": "3ebb1b58cb2bd2f9527e4295dc79f3188221ef21242de4e5c042825833f838b2"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0-cp311-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "6fa278d924747c7a1a1d865821370f11",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.11",
            "size": 256684,
            "upload_time": "2025-10-07T23:30:44",
            "upload_time_iso_8601": "2025-10-07T23:30:44.634567Z",
            "url": "https://files.pythonhosted.org/packages/63/a7/8d13240a109b9f73d5723565eca024c087d0e7cbad6ac096598acaeb4421/gsd-4.2.0-cp311-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "15fb9d4d99d7a456f830660112b9c369fb4281793f8284f99ca9b2bfabcd4ed5",
                "md5": "10e0410175b525bfca8c7aa2651ccbe9",
                "sha256": "eb197abd735e98817bcdc1ee34e4968231d572da48c097b3ccf316be828cf86a"
            },
            "downloads": -1,
            "filename": "gsd-4.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "10e0410175b525bfca8c7aa2651ccbe9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 193260,
            "upload_time": "2025-10-07T23:30:45",
            "upload_time_iso_8601": "2025-10-07T23:30:45.487514Z",
            "url": "https://files.pythonhosted.org/packages/15/fb/9d4d99d7a456f830660112b9c369fb4281793f8284f99ca9b2bfabcd4ed5/gsd-4.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 23:30:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "glotzerlab",
    "github_project": "gsd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gsd"
}
        
Elapsed time: 2.24527s