glotzerlab / gsd Goto Github PK
View Code? Open in Web Editor NEWRead and write GSD files for use with HOOMD-blue.
Home Page: http://gsd.readthedocs.io
License: BSD 2-Clause "Simplified" License
Read and write GSD files for use with HOOMD-blue.
Home Page: http://gsd.readthedocs.io
License: BSD 2-Clause "Simplified" License
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
with the new forcecomposite design, the body field is still needed for proper restarts. Also, users may find it useful to detect constituent particles during analysis.
Original report by stukowski (Bitbucket: stukowski, GitHub: stukowski).
It looks like the gsd_open() function leaves the file open after returning with an error code. Consider the following code:
#!c++
gsd_handle handle;
if(gsd_open(&handle, "not_a_gsd_file.txt", GSD_OPEN_READONLY) != 0)
return;
...
Calling gsd_close() after the failed call to gsd_open() doesn't help either.
I am the developer of the OVITO software, which uses the GSD I/O layer to read HOOMD simulation files. As part of the file format auto-detection feature, OVITO routinely calls gsd_open() on files that are not GSD files. I noticed this problem when the maximum number of open files allowed by the OS was reached by the process.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
We need an MPI_IO version of the API to support scalable writes and reads.
Original report by Dominik Mierzejewski (Bitbucket: rathann, GitHub: rathann).
README.md doesn't say that in order to run nose tests, python 3.2 or later is required due to the usage of tempfile.TemporaryDirectory
, which was introduced in python 3.2.
As a result, tests fail when run under python 2.7:
+ nosetests-2.7
nose.config: INFO: Set working dir to /builddir/build/BUILD/gsd-v1.5.0/tests
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
test_fl.test_create ... ERROR
test_fl.test_dtypes(<type 'numpy.uint8'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.uint16'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.uint32'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.uint64'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.int8'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.int16'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.int32'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.int64'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.float32'>,) ... ERROR
test_fl.test_dtypes(<type 'numpy.float64'>,) ... ERROR
test_fl.test_metadata ... ERROR
test_fl.test_append ... ERROR
test_fl.test_chunk_exists ... ERROR
test_fl.test_readonly_errors ... ERROR
test_fl.test_fileio_errors ... ERROR
test_fl.test_dtype_errors ... ERROR
test_fl.test_truncate ... ERROR
test_fl.test_namelen ... ERROR
test_fl.test_open ... ERROR
test_hoomd.test_create ... ERROR
test_hoomd.test_append ... ERROR
test_hoomd.test_extend ... ERROR
test_hoomd.test_defaults ... ERROR
test_hoomd.test_fallback ... ERROR
test_hoomd.test_fallback2 ... ERROR
test_hoomd.test_iteration ... ERROR
test_hoomd.test_truncate ... ERROR
test_hoomd.test_state ... ERROR
======================================================================
ERROR: test_fl.test_create
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 12, in test_create
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.uint8'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.uint16'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.uint32'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.uint64'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.int8'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.int16'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.int32'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.int64'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.float32'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtypes(<type 'numpy.float64'>,)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 24, in check_dtype
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_metadata
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 52, in test_metadata
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_append
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 83, in test_append
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_chunk_exists
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 116, in test_chunk_exists
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_readonly_errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 186, in test_readonly_errors
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_fileio_errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 218, in test_fileio_errors
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_dtype_errors
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 226, in test_dtype_errors
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_truncate
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 258, in test_truncate
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_namelen
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 288, in test_namelen
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_fl.test_open
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_fl.py", line 312, in test_open
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_create
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 11, in test_create
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_append
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 20, in test_append
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_extend
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 41, in test_extend
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_defaults
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 55, in test_defaults
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_fallback
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 119, in test_fallback
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_fallback2
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 335, in test_fallback2
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_iteration
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 361, in test_iteration
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_truncate
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 392, in test_truncate
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
======================================================================
ERROR: test_hoomd.test_state
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/builddir/build/BUILD/gsd-v1.5.0/tests/test_hoomd.py", line 408, in test_state
with tempfile.TemporaryDirectory() as d:
AttributeError: 'module' object has no attribute 'TemporaryDirectory'
----------------------------------------------------------------------
Ran 29 tests in 0.064s
FAILED (errors=29)
Original report by Max Linke (Bitbucket: max_linke, ).
I just published my first package on pypi following this guide.
I was also able to generate a source distribution and wheel package for gsd following the guide (wheels aren't publishable due to libc version issues though). I only made a few changes to the MANIFEST.in from the pypi branch (adding changelog and readme into the includes). To generate the source distribution I ran
#!bash
python setup.py sdist
This will produce a file dist/gsd-version.tar.gz
. You can check this archive if all necessary files are included to build gsd.
publishing a source distribution should be straight forward with this.
I reduced the guide cited above into a short list of commands for myself that I can follow for a release.
https://github.com/bio-phys/MDBenchmark/blob/master/DEVELOPER.rst
note: I'm a core-dev of MDAnalysis
note: If Hoomd writes performance data into log files I'm happy to try include it in my little benchmark utility.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Hello,
I'm trying to use the gsd.hoomd in Windows 10 but have been experiencing the following problem. I think I installed the gsd module correctly but can't use gsd.hoomd.open. The error message was "file layer module is not available". Can anyone please give me some advice if you have had this problem before?
Thanks,
Insung Han
Original report by Richard Gowers (Bitbucket: rgowers, ).
Hello
I'm trying to build gsd and I get the following error message:
AttributeError: 'dict' object has no attribute '__NUMPY_SETUP__'
This is python 3.6, numpy 1.14.2
From what I can tell this issue is similar to this:
It's a little hard to reproduce as it only happens when I'm building MDAnalysis (which uses gsd as a prerequisite)
TODO: update test.yml
to test on python 3.8.
Prerequisite: Python 3.8 exists in the windows image
Perform CI tests on Azure Pipelines.
Azure Pipelines provides 10 parallel jobs on Linux, Mac, and Windows. CircleCI provides only 4, and Appveyor only one. Combining all testing and deployment on the same platform will save developer time and effort in the future.
Seeking developer. This would be a good opportunity for a developer to learn how to configure Azure Pipelines. See recent changes to hoomd-blue and fresnel for a template.
Original report by yurivict (Bitbucket: yurivict, GitHub: yurivict).
Notes in commits say that this is version 1.5.2, but the Downloads page doesn't have the tarball:
https://bitbucket.org/glotzer/gsd/downloads/
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
There are numerous typos in the gsd.hoomd documentation, such as BondData referring to the number of particles. We also need to switch to the preferred notation list[str]
instead of using Typing
.
I will work on this at some point.
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
GSD needs windows support. The primary use-case is for use in file read plugins for VMD and OVITO on windows. I plan to also set up the python module to build on windows as well, mainly to enable testing of the windows back end. For now, I will not plan on providing conda builds.
To do:
I would like to propose an extension to the GSD C API, which would allow an application to read data from GSD files stored as blob in memory (and not in the local file system).
The GSD C API function gsd_open() allows opening only physical files, but in certain application scenarios, the GSD data may not be stored in the local file system in the first place. Consider for example a program that downloads a GSD file from a web server, and which would like to read the contained data directly without having to write the received data stream to disk first.
Another scenario where the proposed extension is essential is an application running in a sandbox environment without direct access to the file system and which receives the GSD file data as a blob from some other party. A concrete use case I am working on is a port of the OVITO code running in a web browser. See this demo: https://ovito.org/webdemo/
Here, the original OVITO C++ source code has been compiled to platform-independent WebAssembly code running in a browser tab. When the user picks a local file for import into the application, the browser hands over just the file content as a blob and not the actual path to the file. WebAssembly applications have no access to the file system. Thus, OVITO would need to parse the GSD file content from an in-memory buffer.
When running the tests on 32 bit architectures (e.g. ARMv7 or x86 32-bit), the following two tests fail: test_large_N[268435456] and test_large_N[536870913].
pytest-3 -v tests/test_largefile.py
...
tests/test_largefile.py::test_large_N[134217728] PASSED [ 96%]
tests/test_largefile.py::test_large_N[268435456] FAILED [ 98%]
tests/test_largefile.py::test_large_N[536870913] FAILED [100%]
=================================== FAILURES ===================================
___________________________ test_large_N[268435456] ____________________________
tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_large_N_268435456_0')
N = 268435456
@pytest.mark.parametrize("N", [2**27, 2**28, 2**29+1])
def test_large_N(tmp_path, N):
gc.collect()
> data = numpy.linspace(0, N, num=N, endpoint=False, dtype=numpy.uint32)
tests/test_largefile.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<__array_function__ internals>:5: in linspace
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
start = 0.0, stop = 268435456.0, num = 268435456, endpoint = False
retstep = False, dtype = <class 'numpy.uint32'>, axis = 0
@array_function_dispatch(_linspace_dispatcher)
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None,
axis=0):
"""
Return evenly spaced numbers over a specified interval.
Returns `num` evenly spaced samples, calculated over the
interval [`start`, `stop`].
The endpoint of the interval can optionally be excluded.
.. versionchanged:: 1.16.0
Non-scalar `start` and `stop` are now supported.
Parameters
----------
start : array_like
The starting value of the sequence.
stop : array_like
The end value of the sequence, unless `endpoint` is set to False.
In that case, the sequence consists of all but the last of ``num + 1``
evenly spaced samples, so that `stop` is excluded. Note that the step
size changes when `endpoint` is False.
num : int, optional
Number of samples to generate. Default is 50. Must be non-negative.
endpoint : bool, optional
If True, `stop` is the last sample. Otherwise, it is not included.
Default is True.
retstep : bool, optional
If True, return (`samples`, `step`), where `step` is the spacing
between samples.
dtype : dtype, optional
The type of the output array. If `dtype` is not given, infer the data
type from the other input arguments.
.. versionadded:: 1.9.0
axis : int, optional
The axis in the result to store the samples. Relevant only if start
or stop are array-like. By default (0), the samples will be along a
new axis inserted at the beginning. Use -1 to get an axis at the end.
.. versionadded:: 1.16.0
Returns
-------
samples : ndarray
There are `num` equally spaced samples in the closed interval
``[start, stop]`` or the half-open interval ``[start, stop)``
(depending on whether `endpoint` is True or False).
step : float, optional
Only returned if `retstep` is True
Size of spacing between samples.
See Also
--------
arange : Similar to `linspace`, but uses a step size (instead of the
number of samples).
geomspace : Similar to `linspace`, but with numbers spaced evenly on a log
scale (a geometric progression).
logspace : Similar to `geomspace`, but with the end points specified as
logarithms.
Examples
--------
>>> np.linspace(2.0, 3.0, num=5)
array([2. , 2.25, 2.5 , 2.75, 3. ])
>>> np.linspace(2.0, 3.0, num=5, endpoint=False)
array([2. , 2.2, 2.4, 2.6, 2.8])
>>> np.linspace(2.0, 3.0, num=5, retstep=True)
(array([2. , 2.25, 2.5 , 2.75, 3. ]), 0.25)
Graphical illustration:
>>> import matplotlib.pyplot as plt
>>> N = 8
>>> y = np.zeros(N)
>>> x1 = np.linspace(0, 10, N, endpoint=True)
>>> x2 = np.linspace(0, 10, N, endpoint=False)
>>> plt.plot(x1, y, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.plot(x2, y + 0.5, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.ylim([-0.5, 1])
(-0.5, 1)
>>> plt.show()
"""
# 2016-02-25, 1.12
num = _index_deprecate(num)
if num < 0:
raise ValueError("Number of samples, %s, must be non-negative." % num)
div = (num - 1) if endpoint else num
# Convert float/complex array scalars to float, gh-3504
# and make sure one can use variables that have an __array_interface__, gh-6634
start = asanyarray(start) * 1.0
stop = asanyarray(stop) * 1.0
dt = result_type(start, stop, float(num))
if dtype is None:
dtype = dt
delta = stop - start
> y = _nx.arange(0, num, dtype=dt).reshape((-1,) + (1,) * ndim(delta))
E ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
/usr/lib/python3.8/site-packages/numpy/core/function_base.py:143: ValueError
___________________________ test_large_N[536870913] ____________________________
tmp_path = PosixPath('/tmp/pytest-of-mockbuild/pytest-0/test_large_N_536870913_0')
N = 536870913
@pytest.mark.parametrize("N", [2**27, 2**28, 2**29+1])
def test_large_N(tmp_path, N):
gc.collect()
> data = numpy.linspace(0, N, num=N, endpoint=False, dtype=numpy.uint32)
tests/test_largefile.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
<__array_function__ internals>:5: in linspace
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
start = 0.0, stop = 536870913.0, num = 536870913, endpoint = False
retstep = False, dtype = <class 'numpy.uint32'>, axis = 0
@array_function_dispatch(_linspace_dispatcher)
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None,
axis=0):
"""
Return evenly spaced numbers over a specified interval.
Returns `num` evenly spaced samples, calculated over the
interval [`start`, `stop`].
The endpoint of the interval can optionally be excluded.
.. versionchanged:: 1.16.0
Non-scalar `start` and `stop` are now supported.
Parameters
----------
start : array_like
The starting value of the sequence.
stop : array_like
The end value of the sequence, unless `endpoint` is set to False.
In that case, the sequence consists of all but the last of ``num + 1``
evenly spaced samples, so that `stop` is excluded. Note that the step
size changes when `endpoint` is False.
num : int, optional
Number of samples to generate. Default is 50. Must be non-negative.
endpoint : bool, optional
If True, `stop` is the last sample. Otherwise, it is not included.
Default is True.
retstep : bool, optional
If True, return (`samples`, `step`), where `step` is the spacing
between samples.
dtype : dtype, optional
The type of the output array. If `dtype` is not given, infer the data
type from the other input arguments.
.. versionadded:: 1.9.0
axis : int, optional
The axis in the result to store the samples. Relevant only if start
or stop are array-like. By default (0), the samples will be along a
new axis inserted at the beginning. Use -1 to get an axis at the end.
.. versionadded:: 1.16.0
Returns
-------
samples : ndarray
There are `num` equally spaced samples in the closed interval
``[start, stop]`` or the half-open interval ``[start, stop)``
(depending on whether `endpoint` is True or False).
step : float, optional
Only returned if `retstep` is True
Size of spacing between samples.
See Also
--------
arange : Similar to `linspace`, but uses a step size (instead of the
number of samples).
geomspace : Similar to `linspace`, but with numbers spaced evenly on a log
scale (a geometric progression).
logspace : Similar to `geomspace`, but with the end points specified as
logarithms.
Examples
--------
>>> np.linspace(2.0, 3.0, num=5)
array([2. , 2.25, 2.5 , 2.75, 3. ])
>>> np.linspace(2.0, 3.0, num=5, endpoint=False)
array([2. , 2.2, 2.4, 2.6, 2.8])
>>> np.linspace(2.0, 3.0, num=5, retstep=True)
(array([2. , 2.25, 2.5 , 2.75, 3. ]), 0.25)
Graphical illustration:
>>> import matplotlib.pyplot as plt
>>> N = 8
>>> y = np.zeros(N)
>>> x1 = np.linspace(0, 10, N, endpoint=True)
>>> x2 = np.linspace(0, 10, N, endpoint=False)
>>> plt.plot(x1, y, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.plot(x2, y + 0.5, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.ylim([-0.5, 1])
(-0.5, 1)
>>> plt.show()
"""
# 2016-02-25, 1.12
num = _index_deprecate(num)
if num < 0:
raise ValueError("Number of samples, %s, must be non-negative." % num)
div = (num - 1) if endpoint else num
# Convert float/complex array scalars to float, gh-3504
# and make sure one can use variables that have an __array_interface__, gh-6634
start = asanyarray(start) * 1.0
stop = asanyarray(stop) * 1.0
dt = result_type(start, stop, float(num))
if dtype is None:
dtype = dt
delta = stop - start
> y = _nx.arange(0, num, dtype=dt).reshape((-1,) + (1,) * ndim(delta))
E ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size.
/usr/lib/python3.8/site-packages/numpy/core/function_base.py:143: ValueError
===================== 2 failed, 56 passed in 19.44 seconds =====================
All tests PASS.
Platform:
Installation method:
Versions:
Original report by Carl Simon Adorf (Bitbucket: csadorf, GitHub: csadorf).
The documentation states that contributors should follow instructions in a CONTRIBUTING.MD file, however that file does not exist.
https://gsd.readthedocs.io/en/stable/community.html#contribute
The examples in the docs show the write_chunk
method has 3 arguments, where it should only take two arguments.
Anyone who contributes do gsd could do the fix.
GSD will be enabled as a log file backed in HOOMD v3. This requires long namespaces for quantities. GSD's current 64-byte key name significantly limits this. Additionally, name lookups should operate in log(N) time.
No changes to the GSD API are necessary. Internally, we need to bump the file format specification to v2.0 and implement a new namelist storage format. Files written in the v1.0 format will need to be detected and read in a backwards compatible way.
I'm thinking of using a simple memory buffer with all strings in order one after another with null terminators in between them. To make key search in log(N) time, we can make a list of pointers into this buffer and sort those pointers to allow for binary searches. Alternately, we could store the keys sorted in the file, but that would complicate updating the namelist index.
We can either a) transparently upgrade files to v2 when writing or b) fail when attempting to write a long key to a v1 file.
This implementation should also solve #43.
I will implement this.
When building for Windows with setup.py
, the package builds but tests fail. CMake builds on Windows work fine (only CMake builds are tested on Appveyor).
pip install gsd
also gives failing Windows builds since it uses the source distribution on PyPI.
Platform:
Installation method:
Versions:
I plan to work with @joaander to debug this.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Writing a GSD file with 2^28 particles crashes GSD consistently in the writing process.
import sys
import gsd
import gsd.hoomd
import numpy as np
def main(argv):
if len(argv) != 1:
print("Usage: ./test.py")
return
test(2**26)
print("2^26 passed")
test(2**27)
print("2^27 passed")
test(2**28)
print("2^28 passed")
def test(size):
s = gsd.hoomd.Snapshot()
s.particles.N = int(size)
s.particles.position = np.zeros( (s.particles.N,3) )
s.particles.position += 0.5
s.particles.velocity = np.zeros( (s.particles.N,3) )
s.particles.velocity += 0.3
s.particles.image = np.zeros( (s.particles.N,3), dtype=np.int )
s.particles.mass = np.ones(s.particles.N)
with gsd.hoomd.open(name="temp.gsd",mode="wb") as f:
f.append(s)
if __name__ == "__main__":
main(sys.argv)
2^26 passed
2^27 passed
Traceback (most recent call last):
File "test.py", line 36, in
main(sys.argv)
File "test.py", line 17, in main
test(2**28)
File "test.py", line 33, in test
f.append(s)
File "/usr/local/lib/python3.5/dist-packages/gsd/hoomd.py", line 567, in append
self.file.write_chunk(path + '/' + name, data)
File "fl.pyx", line 519, in gsd.fl.GSDFile.write_chunk
OSError: [Errno 0] Success: 'particles/position'
2^26 passed
2^27 passed
2^28 passed
CPU: Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz
Memory: 1TB
disk: network storage with quota of more than 1TB left
Platform:
Installation method:
Versions:
GSD does not expand the namelist. write_chunk
silently writes data with an invalid type id.
# Include a minimal script that reproduces the problem
import gsd.fl
import numpy
with gsd.fl.open(name='file.gsd', mode='wb', application="test", schema="test", schema_version=[1,0]) as f:
for i in range(256):
f.write_chunk(name=str(i), data=numpy.array([i], dtype=numpy.int32))
f.end_frame()
with gsd.fl.open(name='file.gsd', mode='rb', application="test", schema="test", schema_version=[1,0]) as f:
for i in range(256):
v = f.read_chunk(frame=0, name=str(i))
print(v[0])
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Traceback (most recent call last):
File "gsd-namelist-limit.py", line 11, in <module>
v = f.read_chunk(frame=0, name=str(i))
File "fl.pyx", line 623, in gsd.fl.GSDFile.read_chunk
KeyError: 'frame 0 / chunk 128 not found in: file.gsd'
j
The values 0 through 255, or an error when attempting to write chunk 128.
Platform:
Installation method:
Versions:
I will add an error condition to write_chunk
in v1.9.0.
HOOMD files only use ~50 names. A user would need to enable a large number of custom logs before we need to fix the root cause of the bug. Users with that many chunk names may also wish to implement a hash map for the name list to improve lookup speed.
Original report by yurivict (Bitbucket: yurivict, GitHub: yurivict).
Did you forget to upload the tarball for 1.5.3?
Currently, in read-only mode the entire GSD file is memory mapped and then the index is read. However, this can prevent the reading of very large files on operating systems where virtual memory is limited because even allocating a sufficient number of memory pages exceeds the system limitations. To solve this problem, we should only memory map the index itself, and then access the rest of the file on demand.
# This requires working with a GSD file and an operating system where the filesize exceeds the output of `ulimit -v`.
import gsd.hoomd
with gsd.hoomd.open('sample.gsd', 'rb') as f:
pass
Note that using mode 'rb+' fixes this issue. I have not attached a usable file due to the required file sizes.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
I think this is partially related to #30
We're doing a legacy support release for MDAnalysis and we're noticing that pip install gsd
will pick up v1.8.0 on python 2.7. As far as I'm aware 1.8 dropped support for py2.7, causing gsd calls to fail.
This causes issues with pip-only installs. Technically we could pin the release to <1.8.0 but we'd prefer not limit users from using the newer GSD versions where possible.
Assuming you can reproduce this behaviour, I was therefore wondering if you'd be willing to yank the 1.8 release from pypi so that py2.7 didn't default to it?
Platform:
Installation method:
Versions:
Unfortunately any fix here would have to be done by the pypi maintainer.
Hi,
Going from #28 it looks like python 2.7 support got dropped in GSD 1.8.0. However, there are still python2.7 conda builds being created. I couldn't work out who maintains the conda-forge build, so apologies if I am reporting in the wrong place.
conda search gsd -c conda-forge
...
gsd 1.8.0 py27hc1659b7_0 conda-forge
gsd 1.8.0 py36hc1659b7_0 conda-forge
gsd 1.8.0 py36hc1659b7_1 conda-forge
gsd 1.8.0 py37hc1659b7_0 conda-forge
gsd 1.8.0 py37hc1659b7_1 conda-forge
Platform:
Installation method:
Versions:
Currently the dimensionality of spheres and ellipsoids is not part of the GSD shape schema and is only available by inference (by considering the box dimensionality). This ambiguity is undesirable because it makes it impossible for code that only deals with shape (and not simulations) to know what to generate without additional information. I would like to resolve this ambiguity directly within the shape schema.
We should add additional Disk
and Ellipse
shape classes to the schema to explicitly represent the 2D cases.
When making this change, we will need to make sure we don't break any of HOOMD's behavior. Specifically, we need to see how the ellipse overlap checks in HPMC work in 2D and whether setting c to 0 or removing it entirely causes incorrect overlap detection.
I can try to implement this, but I would like some discussion and am unlikely to do this in the short term.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Rewrite into an existing chunk at a specific frame.
Now users can read data of any frames, while write data can only be implemented by adding extra frames.
Since I am trying to prepress my data, which means read the data at a frame then processed and overwrite that chunk at that frame.
N/A
N/A
Original report by yurivict (Bitbucket: yurivict, GitHub: yurivict).
Without it the build breaks on FreeBSD 11.1:
cc -DNDEBUG -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -fPIC -I/usr/local/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -c gsd/gsd.c -o build/temp.freebsd-11.1-STABLE-amd64-2.7/gsd/gsd.o
gsd/gsd.c:461:69: error: use of undeclared identifier 'S_IRUSR'
int fd = open(fname, O_RDWR | O_CREAT | O_TRUNC | extra_flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
^
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
python setup.py fails in strange ways on some systems, we need more control over the install process to allow it to be installed on more systems.
I'm not certain this is an issue with your code, but I got an issue in my build while importing gsd. It seems to be because the build version is different than my version of NumPy. It would be nice if you listed a specific version of NumPy if it's required to make it work, though I'm not sure at this point that this is the case.
I couldn't find your build information on circleci to see what version of NumPy it was built with.
Thanks!
../../../virtualenv/python3.6.3/lib/python3.6/site-packages/gsd/hoomd.py:25: in <module>
from gsd import fl
__init__.pxd:918: in init gsd.fl
???
E ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Original report by Malcolm Ramsay (Bitbucket: malramsay64, GitHub: malramsay64).
When running
#!bash
pip install gsd
in a new environment the install fails with a numpy import exception. Installing numpy then installing gsd is a workaround for this.
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
We need a schema to describe hoomd data.
First pass: Just particles (no rigid bodies or class specific restart data).
TODO: Remove deprecated methods in the v2.0 release.
Remove the generated fl.c
file from the git repository. The file is large, makes pull requests difficult to parse, and makes merge conflicts likely.
In #37 I take a few steps toward this, enabling the use of Cython on circleci and appveyor. We need to update readthedocs so that it can cythonize code in development for documentation preview builds.
Options for release builds:
fl.c
in setup.pySeeking developer with python setuptools/pip experience.
Deprecate the read_frame
method in the next feature release.
Users should use __getitem__
indexing (e.g. trajectory[i]
) instead. read_frame
is the private implementation backing this API.
I will make this change.
I frequently open and inspect GSD files in the Python interpreter for testing. It would be convenient to add some simple entry points to the Python interface to be able to do something like read_gsd FILENAME
on the command line. This would be extremely simple, the equivalent of executing python -i read.py
where read.py
is a Python script like
# read.py
import gsd.hoomd
traj = gsd.hoomd.open(FILENAME)
but possibly with additional flags that could be added for e.g. different schema or opening directly with the file layer.
This could be implemented using Python's built-in entrypoints function for installation when using setup.py. I'm not sure if the CMake build supports this, that might require some additional changes.
I'm happy to take this on if there's interest.
Original report by Dominik Mierzejewski (Bitbucket: rathann, GitHub: rathann).
gsd.hoomd.open() fails with RuntimeError: Not a GSD file: ...
when running on a big-endian arch like ppc64 or s390x. This is reproducible when running MDAnalysis 0.17.0 or newer test suite.
I'm trying to investigate on my ppc64 VM and come up with a patch.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Original report by Dominik Mierzejewski (Bitbucket: rathann, GitHub: rathann).
When trying to build documentation offline, I'm getting this error:
$ sphinx-build -b html -d _build/doctrees -a -n -W . _build/html
Running Sphinx v1.6.6
loading pickled environment... not yet created
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
Warning, treated as error:
intersphinx inventory 'https://docs.python.org/3/objects.inv' not fetchable due to <class 'requests.exceptions.ConnectionError'>: HTTPSConnectionPool(host='docs.python.org', port=443): Max retries exceeded with url: /3/objects.inv (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fca0a967198>: Failed to establish a new connection: [Errno -2] Name or service not known',))
I'm trying to create a Fedora package and one of the requirements is that it must be possible to build without network access (Fedora builders are configured like that).
Please either provide HTML docs in a (separate) tarball or a way to build them without network access. I can fetch the necessary files beforehand and put them where they're expected, but the build process must not try to download anything.
Original report by Joshua Anderson (Bitbucket: joaander, GitHub: joaander).
For simulation runs that save a massive number of frames, read/write mode is not desirable or necessary. It stores the large index in memory in its entirety. This is not something we can afford to do on nodes with limited memory.
A hoomd gsd dump writer does not need to store the index in memory to append files. A simple append only mode that only cached unwritten index entries (a few K) would be sufficient. It would be unable to read any data chunks from the file, but the writer should not need to do that, except possibly to verify if time steps are in the file (and maybe that is not even necessary).
The only tricky part is that on load it will need to do the binary search through the index doing just one index entry read() at a time to avoid the need to read in the entire index - or perhaps mmap it temporarily and then unmap.
Release checklist:
git log --format=oneline --first-parent `git log -n 1 --pretty=format:%H -- CHANGELOG.rst`...
Original report by tolejema (Bitbucket: tolejema, ).
Compilation fails on OpenBSD.
It seems that
#include <sys/stat.h>
is required under this platform.
You could try something like:
#include <sys/param.h>
#if defined(BSD)
#include <sys/stat.h>
#endif
Original report by Tyler Reddy (Bitbucket: treddy1, GitHub: treddy1).
This is just to confirm that gsd
is not supported on 64-bit Windows?
As we move toward adding Windows support for the MDAnalysis library (which now has a gsd dependency), my observation is that there are some issues using gsd on that platform.
I am not sure if there's any interest on the gsd end for supporting Windows, but see i.e., the discussion in MDAnalysis/mdanalysis#1914 related to the way we will likely have to handle gsd on Windows for the time being.
I'm pretty sure I noticed some low-hanging fruit for compatibility improvement with i.e., explicit '/' being used in path handling in gsd instead of os.path.join, but I'm not sure if it would be a much bigger undertaking to add full support for Windows.
Original report by Max Linke (Bitbucket: max_linke, ).
The license file isn't included in the pypi release currently. To add it the MANIFEST.in should contain the following line.
include LICENSE
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.