{"id":21140892,"url":"https://github.com/glotzerlab/gsd","last_synced_at":"2025-04-06T13:09:32.874Z","repository":{"id":38150816,"uuid":"147664770","full_name":"glotzerlab/gsd","owner":"glotzerlab","description":"Read and write GSD files for use with HOOMD-blue.","archived":false,"fork":false,"pushed_at":"2025-03-04T19:33:36.000Z","size":2438,"stargazers_count":25,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"trunk-patch","last_synced_at":"2025-03-30T12:07:27.489Z","etag":null,"topics":["binary","file-format","gsd","hoomd","python"],"latest_commit_sha":null,"homepage":"http://gsd.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glotzerlab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-06T11:40:13.000Z","updated_at":"2025-03-04T19:33:32.000Z","dependencies_parsed_at":"2023-02-17T23:45:54.680Z","dependency_job_id":"cf9b142f-7475-428a-b885-77e33ef5af97","html_url":"https://github.com/glotzerlab/gsd","commit_stats":{"total_commits":1387,"total_committers":15,"mean_commits":92.46666666666667,"dds":"0.21845710165825527","last_synced_commit":"ad2417d0dbc455d1fb5aab525a919b36bc7f0851"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glotzerlab%2Fgsd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glotzerlab%2Fgsd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glotzerlab%2Fgsd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glotzerlab%2Fgsd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glotzerlab","download_url":"https://codeload.github.com/glotzerlab/gsd/tar.gz/refs/heads/trunk-patch","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485287,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","file-format","gsd","hoomd","python"],"created_at":"2024-11-20T07:18:43.869Z","updated_at":"2025-04-06T13:09:32.853Z","avatar_url":"https://github.com/glotzerlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u003e\u003e\u003e s = gsd.hoomd.Frame()\n\u003e\u003e\u003e s.particles.N = 4\n\u003e\u003e\u003e s.particles.types = ['A', 'B']\n\u003e\u003e\u003e s.particles.typeid = [0,0,1,1]\n\u003e\u003e\u003e s.particles.position = [[0,0,0],[1,1,1], [-1,-1,-1], [1,-1,-1]]\n\u003e\u003e\u003e s.configuration.box = [3, 3, 3, 0, 0, 0]\n\u003e\u003e\u003e traj = gsd.hoomd.open(name='test.gsd', mode='w')\n\u003e\u003e\u003e traj.append(s)\n```\n\nAppend frames to a gsd file:\n```python\n\u003e\u003e\u003e 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\u003e\u003e\u003e 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\u003e\u003e\u003e 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\u003e\u003e\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglotzerlab%2Fgsd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglotzerlab%2Fgsd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglotzerlab%2Fgsd/lists"}