Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into get_connections_…
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
lilyminium committed Apr 23, 2021
2 parents 981c22a + ec7d636 commit c0f0f52
Show file tree
Hide file tree
Showing 45 changed files with 1,059 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .disabled-travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
- SETUP_CMD="${PYTEST_FLAGS}"
- BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)"
- CONDA_MIN_DEPENDENCIES="mmtf-python biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov"
- CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles tqdm>=4.43.0 tidynamics>=1.0.0 rdkit>=2020.03.1 h5py==2.10.0"
- CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles tqdm>=4.43.0 tidynamics>=1.0.0 rdkit>=2020.03.1 h5py"
- CONDA_CHANNELS='biobuilds conda-forge'
- CONDA_CHANNEL_PRIORITY=True
- PIP_DEPENDENCIES="duecredit parmed"
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ defaults:
shell: bash -l {0}

env:
MDA_CONDA_MIN_DEPS: "pip pytest==6.1.2 mmtf-python biopython networkx cython matplotlib-base scipy griddataformats hypothesis gsd codecov"
MDA_CONDA_EXTRA_DEPS: "seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles tqdm>=4.43.0 tidynamics>=1.0.0 rdkit>=2020.03.1 h5py==2.10.0"
MDA_CONDA_MIN_DEPS: "pip pytest==6.1.2 mmtf-python biopython networkx cython matplotlib-base scipy griddataformats hypothesis gsd codecov threadpoolctl"
MDA_CONDA_EXTRA_DEPS: "seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 chemfiles tqdm>=4.43.0 tidynamics>=1.0.0 rdkit>=2020.03.1 h5py"
MDA_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist'
MDA_PIP_EXTRA_DEPS: 'duecredit parmed'

Expand Down Expand Up @@ -80,6 +80,7 @@ jobs:
echo "CXX=clang++" >> $GITHUB_ENV
gfortran-9 -v
echo "FC=gfortran-9" >> $GITHUB_ENV
echo "numprocs=3" >> $GITHUB_ENV
- name: setup_linux
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -92,17 +93,17 @@ jobs:
echo "CXX=g++" >> $GITHUB_ENV
gfortran -v
echo "FC=gfortran" >> $GITHUB_ENV
echo "numprocs=2" >> $GITHUB_ENV
- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channel-priority: flexible
channels: biobuilds, conda-forge
channels: conda-forge, biobuilds
add-pip-as-python-dependency: true
# TODO: mamba causes pip to segfault, switch when fixed
#mamba-version: "*"
mamba-version: "*"
architecture: x64

- name: install_deps
Expand All @@ -114,7 +115,7 @@ jobs:
# NOTE: set matrix.numpy to pin to a specific numpy version
conda_deps="${{ matrix.numpy }} ${MDA_CONDA_${{ matrix.run_type }}_DEPS}"
pip_deps=${MDA_PIP_${{ matrix.run_type }}_DEPS}
conda install ${conda_deps}
mamba install ${conda_deps}
pip install ${pip_deps}
# also install asv if required
Expand Down Expand Up @@ -158,7 +159,7 @@ jobs:
PYTEST_FLAGS="${PYTEST_FLAGS} --cov=MDAnalysis --cov-report=xml"
fi
echo $PYTEST_FLAGS
pytest -n 2 testsuite/MDAnalysisTests $PYTEST_FLAGS
pytest -n $numprocs testsuite/MDAnalysisTests $PYTEST_FLAGS
- name: run_asv
if: contains(matrix.name, 'asv_check')
Expand Down Expand Up @@ -191,15 +192,16 @@ jobs:
python-version: 3.7
auto-update-conda: true
channel-priority: flexible
channels: biobuilds, conda-forge
channels: conda-forge, biobuilds
add-pip-as-python-dependency: true
architecture: x64
mamba-version: "*"

- name: install_deps
run: |
conda_deps="${{ env.MDA_CONDA_MIN_DEPS }} ${{ env.MDA_CONDA_EXTRA_DEPS}}"
pip_deps="${{ env.MDA_PIP_MIN_DEPS}} ${{ env.MDA_PIP_EXTRA_DEPS }} sphinx==1.8.5 sphinx-sitemap sphinx_rtd_theme msmb_theme==1.2.0"
conda install ${conda_deps}
mamba install ${conda_deps}
pip install ${pip_deps}
- name: install_mda
Expand Down Expand Up @@ -280,7 +282,6 @@ jobs:
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
mamba-version: "*"
architecture: x64

- name: install
Expand Down Expand Up @@ -311,7 +312,7 @@ jobs:
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
mamba-version: "*"
# mamba not enabled as install longer than deps install
architecture: x64

- name: install_conda
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ matrix:
- conda activate base
- conda update --yes conda
- conda install --yes pip pytest==6.1.2 mmtf-python biopython networkx cython matplotlib-base "scipy>=1.6" griddataformats hypothesis gsd codecov -c conda-forge -c biobuilds
- pip install pytest-xdist
- pip install pytest-xdist threadpoolctl
- conda info
install:
- (cd package/ && python setup.py develop) && (cd testsuite/ && python setup.py install)
Expand All @@ -45,7 +45,7 @@ matrix:
if: type = cron
before_install:
- python -m pip install cython numpy scipy
- python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm
- python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm threadpoolctl
install:
- cd package
- python setup.py install
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ a `tax-deductible donation`_ to help the project pay for developer time, profess

This project is bound by a `Code of Conduct`_.

|powered_by_MDA|

If you use MDAnalysis_ in your project consider lettting your users and the world know about it by displaying the MDAnalysis_ badge! `Embedding code`_ is available for different markups.

Example analysis script
=======================
Expand Down Expand Up @@ -144,6 +147,7 @@ For citations of included algorithms and sub-modules please see the references_.
.. _`10.1002/jcc.21787`: https://dx.doi.org/10.1002/jcc.21787
.. _`10.25080/Majora-629e541a-00e`: https://doi.org/10.25080/Majora-629e541a-00e
.. _references: https://docs.mdanalysis.org/documentation_pages/references.html
.. _Embedding code: https://www.mdanalysis.org/pages/citations/#powered-by-mdanalysis


.. |usergroup| image:: https://img.shields.io/badge/Google%20Group-Users-lightgrey.svg
Expand Down Expand Up @@ -185,3 +189,7 @@ For citations of included algorithms and sub-modules please see the references_.
.. |mybinder| image:: https://mybinder.org/badge.svg
:alt: My Binder
:target: https://mybinder.org/v2/gh/MDAnalysis/binder-notebook/master

.. |powered_by_MDA| image:: https://img.shields.io/badge/Powered%20by-MDAnalysis-orange.svg?logoWidth=15&logo=data:image/x-icon;base64,AAABAAEAEBAAAAEAIAAoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJD+XwCY/fEAkf3uAJf97wGT/a+HfHaoiIWE7n9/f+6Hh4fvgICAjwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACT/yYAlP//AJ///wCg//8JjvOchXly1oaGhv+Ghob/j4+P/39/f3IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJH8aQCY/8wAkv2kfY+elJ6al/yVlZX7iIiI8H9/f7h/f38UAAAAAAAAAAAAAAAAAAAAAAAAAAB/f38egYF/noqAebF8gYaagnx3oFpUUtZpaWr/WFhY8zo6OmT///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAn46Ojv+Hh4b/jouJ/4iGhfcAAADnAAAA/wAAAP8AAADIAAAAAwCj/zIAnf2VAJD/PAAAAAAAAAAAAAAAAICAgNGHh4f/gICA/4SEhP+Xl5f/AwMD/wAAAP8AAAD/AAAA/wAAAB8Aov9/ALr//wCS/Z0AAAAAAAAAAAAAAACBgYGOjo6O/4mJif+Pj4//iYmJ/wAAAOAAAAD+AAAA/wAAAP8AAABhAP7+FgCi/38Axf4fAAAAAAAAAAAAAAAAiIiID4GBgYKCgoKogoB+fYSEgZhgYGDZXl5e/m9vb/9ISEjpEBAQxw8AAFQAAAAAAAAANQAAADcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjo6Mb5iYmP+cnJz/jY2N95CQkO4pKSn/AAAA7gAAAP0AAAD7AAAAhgAAAAEAAAAAAAAAAACL/gsAkv2uAJX/QQAAAAB9fX3egoKC/4CAgP+NjY3/c3Nz+wAAAP8AAAD/AAAA/wAAAPUAAAAcAAAAAAAAAAAAnP4NAJL9rgCR/0YAAAAAfX19w4ODg/98fHz/i4uL/4qKivwAAAD/AAAA/wAAAP8AAAD1AAAAGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALGxsVyqqqr/mpqa/6mpqf9KSUn/AAAA5QAAAPkAAAD5AAAAhQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADkUFBSuZ2dn/3V1df8uLi7bAAAATgBGfyQAAAA2AAAAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAADoAAAA/wAAAP8AAAD/AAAAWgC3/2AAnv3eAJ/+dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9AAAA/wAAAP8AAAD/AAAA/wAKDzEAnP3WAKn//wCS/OgAf/8MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAANwAAADtAAAA7QAAAMAAABUMAJn9gwCe/e0Aj/2LAP//AQAAAAAAAAAA
:alt: Powered by MDAnalysis
:target: https://www.mdanalysis.org
9 changes: 6 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
Python38-64bit-full:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: 'x64'
Python39-64bit-full:
PYTHON_VERSION: '3.9'
PYTHON_ARCH: 'x64'
steps:
- task: UsePythonVersion@0
inputs:
Expand All @@ -44,7 +47,7 @@ jobs:
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: >-
python -m pip install
python -m pip install --only-binary=h5py
cython
hypothesis
matplotlib
Expand All @@ -54,11 +57,11 @@ jobs:
pytest-xdist
scikit-learn
scipy
h5py==2.10.0
h5py
tqdm
threadpoolctl
displayName: 'Install dependencies'
# TODO: recent rdkit is not on PyPI
# NOTE: h5py pinned because of gh-3019
- script: >-
python -m pip install
biopython
Expand Down
4 changes: 2 additions & 2 deletions maintainer/conda/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- cython
- griddataformats
- gsd
- h5py==2.10.0
- h5py
- hypothesis
- joblib>=0.12
- matplotlib==3.2.2
Expand All @@ -31,4 +31,4 @@ dependencies:
- duecredit
- parmed
- msmb_theme==1.2.0
- sphinx-sitemap==1.0.2
- sphinx-sitemap==1.0.2
8 changes: 8 additions & 0 deletions package/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ Chronological list of authors
- Leonardo Barneschi
- Henrik Jäger
- Jan Stevens
- Orion Cohen
- Dimitrios Papageorgiou
- Hannah Pollak
- Estefania Barreto-Ojeda
- Paarth Thadani
- Henry Kobin
- Kosuke Kudo
- Sulay Shah

External code
-------------
Expand Down
28 changes: 26 additions & 2 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,28 @@ The rules for this file:
lilyminium, daveminh, jbarnoud, yuxuanzhuang, VOD555, ianmkenney,
calcraven,xiki-tempula, mieczyslaw, manuel.nuno.melo, PicoCentauri,
hanatok, rmeli, aditya-kamath, tirkarthi, LeonardoBarneschi, hejamu,
biogen98
biogen98, orioncohen, z3y50n, hp115, ojeda-e, thadanipaarth, HenryKobin,
1ut, sulays

* 2.0.0

Fixes
* Fixed issue with unassigned 'GAP' variable in fasta2algin function when
resids are provided in input (Issue #3124)
* Improve diffusionmap coverage (Issue #3208)
* Removed deprecated parameters `n_jobs` and `precompute_distances` of
sklearn.cluster.KMeans (Issue #2986)
* Helix_analysis coverage raised to 100% and `from __future__ import`
removed (Issue #3209)
* Fixed 'sphzone', 'sphlayer', 'cyzone', and 'cylayer' to return empty if the
zone/layer is empty, consistent with 'around' (Issue #2915)
* A Universe created from an ROMol with no atoms returns now a Universe
with 0 atoms (Issue #3142)
* PDBParser will check for the presence of the chainID attribute of an
atom group and use these values instead of just using the end of segid.
If no chainID attribute is present, then a default value will be
provided. If the chainID for an atom is invalid (longer than one character,
not alpha-numeric, blank) it will be replaced with a default. (Issue #3144)
* ValueError raised when empty atomgroup is given to DensityAnalysis
without a user defined grid. UserWarning displayed when user defined
grid is provided. (Issue #3055)
Expand Down Expand Up @@ -90,6 +105,12 @@ Enhancements
* Added intra_bonds, intra_angles, intra_dihedrals etc. to return only
the connections involving atoms within the AtomGroup, instead of
including atoms outside the AtomGroup (Issue #1264, #2821, PR #3200)
* Added an MDAnalysis shields.io badge to the README (Issue #3227, PR #3229)
* Added sort method to the atomgroup (Issue #2976, PR #3188)
* ITPParser now reads [ atomtypes ] sections in ITP files, used for charges
and masses not defined in the [ atoms ] sections
* Add `set_dimensions` transformation class for setting constant
box dimensions for all timesteps in trajectory (Issue #2691)
* Added a ValueError raised when not given a gridcenter while
providing grid dimensions to DensityAnalysis, also added
check for NaN in the input (Issue #3148, PR #3154)
Expand Down Expand Up @@ -141,9 +162,11 @@ Enhancements
'protein' selection (#2751 PR #2755)
* Added an RDKit converter that works for any input with all hydrogens
explicit in the topology (Issue #2468, PR #2775)

* Added `TransformationBase`. Implemented threadlimit and add an attribute for
checking if it can be used in parallel analysis. (Issue #2996, PR #2950)

Changes
* Fixed inaccurate docstring inside the RMSD class (Issue #2796, PR #3134)
* TPRParser now loads TPR files with `tpr_resid_from_one=True` by default,
which starts TPR resid indexing from 1 (instead of 0 as in 1.x) (Issue #2364, PR #3152)
* Introduces encore specific C compiler arguments to allow for lowering of
Expand Down Expand Up @@ -183,6 +206,7 @@ Changes
* deprecated ``analysis.helanal`` module has been removed in favour of
``analysis.helix_analysis`` (PR #2929)
* Move water bridge analysis from hbonds to hydrogenbonds (Issue #2739 PR #2913)
* `threadpoolctl` is required for installation (Issue #2860)

Deprecations

Expand Down
2 changes: 1 addition & 1 deletion package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,12 @@ def fasta2select(fastafilename, is_aligned=False,
# implict assertion that we only have two sequences in the alignment
orig_resids = [ref_resids, target_resids]
offsets = [ref_offset, target_offset]
GAP = "-"
for iseq, a in enumerate(alignment):
# need iseq index to change orig_resids
if orig_resids[iseq] is None:
# build default: assume consecutive numbering of all
# residues in the alignment
GAP = "-"
length = len(a.seq) - a.seq.count(GAP)
orig_resids[iseq] = np.arange(1, length + 1)
else:
Expand Down
22 changes: 3 additions & 19 deletions package/MDAnalysis/analysis/encore/clustering/ClusteringMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def __init__(self,
(default is 50). Parameter in the Affinity Propagation for
clustering.
**kwargs : optional
Other keyword arguments are passed to :class:`sklearn.cluster.AffinityPropagation`.
"""
self.ap = \
sklearn.cluster.AffinityPropagation(
Expand Down Expand Up @@ -331,7 +334,6 @@ def __init__(self,
verbose=False,
random_state=None,
copy_x=True,
n_jobs=1,
**kwargs):
"""
Parameters
Expand Down Expand Up @@ -360,14 +362,6 @@ def __init__(self,
If a callable is passed, it should take arguments X, k and
and a random state and return an initialization.
precompute_distances : {'auto', True, False}
Precompute distances (faster but takes more memory).
'auto' : do not precompute distances if
n_samples * n_clusters > 12 million. This corresponds to about
100MB overhead per job using double precision.
True : always precompute distances
False : never precompute distances
tol : float, optional (default 1e-4)
The relative increment in the results before declaring
convergence.
Expand All @@ -388,25 +382,15 @@ def __init__(self,
differences may be introduced by subtracting and then adding
the data mean.
n_jobs : int
The number of jobs to use for the computation. This works by
computing each of the n_init runs in parallel. If -1 all CPUs
are used. If 1 is given, no parallel computing code is used at
all, which is useful for debugging. For n_jobs below -1,
(n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs
but one are used.
"""
self.kmeans = sklearn.cluster.KMeans(n_clusters=n_clusters,
max_iter=max_iter,
n_init=n_init,
init=init,
precompute_distances='auto',
tol=tol,
verbose=verbose,
random_state=random_state,
copy_x=copy_x,
n_jobs=n_jobs,
**kwargs)

def __call__(self, coordinates):
Expand Down
1 change: 0 additions & 1 deletion package/MDAnalysis/analysis/helix_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
hel_xyz = hel.helix_analysis(u.atoms.positions, ref_axis=[0, 0, 1])
"""
from __future__ import division, absolute_import

import warnings
import numpy as np
Expand Down
5 changes: 4 additions & 1 deletion package/MDAnalysis/analysis/rms.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ def __init__(self, atomgroup, reference=None, select='all',
corresponding atom in `select`, and assumes ``None`` for `groupselections`.
weights_groupselections : False or list of {"mass", ``None`` or array_like} (optional)
1. ``False`` will apply imposed weights to `groupselections` from ``weights`` option.
1. ``False`` will apply imposed weights to `groupselections` from
``weights`` option if ``weights`` is either ``"mass"`` or ``None``.
Otherwise will assume a list of length equal to length of
`groupselections` filled with ``None`` values.
2. A list of {"mass", ``None`` or array_like} with the length of `groupselections`
will apply the weights to `groupselections` correspondingly.
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion package/MDAnalysis/coordinates/H5MD.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def _read_frame(self, frame):
else:
raise NoDataError("Provide at least a position, velocity"
" or force group in the h5md file.")
except ValueError:
except (ValueError, IndexError):
raise IOError from None

self._frame = frame
Expand Down
Loading

0 comments on commit c0f0f52

Please sign in to comment.