Skip to content

Commit

Permalink
Updated LICENSE and AUTHOR info regarding xdrfile (closes #679)
Browse files Browse the repository at this point in the history
Rebranded our xdrlib with cython bindings as libmdaxdr.

Further standardized XDR error message reporting and exceptions
(now mostly IOError).

Removed reference to the old SWIG numpy.i in the credits.

Made logo LICENSE info consistent
  • Loading branch information
mnmelo committed Feb 8, 2016
1 parent 795e573 commit c3b838f
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 29,092 deletions.
54 changes: 49 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,43 @@ Public License instead of this License.


==========================================================================

Gromacs xdrfile library for reading XTC/TRR trajectories
- lib/formats/src/xdrfile.c
- lib/formats/src/xdrfile_xtc.c
- lib/formats/src/xdrfile_trr.c
- lib/formats/include/xdrfile.h
- lib/formats/include/xdrfile_xtc.h
- lib/formats/include/xdrfile_trr.h

Copyright (c) 2009-2014, Erik Lindahl & David van der Spoel
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

==========================================================================

CatDCD is released under the UIUC Open Source License:
http://www.ks.uiuc.edu/Development/MDTools/catdcd/license.html

Expand Down Expand Up @@ -526,15 +563,22 @@ PyQCPROT

MDAnalysis logo (see doc/sphinx/source/logos)

The MDAnalysis 'Atom' logo was created by Christian Beckstein and is

Copyright (c) 2011 Christian Beckstein

MDAnalysis Logo 'Atom' by Christian Beckstein is licensed under a
Creative Commons Attribution-NoDerivs 3.0 Unported License.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to Creative
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

http://creativecommons.org/licenses/by-nd/3.0/
The logo is contained in the file 'mdanalysis-logo.png'.

See the file LICENSE in the logo directory for the full text of the
license.
Derivatives in the files 'mdanalysis-logo-127x55.png',
'mdanalysis-logo-200x150.png', 'mdanalysis-logo.ico' were created for
inclusion in MDAnalysis and on websites related to MDAnalysis. They
are distributed under the same license as the 'Atom' logo.

==========================================================================



24 changes: 16 additions & 8 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,22 @@ External code
External code (under a GPL-compatible licence) was obtained from
various sources. The authors (as far as we know them) are listed here.

libxdrfile
- David van der Spoel <[email protected]>
- Erik Lindahl <[email protected]>
As of MDAnalysis version 0.8.0 libxdrfile is no longer used, having
been replaced by libxdrfile2, a GPLv2 derivative of libxdrfile.

numpy.i
- Bill Spotz
xdrfile
- David van der Spoel <[email protected]>
- Erik Lindahl <[email protected]>
- Frans van Hoesel <[email protected]> (not listed as an xdrfile
author, but the original author of the XTC coordinate compression code)

The Gromacs libxdrfile (LGPL-licensed) was used before MDAnalysis
version 0.8.0.
Between MDAnalysis versions 0.8.0 and 0.13.0 libxdrfile was replaced by
libxdrfile2, our GPLv2 enhanced derivative of libxdrfile.
Since version 0.14.0 xdr enhanecments were rebased onto Gromacs'
xdrfile 1.1.4 code (now BSD-licensed). Our contributions remain GPLv2
and were split into files xtc_seek.c, trr_seek.c, xtc_seek.h, and
trr_seek.h, for clarity (xdrfile 1.1.4 code is distributed with minor
modifications). Also for clarity we now name the resulting enhanced
xdr-reading library, complete with cython bindings, 'libmdaxdr'.

KDTree
- Thomas Hamelryck <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Enhancement

Changes

* xdrlib was rebranded limdaxdr. (Issue #679)
* xdrlib has been ported to cython. (Issue #441)
* util.NamedStream no longer inherits from basestring (Issue #649)
* Short TRZ titles are striped from trailing spaces. A friendlier error
Expand Down
54 changes: 49 additions & 5 deletions package/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,43 @@ Public License instead of this License.


==========================================================================

Gromacs xdrfile library for reading XTC/TRR trajectories
- lib/formats/src/xdrfile.c
- lib/formats/src/xdrfile_xtc.c
- lib/formats/src/xdrfile_trr.c
- lib/formats/include/xdrfile.h
- lib/formats/include/xdrfile_xtc.h
- lib/formats/include/xdrfile_trr.h

Copyright (c) 2009-2014, Erik Lindahl & David van der Spoel
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

==========================================================================

CatDCD is released under the UIUC Open Source License:
http://www.ks.uiuc.edu/Development/MDTools/catdcd/license.html

Expand Down Expand Up @@ -526,15 +563,22 @@ PyQCPROT

MDAnalysis logo (see doc/sphinx/source/logos)

The MDAnalysis 'Atom' logo was created by Christian Beckstein and is

Copyright (c) 2011 Christian Beckstein

MDAnalysis Logo 'Atom' by Christian Beckstein is licensed under a
Creative Commons Attribution-NoDerivs 3.0 Unported License.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to Creative
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

http://creativecommons.org/licenses/by-nd/3.0/
The logo is contained in the file 'mdanalysis-logo.png'.

See the file LICENSE in the logo directory for the full text of the
license.
Derivatives in the files 'mdanalysis-logo-127x55.png',
'mdanalysis-logo-200x150.png', 'mdanalysis-logo.ico' were created for
inclusion in MDAnalysis and on websites related to MDAnalysis. They
are distributed under the same license as the 'Atom' logo.

==========================================================================



2 changes: 1 addition & 1 deletion package/MDAnalysis/coordinates/TRR.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#
from .XDR import XDRBaseReader, XDRBaseWriter
from ..lib.formats.xdrlib import TRRFile
from ..lib.formats.libmdaxdr import TRRFile
from ..lib.mdamath import triclinic_vectors


Expand Down
4 changes: 2 additions & 2 deletions package/MDAnalysis/coordinates/XDR.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def read_numpy_offsets(filename):


class XDRBaseReader(base.Reader):
"""Base class for xdrlib file formats xtc and trr"""
"""Base class for libmdaxdr file formats xtc and trr"""
def __init__(self, filename, convert_units=True, sub=None,
refresh_offsets=False, **kwargs):
super(XDRBaseReader, self).__init__(filename,
Expand Down Expand Up @@ -191,7 +191,7 @@ def Writer(self, filename, n_atoms=None, **kwargs):


class XDRBaseWriter(base.Writer):
"""Base class for xdrlib file formats xtc and trr"""
"""Base class for libmdaxdr file formats xtc and trr"""

def __init__(self, filename, n_atoms, convert_units=True, **kwargs):
self.filename = filename
Expand Down
4 changes: 2 additions & 2 deletions package/MDAnalysis/coordinates/XTC.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#
from .XDR import XDRBaseReader, XDRBaseWriter
from ..lib.formats.xdrlib import XTCFile
from ..lib.formats.libmdaxdr import XTCFile
from ..lib.mdamath import triclinic_vectors


Expand Down Expand Up @@ -69,7 +69,7 @@ def write_next_timestep(self, ts):
dimensions = self.convert_dimensions_to_unitcell(ts, inplace=False)

box = triclinic_vectors(dimensions)
# xdrlib will multiply the coordinated by precision. This means for a
# libmdaxdr will multiply the coordinates by precision. This means for a
# precision of 3 decimal places we need to pass 1000.0 to the xdr
# library.
precision = 10.0 ** self.precision
Expand Down
4 changes: 2 additions & 2 deletions package/MDAnalysis/lib/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations.
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787
#
from . import xdrlib
from . import libmdaxdr

__all__ = ['xdrlib']
__all__ = ['libmdaxdr']
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ cdef class _XDRFile:
res = xdrfile_close(self.xfp)
self.is_open = False
if res != EOK:
raise IOError('Couldn\'t close file: {}, Error = XDRLIB-{}'.format(
raise IOError('Couldn\'t close file: {} XDR error = {}'.format(
self.fname, error_message[res]))
# forget old offsets in case we open a different file with the same instance.
self._has_offsets = False
Expand Down Expand Up @@ -198,15 +198,15 @@ cdef class _XDRFile:
return_code, self.n_atoms = self._calc_natoms(fname);

if return_code != EOK:
raise IOError('XDRLIB read error: {}'.format(
raise IOError('XDR read error = {}'.format(
error_message[return_code]))
if self.n_atoms <= 0:
raise IOError('Couldn\'t read number of atoms: {}'.format(
fname))

self.xfp = xdrfile_open(fname, opening_mode)
if self.xfp is NULL:
raise IOError('error opening xtf file: {}'.format(self.fname))
raise IOError('Error opening XTC/TRR file: {}'.format(self.fname))
self.is_open = True

def __enter__(self):
Expand Down Expand Up @@ -362,7 +362,7 @@ cdef class TRRFile(_XDRFile):
Examples
--------
>>> from MDAnalysis.lib.formats.xdrlib import TRRFile
>>> from MDAnalysis.lib.formats.libmdaxdr import TRRFile
>>> with TRRFile('foo.trr') as f:
>>> for frame in f:
>>> print(frame.x)
Expand All @@ -383,8 +383,8 @@ cdef class TRRFile(_XDRFile):
cdef int64_t* offsets = NULL
ok = read_trr_n_frames(self.fname, &n_frames, &est_nframes, &offsets);
if ok != EOK:
raise RuntimeError("TRR couldn't calculate offsets, error={}".format(
error_message[ok]))
raise RuntimeError("TRR couldn't calculate offsets. "
"XDR error = {}".format(error_message[ok]))
# the read_xtc_n_frames allocates memory for the offsets with an
# overestimation. This number is saved in est_nframes and we need to
# tell the new numpy array about the whole allocated memory to avoid
Expand All @@ -399,7 +399,7 @@ cdef class TRRFile(_XDRFile):
Returns
-------
frame : xdrlib.TRRFrame
frame : libmdaxdr.TRRFrame
namedtuple with frame information
See Also
Expand Down Expand Up @@ -444,7 +444,7 @@ cdef class TRRFile(_XDRFile):
# produced by different codes (Gromacs, ...).
if return_code != EOK and return_code != EENDOFFILE \
and return_code != EINTEGER:
raise RuntimeError('TRR Read Error occured: {}'.format(
raise IOError('TRR read error = {}'.format(
error_message[return_code]))

# In a trr the integer error seems to indicate that the file is ending.
Expand Down Expand Up @@ -549,7 +549,7 @@ cdef class TRRFile(_XDRFile):
<rvec*> velocity_ptr,
<rvec*> forces_ptr)
if return_code != EOK:
raise RuntimeError('TRR write error: {}'.format(
raise IOError('TRR write error = {}'.format(
error_message[return_code]))

self.current_frame += 1
Expand All @@ -574,7 +574,7 @@ cdef class XTCFile(_XDRFile):
Examples
--------
>>> from MDAnalysis.lib.formats.xdrlib import XTCFile
>>> from MDAnalysis.lib.formats.libmdaxdr import XTCFile
>>> with XTCFile('foo.trr') as f:
>>> for frame in f:
>>> print(frame.x)
Expand All @@ -596,8 +596,8 @@ cdef class XTCFile(_XDRFile):
cdef int64_t* offsets = NULL
ok = read_xtc_n_frames(self.fname, &n_frames, &est_nframes, &offsets);
if ok != EOK:
raise RuntimeError("XTC couldn't calculate offsets, error={}".format(
error_message[ok]))
raise RuntimeError("XTC couldn't calculate offsets. "
"XDR error = {}".format(error_message[ok]))
# the read_xtc_n_frames allocates memory for the offsets with an
# overestimation. This number is saved in est_nframes and we need to
# tell the new numpy array about the whole allocated memory to avoid
Expand All @@ -612,7 +612,7 @@ cdef class XTCFile(_XDRFile):
Returns
-------
frame : xdrlib.XTCFrame
frame : libmdaxdr.XTCFrame
namedtuple with frame information
See Also
Expand Down Expand Up @@ -644,7 +644,7 @@ cdef class XTCFile(_XDRFile):
&time, <matrix>box.data,
<rvec*>xyz.data, <float*> &prec)
if return_code != EOK and return_code != EENDOFFILE:
raise RuntimeError('XTC Read Error occured: {}'.format(
raise IOError('XTC read error = {}'.format(
error_message[return_code]))

if return_code == EENDOFFILE:
Expand Down Expand Up @@ -715,7 +715,7 @@ cdef class XTCFile(_XDRFile):
<matrix>&box_view[0, 0],
<rvec*>&xyz_view[0, 0], precision)
if return_code != EOK:
raise RuntimeError('XTC write error: {}'.format(
raise IOError('XTC write error = {}'.format(
error_message[return_code]))

self.current_frame += 1
Loading

0 comments on commit c3b838f

Please sign in to comment.