From be5e87b0b8b7ad6bccb88a26979b2aa347ed50d0 Mon Sep 17 00:00:00 2001 From: Max Linke Date: Sun, 16 Apr 2017 17:57:30 +0200 Subject: [PATCH] various changes to get rid of errors --- .travis.yml | 1 + .../analysis/hbonds/hbond_analysis.py | 2 +- package/MDAnalysis/core/topology.py | 28 ++++++++++--------- package/MDAnalysis/core/universe.py | 2 +- package/MDAnalysis/lib/NeighborSearch.py | 2 +- package/MDAnalysis/lib/formats/libmdaxdr.pyx | 4 +-- package/MDAnalysis/topology/guessers.py | 4 ++- package/setup.cfg | 2 +- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 232e3900733..b3439dd9813 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ matrix: env: NAME="Doc" MAIN_CMD="cd package && python setup.py build_sphinx" BUILD_DOCS=true + SPHINX_VERSION=1.5.1 BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace" CONDA_DEPENDENCIES=${CONDA_ALL_DEPENDENCIES} diff --git a/package/MDAnalysis/analysis/hbonds/hbond_analysis.py b/package/MDAnalysis/analysis/hbonds/hbond_analysis.py index 6c8156f75ac..0074139accb 100644 --- a/package/MDAnalysis/analysis/hbonds/hbond_analysis.py +++ b/package/MDAnalysis/analysis/hbonds/hbond_analysis.py @@ -467,7 +467,7 @@ def __init__(self, universe, selection1='protein', selection2='all', selection1_ Parameters ---------- - universe : universe + universe : Universe Universe object selection1 : str (optional) Selection string for first selection ['protein'] diff --git a/package/MDAnalysis/core/topology.py b/package/MDAnalysis/core/topology.py index edc5d397406..bf787504509 100644 --- a/package/MDAnalysis/core/topology.py +++ b/package/MDAnalysis/core/topology.py @@ -165,7 +165,7 @@ class TransTable(object): Attributes ---------- - n_atoms, n_residues, n_segments : int + :ivar:`n_atoms`, n_residues, n_segments : int number of atoms, residues, segments in topology size tuple describing the shape of the TransTable @@ -428,24 +428,26 @@ class Topology(object): to residues, residues to segments, and vice-versa, are handled internally by this object. - Parameters - ---------- - n_atoms, n_residues, n_segments : int - number of atoms, residues, segments in topology; there must be at least - 1 element of each level in the system - attrs : TopologyAttr objects - components of the topology to be included - atom_resindex : array - 1-D array giving the resindex of each atom in the system - residue_segindex : array - 1-D array giving the segindex of each residue in the system - """ def __init__(self, n_atoms=1, n_res=1, n_seg=1, attrs=None, atom_resindex=None, residue_segindex=None): + """ + Parameters + ---------- + n_atoms, n_residues, n_segments : int + number of atoms, residues, segments in topology; there must be at least + 1 element of each level in the system + attrs : TopologyAttr objects + components of the topology to be included + atom_resindex : array + 1-D array giving the resindex of each atom in the system + residue_segindex : array + 1-D array giving the segindex of each residue in the system + + """ self.tt = TransTable(n_atoms, n_res, n_seg, atom_resindex=atom_resindex, residue_segindex=residue_segindex) diff --git a/package/MDAnalysis/core/universe.py b/package/MDAnalysis/core/universe.py index 067efc331e3..05fb4d47f9f 100644 --- a/package/MDAnalysis/core/universe.py +++ b/package/MDAnalysis/core/universe.py @@ -141,7 +141,7 @@ class Universe(object): Parameters ---------- - topology : filename, Topology object or stream + topology : str, Topology object or stream A CHARMM/XPLOR PSF topology file, PDB file or Gromacs GRO file; used to define the list of atoms. If the file includes bond information, partial charges, atom masses, ... then these data will be available to diff --git a/package/MDAnalysis/lib/NeighborSearch.py b/package/MDAnalysis/lib/NeighborSearch.py index 0bd1ae9ddda..0f5064d7d16 100644 --- a/package/MDAnalysis/lib/NeighborSearch.py +++ b/package/MDAnalysis/lib/NeighborSearch.py @@ -68,7 +68,7 @@ def search(self, atoms, radius, level='A'): Parameters ---------- - atoms : AtomGroup or Atom + atoms : AtomGroup or :class:`Atom` list of atoms radius : float Radius for search in Angstrom. diff --git a/package/MDAnalysis/lib/formats/libmdaxdr.pyx b/package/MDAnalysis/lib/formats/libmdaxdr.pyx index ba204904e39..b757ce96d89 100644 --- a/package/MDAnalysis/lib/formats/libmdaxdr.pyx +++ b/package/MDAnalysis/lib/formats/libmdaxdr.pyx @@ -502,7 +502,7 @@ cdef class TRRFile(_XDRFile): Parameters ---------- - xyz : ndarray, shape=(n_atoms, 3) + xyz : ndarray, shape=(natoms, 3) cartesion coordinates box : ndarray, shape=(3, 3) Box vectors for this frame @@ -685,7 +685,7 @@ cdef class XTCFile(_XDRFile): Parameters ---------- - xyz : ndarray, shape=(n_atoms, 3) + xyz : ndarray, shape=(number, 3) cartesion coordinates box : ndarray, shape=(3, 3) Box vectors for this frame diff --git a/package/MDAnalysis/topology/guessers.py b/package/MDAnalysis/topology/guessers.py index 639e9b93e9a..39790c27c2c 100644 --- a/package/MDAnalysis/topology/guessers.py +++ b/package/MDAnalysis/topology/guessers.py @@ -149,7 +149,7 @@ def guess_bonds(atoms, coords, **kwargs): atoms with altloc A and B maybe very close together and there should be no chemical bond between them. [0.1] - box : dimensions, optional + box : array_like, optional Bonds are found using a distance search, if unit cell information is given, periodic boundary conditions will be considered in the distance search. [``None``] @@ -204,6 +204,8 @@ def guess_bonds(atoms, coords, **kwargs): lower_bound = kwargs.get('lower_bound', 0.1) box = kwargs.get('box', None) + if box: + box = np.asarray(box) # to speed up checking, calculate what the largest possible bond # atom that would warrant attention. diff --git a/package/setup.cfg b/package/setup.cfg index 039cda196f0..b1b1c1b9f3d 100644 --- a/package/setup.cfg +++ b/package/setup.cfg @@ -5,7 +5,7 @@ ## depend on whether the current version is a release or not. ## Uncomment the following two lines to get the _release_ behavior. #use_cython=False -#keep_cythonized=True +keep_cythonized=True [wheel] universal = 1