From e8403c77d2fda81c936d76554307e326166bf182 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Sat, 24 Oct 2020 11:22:20 +1100 Subject: [PATCH 01/20] Add dev and stable versions once (#3009) * fix #3006 * fixed the for/else loop that accidentally added too many versions of dev/ and stable/ (cherry picked from commit 2d14dbd71b58c534a6bf710fc6a063b4eaf33cdf) --- maintainer/update_json_stubs_sitemap.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/maintainer/update_json_stubs_sitemap.py b/maintainer/update_json_stubs_sitemap.py index a4cd9e537bd..f6b1436abc4 100644 --- a/maintainer/update_json_stubs_sitemap.py +++ b/maintainer/update_json_stubs_sitemap.py @@ -146,13 +146,13 @@ def add_or_update_version(version): if ver["version"] == version: ver["url"] = os.path.join(URL, version) break - else: - versions.append({ - "version": version, - "display": version, - "url": os.path.join(URL, version), - "latest": False - }) + else: + versions.append({ + "version": version, + "display": version, + "url": os.path.join(URL, version), + "latest": False + }) def copy_version(old_version, new_version): From 0b6b372fdfcdef15aacbe1c2b82d728f4f1c0401 Mon Sep 17 00:00:00 2001 From: Jonathan Barnoud Date: Thu, 15 Oct 2020 14:55:52 +0100 Subject: [PATCH 02/20] Have CI use mamba (#2983) Not an issue targetted fix. Improve CI (no user facing changes) - Overview mamba is a dropin replacement for the conda CLI but faster - Work done in this PR Enabled the `MAMBA` environment variable keyword for the CI helper. (cherry picked from commit 2ee4e9da5aa3a2c1b21fc3d1897bd70e0ab2064d) --- .travis.yml | 1 + package/CHANGELOG | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4cd53121e44..2729ec15056 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,7 @@ env: - INSTALL_HOLE="true" - CYTHON_TRACE_NOGIL=1 - MPLBACKEND=agg + - MAMBA=true jobs: # Run a coverage test for most versions diff --git a/package/CHANGELOG b/package/CHANGELOG index 4589c6a5fec..6f28be11f20 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -50,6 +50,10 @@ Fixes Enhancements * Improved performances when parsing TPR files (PR #2804) +Changes (not affecting users) + * Continuous integration uses mamba rather than conda to install the + dependencies (PR #2983) + Deprecations * waterdynamics.HydrogenBondLifetimes will be removed in 2.0.0 and replaced with hydrogenbonds.HydrogenBondAnalysis.lifetime() (#2547) From b37f51870b088099bde09e808c90b927b3baae95 Mon Sep 17 00:00:00 2001 From: mnmelo Date: Sun, 18 Oct 2020 10:35:15 +0100 Subject: [PATCH 03/20] Fixed AtomGroup.center's behavior when using compounds in conjugation with unwrapping (PR #2992) fixes #2984 (cherry picked from commit beb5232dc7501e6bc0138036f697aa14da2a4162) --- package/CHANGELOG | 4 +- package/MDAnalysis/core/groups.py | 10 ++- .../MDAnalysisTests/core/test_atomgroup.py | 67 +++++++++++++------ 3 files changed, 56 insertions(+), 25 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 6f28be11f20..3dfb362bacb 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -15,7 +15,7 @@ The rules for this file: ------------------------------------------------------------------------------ ??/??/20 richardjgowers, IAlibay, orbeckst, tylerjereddy, jbarnoud, yuxuanzhuang, lilyminium, VOD555, p-j-smith, bieniekmateusz, - calcraven, ianmkenney, rcrehuet + calcraven, ianmkenney, rcrehuet, manuel.nuno.melo * 1.0.1 @@ -25,6 +25,8 @@ Fixes * Testsuite does not use any more matplotlib.use('agg') (#2191) * The methods provided by topology attributes now appear in the documentation (Issue #1845) + * AtomGroup.center now works correctly for compounds + unwrapping + (Issue #2984) * In ChainReader, read_frame does not trigger change of iterating position. (Issue #2723, PR #2815) * empty_atomgroup.select_atoms('name *') now returns an empty diff --git a/package/MDAnalysis/core/groups.py b/package/MDAnalysis/core/groups.py index 74edf05ab74..d47cdb35dd6 100644 --- a/package/MDAnalysis/core/groups.py +++ b/package/MDAnalysis/core/groups.py @@ -851,12 +851,18 @@ def center(self, weights, pbc=False, compound='group', unwrap=False): # Sort positions and weights by compound index and promote to dtype if # required: - sort_indices = np.argsort(compound_indices) + + # are we already sorted? argsorting and fancy-indexing can be expensive + if np.any(np.diff(compound_indices) < 0): + sort_indices = np.argsort(compound_indices) + else: + sort_indices = slice(None) compound_indices = compound_indices[sort_indices] # Unwrap Atoms if unwrap: - coords = atoms.unwrap(compound=comp, reference=None, inplace=False) + coords = atoms.unwrap(compound=comp, reference=None, + inplace=False)[sort_indices] else: coords = atoms.positions[sort_indices] if weights is None: diff --git a/testsuite/MDAnalysisTests/core/test_atomgroup.py b/testsuite/MDAnalysisTests/core/test_atomgroup.py index 24f8a0bd524..1069d4b681a 100644 --- a/testsuite/MDAnalysisTests/core/test_atomgroup.py +++ b/testsuite/MDAnalysisTests/core/test_atomgroup.py @@ -993,6 +993,12 @@ def ag(self): group.wrap(inplace=True) return group + @pytest.fixture() + def unordered_ag(self, ag): + ndx = np.arange(len(ag)) + np.random.shuffle(ndx) + return ag[ndx] + @pytest.fixture() def ref_noUnwrap_residues(self): return { @@ -1015,12 +1021,12 @@ def ref_Unwrap_residues(self): 'COG': np.array([[21.356, 41.685, 40.501], [44.577, 43.312, 79.039], [ 2.204, 27.722, 54.023]], dtype=np.float32), - 'COM': np.array([[20.815, 42.013, 39.802], - [44.918, 43.282, 79.325], - [2.045, 28.243, 54.127]], dtype=np.float32), - 'MOI': np.array([[16747.486, -1330.489, 2938.243], - [-1330.489, 19315.253, 3306.212], - [ 2938.243, 3306.212, 8990.481]]), + 'COM': np.array([[21.286, 41.664, 40.465], + [44.528, 43.426, 78.671], + [ 2.111, 27.871, 53.767]], dtype=np.float32), + 'MOI': np.array([[16687.941, -1330.617, 2925.883], + [-1330.617, 19256.178, 3354.832], + [ 2925.883, 3354.832, 8989.946]]), 'Asph': 0.2969491080, } @@ -1060,6 +1066,12 @@ def test_UnWrapFlag_residues(self, ag, ref_Unwrap_residues): assert_almost_equal(ag.moment_of_inertia(unwrap=True, compound='residues'), ref_Unwrap_residues['MOI'], self.prec) assert_almost_equal(ag.asphericity(unwrap=True, compound='residues'), ref_Unwrap_residues['Asph'], self.prec) + def test_UnWrapFlag_residues_unordered(self, unordered_ag, ref_Unwrap_residues): + assert_almost_equal(unordered_ag.center_of_geometry(unwrap=True, compound='residues'), ref_Unwrap_residues['COG'], self.prec) + assert_almost_equal(unordered_ag.center_of_mass(unwrap=True, compound='residues'), ref_Unwrap_residues['COM'], self.prec) + assert_almost_equal(unordered_ag.moment_of_inertia(unwrap=True, compound='residues'), ref_Unwrap_residues['MOI'], self.prec) + assert_almost_equal(unordered_ag.asphericity(unwrap=True, compound='residues'), ref_Unwrap_residues['Asph'], self.prec) + def test_default(self, ref_noUnwrap): u = UnWrapUniverse(is_triclinic=False) group = u.atoms[31:39] # molecules 11 @@ -1283,22 +1295,27 @@ def test_center_of_mass_compounds(self, ag, name, compound): @pytest.mark.parametrize('name, compound', (('resids', 'residues'), ('segids', 'segments'))) - def test_center_of_geometry_compounds_pbc(self, ag, name, compound): + @pytest.mark.parametrize('unwrap', (True, False)) + def test_center_of_geometry_compounds_pbc(self, ag, name, compound, + unwrap): ag.dimensions = [50, 50, 50, 90, 90, 90] - ref = [a.center_of_geometry() for a in ag.groupby(name).values()] + ref = [a.center_of_geometry(unwrap=unwrap) + for a in ag.groupby(name).values()] ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), - ag.dimensions) - cog = ag.center_of_geometry(pbc=True, compound=compound) + ag.dimensions) + cog = ag.center_of_geometry(pbc=True, compound=compound, unwrap=unwrap) assert_almost_equal(cog, ref, decimal=5) @pytest.mark.parametrize('name, compound', (('resids', 'residues'), ('segids', 'segments'))) - def test_center_of_mass_compounds_pbc(self, ag, name, compound): + @pytest.mark.parametrize('unwrap', (True, False)) + def test_center_of_mass_compounds_pbc(self, ag, name, compound, unwrap): ag.dimensions = [50, 50, 50, 90, 90, 90] - ref = [a.center_of_mass() for a in ag.groupby(name).values()] + ref = [a.center_of_mass(unwrap=unwrap) + for a in ag.groupby(name).values()] ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), - ag.dimensions) - com = ag.center_of_mass(pbc=True, compound=compound) + ag.dimensions) + com = ag.center_of_mass(pbc=True, compound=compound, unwrap=unwrap) assert_almost_equal(com, ref, decimal=5) @pytest.mark.parametrize('name, compound', (('molnums', 'molecules'), @@ -1319,24 +1336,30 @@ def test_center_of_mass_compounds_special(self, ag_molfrg, @pytest.mark.parametrize('name, compound', (('molnums', 'molecules'), ('fragindices', 'fragments'))) + @pytest.mark.parametrize('unwrap', (True, False)) def test_center_of_geometry_compounds_special_pbc(self, ag_molfrg, - name, compound): + name, compound, unwrap): ag_molfrg.dimensions = [50, 50, 50, 90, 90, 90] - ref = [a.center_of_geometry() for a in ag_molfrg.groupby(name).values()] + ref = [a.center_of_geometry(unwrap=unwrap) + for a in ag_molfrg.groupby(name).values()] ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), - ag_molfrg.dimensions) - cog = ag_molfrg.center_of_geometry(pbc=True, compound=compound) + ag_molfrg.dimensions) + cog = ag_molfrg.center_of_geometry(pbc=True, compound=compound, + unwrap=unwrap) assert_almost_equal(cog, ref, decimal=5) @pytest.mark.parametrize('name, compound', (('molnums', 'molecules'), ('fragindices', 'fragments'))) + @pytest.mark.parametrize('unwrap', (True, False)) def test_center_of_mass_compounds_special_pbc(self, ag_molfrg, - name, compound): + name, compound, unwrap): ag_molfrg.dimensions = [50, 50, 50, 90, 90, 90] - ref = [a.center_of_mass() for a in ag_molfrg.groupby(name).values()] + ref = [a.center_of_mass(unwrap=unwrap) + for a in ag_molfrg.groupby(name).values()] ref = distances.apply_PBC(np.asarray(ref, dtype=np.float32), - ag_molfrg.dimensions) - com = ag_molfrg.center_of_mass(pbc=True, compound=compound) + ag_molfrg.dimensions) + com = ag_molfrg.center_of_mass(pbc=True, compound=compound, + unwrap=unwrap) assert_almost_equal(com, ref, decimal=5) def test_center_wrong_compound(self, ag): From 9da444233c22f1a5403b7c61679bd5448183000c Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Sat, 24 Oct 2020 09:29:27 -0700 Subject: [PATCH 04/20] increase default Python to 3.7 on Travis CI (#3011) * increase default Python to 3.7 on Travis CI - set PYTHON_VERSION=3.7 - set MAMBA=false for Python 3.5 (no mamba package available, fall backto conda) * ensure conda package is available for numpy 1.13 NumPy 13.3.3 packages are available for Python 2.7 and 3.6 only so for the tests with the minimal numpy version we set Python to 3.6. --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2729ec15056..8638059e0ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ env: - MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html - MAINTAIN_DIR=${TRAVIS_BUILD_DIR}/maintainer # Set default python version to avoid repetition later - - PYTHON_VERSION=3.5 + - PYTHON_VERSION=3.7 - BUILD_DOCS=false - CODECOV=false - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" @@ -44,11 +44,11 @@ env: jobs: # Run a coverage test for most versions - - CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - PYTHON_VERSION=3.8 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - PYTHON_VERSION=3.7 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - PYTHON_VERSION=3.6 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - NUMPY_VERSION=1.13.3 + - NUMPY_VERSION=1.13.3 PYTHON_VERSION=3.6 - NUMPY_VERSION=dev EVENT_TYPE="cron" jobs: @@ -57,7 +57,6 @@ jobs: - env: NAME="Doc" MAIN_CMD="cd package && python setup.py" SETUP_CMD="build_sphinx" - PYTHON_VERSION=3.7 BUILD_DOCS=true BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace" INSTALL_HOLE="false" @@ -94,7 +93,6 @@ jobs: ASV_CHECK="true" - env: NAME="pypi check" - PYTHON_VERSION=3.7 CODECOV="false" MAIN_CMD="cd package && python setup.py" SETUP_CMD="sdist" From 0e3c1083ea16467c194479491fe556cc68d94296 Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Wed, 2 Dec 2020 18:56:39 +0000 Subject: [PATCH 05/20] Adds basic GH Actions CI workflow (#3040) Fixes #3036 ## Work done in this PR - Adds a continuous integration workflow based on github actions. - Disables previous continuous integration workflow based on TravisCI. - Fixes minor Visibledeprecation warnings with the hole2 tests. --- .travis.yml => .disabled-travis.yml | 0 .github/workflows/gh-ci.yaml | 281 ++++++++++++++++++ maintainer/install_hole.sh | 115 ------- .../MDAnalysisTests/analysis/test_hole2.py | 6 +- 4 files changed, 284 insertions(+), 118 deletions(-) rename .travis.yml => .disabled-travis.yml (100%) create mode 100644 .github/workflows/gh-ci.yaml delete mode 100755 maintainer/install_hole.sh diff --git a/.travis.yml b/.disabled-travis.yml similarity index 100% rename from .travis.yml rename to .disabled-travis.yml diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml new file mode 100644 index 00000000000..a9fee810031 --- /dev/null +++ b/.github/workflows/gh-ci.yaml @@ -0,0 +1,281 @@ +name: mda_gh_ci +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +defaults: + run: + shell: bash -l {0} + +env: + MDA_CONDA_MIN_DEPS: "pip pytest mmtf-python biopython networkx cython matplotlib 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_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist' + MDA_PIP_EXTRA_DEPS: 'duecredit parmed' + +jobs: + main_tests: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ] + python-version: [3.6, 3.7, 3.8] + run_type: [FULL, ] + install_hole: [true, ] + codecov: [true, ] + include: + - name: macOS + os: macOS-latest + python-version: 3.7 + run_type: FULL + install_hole: true + codecov: true + - name: minimal-ubuntu + os: ubuntu-latest + python-version: 3.6 + run_type: MIN + install_hole: false + codecov: true + - name: numpy_min + os: ubuntu-latest + python-version: 3.6 + run_type: FULL + install_hole: false + codecov: false + numpy: numpy=1.16.0 + - name: asv_check + os: ubuntu-latest + python-version: 3.7 + run_type: FULL + install_hole: false + codecov: false + env: + CYTHON_TRACE_NOGIL: 1 + MPLBACKEND: agg + GH_OS: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: setup_osx + if: startsWith(matrix.os, 'macOS') + run: | + # Set OS specific vars and compiler flags + echo "OS_NAME=osx" >> $GITHUB_ENV + # TODO: work out why this is necessary (from CI helpers) + echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV + ulimit -S -n 2048 + clang -v + echo "CC=clang" >> $GITHUB_ENV + clang++ -v + echo "CXX=clang++" >> $GITHUB_ENV + gfortran-9 -v + echo "FC=gfortran-9" >> $GITHUB_ENV + + - name: setup_linux + if: startsWith(matrix.os, 'ubuntu') + run: | + # Set OS specific vars and compiler flags + echo "OS_NAME=linux" >> $GITHUB_ENV + gcc -v + echo "CC=gcc" >> $GITHUB_ENV + g++ -v + echo "CXX=g++" >> $GITHUB_ENV + gfortran -v + echo "FC=gfortran" >> $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 + add-pip-as-python-dependency: true + # TODO: mamba causes pip to segfault, switch when fixed + #mamba-version: "*" + architecture: x64 + + - name: install_deps + env: + MDA_CONDA_FULL_DEPS: "${{ env.MDA_CONDA_MIN_DEPS }} ${{ env.MDA_CONDA_EXTRA_DEPS }}" + MDA_PIP_FULL_DEPS: "${{ env.MDA_PIP_MIN_DEPS }} ${{ env.MDA_PIP_EXTRA_DEPS }}" + run: | + # NOTE: vars need to be re-assigned + # 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} + pip install ${pip_deps} + + # also install asv if required + if [ ${{ matrix.name }} = "asv_check" ]; then + pip install asv + fi + + - name: check_setup + run: | + # Check OS and python setup + echo "OS: ${OS_NAME}" + which python + which pip + pip list + conda info + conda list + + - name: install_hole + if : matrix.install_hole + run: | + # We manually build hole2 to avoid OS incompatibilities + git clone https://github.com/MDAnalysis/hole2.git + cd hole2/src + source ../source.apache + (make FC=${FC}) && (make PREFIX=${HOME}/hole2 FC=${FC} install) + source ../source.unset + echo "HOLE_BINDIR=${HOME}/hole2/bin" >> $GITHUB_ENV + echo "${HOME}/hole2/bin" >> $GITHUB_PATH + + - name: install_mda + run: | + # TODO: using install instead of develop here causes coverage to drop + # for .pyx file. If possible a solution for this should be found. + (cd package/ && python setup.py develop) && (cd testsuite/ && python setup.py install) + + - name: run_tests + if: contains(matrix.name, 'asv_check') != true + run: | + PYTEST_FLAGS="--disable-pytest-warnings --durations=50" + if [ ${{ matrix.codecov }} = "true" ]; then + PYTEST_FLAGS="${PYTEST_FLAGS} --cov=MDAnalysis --cov-report=xml" + fi + echo $PYTEST_FLAGS + pytest -n 2 testsuite/MDAnalysisTests $PYTEST_FLAGS + + - name: run_asv + if: contains(matrix.name, 'asv_check') + run: | + cd benchmarks + time python -m asv check -E existing + + - name: codecov + if: matrix.codecov + uses: codecov/codecov-action@v1 + with: + file: coverage.xml + fail_ci_if_error: True + verbose: True + + + build_docs: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + env: + CYTHON_TRACE_NOGIL: 1 + MPLBACKEND: agg + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: biobuilds, conda-forge + add-pip-as-python-dependency: true + architecture: x64 + + - 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} + pip install ${pip_deps} + + - name: install_mda + run: | + cd package && python setup.py develop + + - name: build_docs + run: | + cd package && python setup.py build_sphinx -E + + - name: deploy_docs + if: github.event_name != 'pull_request' + run: | + # place the deploy call here + echo "Oh, maple syrup roast parsnips [Richard Gowers]" + + + pylint_check: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: conda-forge + add-pip-as-python-dependency: true + mamba-version: "*" + architecture: x64 + + - name: install + run: | + which pip + which python + pip install pylint + + - name: pylint + env: + PYLINTRC: package/.pylintrc + run: | + pylint --py3k package/MDAnalysis && pylint --py3k testsuite/MDAnalysisTests + + + pypi_check: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: conda-forge + add-pip-as-python-dependency: true + mamba-version: "*" + architecture: x64 + + - name: install_conda + run: | + conda install setuptools cython numpy twine + + - name: install_mdanalysis + run: | + cd package && python setup.py sdist + + - name: check_package_build + run: | + DISTRIBUTION=$(ls -t1 package/dist/MDAnalysis-*.tar.gz | head -n 1) + test -n "${DISTRIBUTION}" || { echo "no distribution package/dist/MDAnalysis-*.tar.gz found"; exit 1; } + echo "twine check $DISTRIBUTION" + twine check $DISTRIBUTION diff --git a/maintainer/install_hole.sh b/maintainer/install_hole.sh deleted file mode 100755 index 8e2046ae310..00000000000 --- a/maintainer/install_hole.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# Written by Oliver Beckstein, 2016 -# -# This script is placed into the Public Domain using the CC0 1.0 Public Domain -# Dedication https://creativecommons.org/publicdomain/zero/1.0/ -# -# -# NOTE: IF YOU RUN THIS SCRIPT YOU MUST BE ABLE TO COMPLY WITH THE HOLE -# NOT-FOR-PROFIT LICENSE. -# -# -# Install HOLE from http://www.holeprogram.org/ -# -# arguments -# OSNAME : linux | darwin -# PREFIX : "path/to/installdir" -# -# PREFIX can be relative to CWD or an absolute path; it will be created -# and HOLE unpacked under PREFIX (the tar file contains "hole2/...") -# -# -# HOLE v2.2004 is used under the terms of the 'HOLE END USER LICENCE AGREEMENT -# NOT-FOR-PROFIT VERSION' as provided in the installation tarball as file -# 'doc/Licence-not-for-profit.asciidoc' and see copy at -# https://github.com/MDAnalysis/mdanalysis/files/372246/Licence-not-for-profit.txt -# (recent as of 2016-07-19). -# - - -set -o errexit -o nounset - -SCRIPT=$(basename $0) - -# We still use the 2.2004 versions (academic only) because -# for the v2.2005 (Apache license) there are no pre-compiled binaries -# available at http://www.holeprogram.org/ as of 2018-02-22 - -# could switch to http://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Linux-i686.tar.gz -DOWNLOAD_URL_LINUX='https://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Linux-x86_64.tar.gz' -TARFILE_LINUX='hole2-NotForProfit-2.2.004-Linux-x86_64.tar.gz' - -# could switch to http://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz -DOWNLOAD_URL_DARWIN='https://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz' -TARFILE_DARWIN=hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz - -# path to dir with executables in the current HOLE distribution -HOLE_EXE_DIR=hole2/exe - -function die () { - local msg="$1" err=$2 - echo "[${SCRIPT}] ERROR: $msg [$err]" - exit $err -} - -function is_native_executable () { - local filename="$1" OSNAME="$2" - file "${filename}" | grep -qi ${OFORMAT} - return $? -} - -OSNAME="$1" -case "$OSNAME" in - Linux|linux) - OSNAME=Linux - OFORMAT=Linux - DOWNLOAD_URL="${DOWNLOAD_URL_LINUX}" - TARFILE=${TARFILE_LINUX} - ;; - OSX|osx|Darwin|darwin) - OSNAME=Darwin - OFORMAT="Mach-O" - DOWNLOAD_URL="${DOWNLOAD_URL_DARWIN}" - TARFILE=${TARFILE_DARWIN} - ;; - *) - die "OS '${OSNAME}' not supported." 10;; -esac - -PREFIX="$2" -test -n "$PREFIX" || die "missing second argument PREFIX (installation directory)" 10 - -#------------------------------------------------------------ -# start installation -#------------------------------------------------------------ - -mkdir -p "$PREFIX" && cd "$PREFIX" || die "Failed to create and cd to $PREFIX" 1 -if ! test -f ${TARFILE}; then - echo "Downloading ${TARFILE} from ${DOWNLOAD_URL}..." - # fixing curl on travis/anaconda, see http://stackoverflow.com/a/31060428/334357 - export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt - curl -L ${DOWNLOAD_URL} -o ${TARFILE} || \ - die "Failed to download ${TARFILE} from ${DOWNLOAD_URL}" 1 -fi - -# only install the executables in HOLE_EXE_DIR -tar xvf ${TARFILE} ${HOLE_EXE_DIR} || die "Failed 'tar xvf ${TARFILE} ${HOLE_EXE_DIR}'" 1 - -MDA_HOLE_BINDIR="${PWD}/${HOLE_EXE_DIR}" -HOLE_EXE="${MDA_HOLE_BINDIR}/hole" - -test -d "${MDA_HOLE_BINDIR}" || { \ - echo "Content of ${PWD}:"; - ls -la; - die "no HOLE exe dir ${MDA_HOLE_BINDIR} in $PWD" 2; } -test -f "${HOLE_EXE}" || die "hole executable ${HOLE_EXE} not installed" 2 -is_native_executable ${HOLE_EXE} ${OFORMAT} || \ - { file ${HOLE_EXE}; \ - die "${HOLE_EXE} will not run on ${OSNAME} (object format ${OFORMAT})" 3; } - -echo "HOLE executables were installed into ${MDA_HOLE_BINDIR}" -echo ">>> export PATH=\${PATH}:${MDA_HOLE_BINDIR}" - -# repeat this line in .travis.yml -export PATH=${PATH}:${MDA_HOLE_BINDIR} diff --git a/testsuite/MDAnalysisTests/analysis/test_hole2.py b/testsuite/MDAnalysisTests/analysis/test_hole2.py index 700827f027f..580b28485aa 100644 --- a/testsuite/MDAnalysisTests/analysis/test_hole2.py +++ b/testsuite/MDAnalysisTests/analysis/test_hole2.py @@ -488,7 +488,7 @@ def test_over_order_parameters(self, hole): assert key == rmsd idx = np.argsort(op) - arr = np.array(list(hole.profiles.values())) + arr = np.array(list(hole.profiles.values()), dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof @@ -504,7 +504,7 @@ def test_over_order_parameters_file(self, hole, tmpdir): assert key == rmsd idx = np.argsort(op) - arr = np.array(list(hole.profiles.values())) + arr = np.array(list(hole.profiles.values()), dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof @@ -528,7 +528,7 @@ def test_over_order_parameters_frames(self, hole): idx = np.argsort(op[:n_frames]) values = list(hole.profiles.values())[:n_frames] - arr = np.array(values) + arr = np.array(values, dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof From 63444aad24fe31627499a0879ae63c8343250aa3 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Sun, 6 Dec 2020 11:54:35 +1100 Subject: [PATCH 06/20] Deploy docs via GitHub Actions CI (#3053) Fixes #3046. Deploys docs in gh-ci.yaml script and removes Travis --- .github/workflows/gh-ci.yaml | 53 +++++++++++++++++- maintainer/deploy_docs_via_travis.sh | 82 ---------------------------- 2 files changed, 51 insertions(+), 84 deletions(-) delete mode 100644 maintainer/deploy_docs_via_travis.sh diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index a9fee810031..679dd97ec5f 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -19,6 +19,7 @@ env: MDA_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist' MDA_PIP_EXTRA_DEPS: 'duecredit parmed' + jobs: main_tests: if: "github.repository == 'MDAnalysis/mdanalysis'" @@ -211,9 +212,57 @@ jobs: - name: deploy_docs if: github.event_name != 'pull_request' + env: + GH_USER: github-actions + GH_EMAIL: "github-action@users.noreply.github.com" + GH_REPOSITORY: "github.com/${{ github.repository }}.git" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + URL: https://docs.mdanalysis.org + run: | - # place the deploy call here - echo "Oh, maple syrup roast parsnips [Richard Gowers]" + # set up environment variables + # cannot execute bash to make variables in env section + # export URL for the Python script $UPDATE_JSON + export URL + export VERSION=$(cd package/MDAnalysis; python -c 'import version; print(version.__version__)') + UPDATE_JSON=$(pwd)/maintainer/update_json_stubs_sitemap.py + BRANCH="${GITHUB_REF#refs/heads/}" + + # the below turns off non-blocking as it causes large writes to stdout to fail + # (see https://github.com/travis-ci/travis-ci/issues/4704) + # commented out as this is not a problem with gh-actions + # python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' + cd package/doc/html/html + + # move docs into version subfolder + mkdir ../${VERSION} && mv * ../${VERSION} && mv ../${VERSION} $VERSION + + # set up git + REV=$(git rev-parse --short HEAD) + git init + git config user.name $GH_USER + git config user.email $GH_EMAIL + git remote add upstream "https://${GH_USER}:${GH_TOKEN}@${GH_REPOSITORY}" + git fetch --depth 50 upstream $BRANCH gh-pages + git reset upstream/gh-pages + + # redirects and copies + mkdir latest + python $UPDATE_JSON + touch . + touch .nojekyll + + git add -A ${VERSION}/ + git add .nojekyll versions.json *.xml *.html index.html latest + + for dirname in dev stable documentation_pages ; do + if [ -d $dirname ]; then git add $dirname; fi + done + + # check for anything to commit + # https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes + git diff-index --quiet HEAD -- || git commit -m "rebuilt html docs for version ${VERSION} from branch ${BRANCH} with sphinx at ${REV}" + git push -q upstream HEAD:gh-pages pylint_check: diff --git a/maintainer/deploy_docs_via_travis.sh b/maintainer/deploy_docs_via_travis.sh deleted file mode 100644 index 52c613e6b89..00000000000 --- a/maintainer/deploy_docs_via_travis.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# Deploying docs from travis-ci. -# See https://github.com/MDAnalysis/mdanalysis/issues/386 -# Script based on https://github.com/steveklabnik/automatically_update_github_pages_with_travis_example - -# Run this script from the top-level of the checked out git -# repository. A github OAuth token must be available in the evironment -# variable GH_TOKEN and is set up through the .travis.yml -# env:global:secure parameter (encrypted with travis-ci's public key)/ -# -# Additional environment variables set in .travis.yml -# GH_REPOSITORY repo to full from and push to -# GH_DOC_BRANCH branch from which the docs are built -# GIT_CI_USER name of the user to push docs as -# GIT_CI_EMAIL email of the user to push docs as -# MDA_DOCDIR path to the docdir from top of repo -# MAINTAIN_DIR path to maintainer/ -# VERSION version of MDAnalysis -# -# NOTE: If any of these environment variables are not set or -# empty then the script will exit with and error (-o nounset). - -set -o errexit -o nounset - -function die () { - local msg="$1" err=${2:-1} - echo "ERROR: $msg [$err]" - exit $err -} - -rev=$(git rev-parse --short HEAD) - -# the following tests should be superfluous because of -o nounset -test -n "${GH_TOKEN}" || die "GH_TOKEN is empty: need OAuth GitHub token to continue" 100 -test -n "${GH_REPOSITORY}" || die "GH_REPOSITORY must be set in .travis.yml" 100 -test -n "${MDA_DOCDIR}" || die "MDA_DOCDIR must be set in .travis.yml" 100 -test -n "${MAINTAIN_DIR}" || die "MAINTAIN_DIR must be set in .travis.yml" 100 -test -n "${VERSION}" || die "VERSION must be set in .travis.yml" 100 - - -cd ${MDA_DOCDIR} || die "Failed to 'cd ${MDA_DOCDIR}'. Run from the top level of the repository" - -# move into $version subdirectory -mkdir ../${VERSION} && mv * ../${VERSION} - -git init -git config user.name "${GIT_CI_USER}" -git config user.email "${GIT_CI_EMAIL}" - -mv ../${VERSION} $VERSION - -git remote add upstream "https://${GH_TOKEN}@${GH_REPOSITORY}" -git fetch --depth 50 upstream ${GH_DOC_BRANCH} gh-pages -git reset upstream/gh-pages - -# === REDIRECTS AND COPIES ==== -# home (index.html) redirects to stable/ -# latest (latest/index.html) redirects to most recent release -# dev/ is a copy of the dev docs with the highest number (so 2.0.0-dev instead of 1.0.1-dev) -# stable/ is a copy of the release docs with the highest number -mkdir latest -export URL="https://docs.mdanalysis.org" -python ${MAINTAIN_DIR}/update_json_stubs_sitemap.py -touch . -touch .nojekyll - -git add -A ${VERSION}/ -git add .nojekyll versions.json -git add index.html latest - -for dirname in dev stable documentation_pages ; do - if [ -d $dirname ]; then git add $dirname; fi -done - -git add *.xml *.html - -# check for anything to commit -# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes -git diff-index --quiet HEAD -- || git commit -m "rebuilt html docs for version ${VERSION} from branch ${GH_DOC_BRANCH} with sphinx at ${rev}" -git push -q upstream HEAD:gh-pages - - From 0030b3864eb77a90a9442904e7d64d1619c6add5 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Mon, 19 Oct 2020 08:57:47 -0600 Subject: [PATCH 07/20] TST, CI: add ARM64 Graviton 2 to CI (#2956) * TST, CI: add ARM64 Graviton 2 to CI * start testing MDAnalysis on ARM64 using new AWS Graviton 2 architecture available in Travis CI * testing on my fork shows only two failures in the MDAnalysis test suite using a fairly minimal set of dependencies; we can probably either fix those or skip them and open an issue * the test failures are: `test_written_remarks_property` `TestEncoreClustering.test_clustering_three_ensembles_two_identical` * run time for this CI entry is about 23 minutes, which is solid for ARM; we save a lot of time using experimental upstream wheels in some cases and excluding (source builds of) dependencies where possible until the ARM64 binary wheel ecosystem matures a bit more * MAINT: ARM64 shims * adjust `CAffinityPropagation()` C-level function to use `double` instead of `float` in some strategic locations that allow the `test_clustering_three_ensembles_two_identical()` test to pass on gcc115 ARM64 machine * mark `test_written_remarks_property()` as a known failure on ARM64; it fails in Travis CI on that platform, but not on gcc115 ARM64 machine; that said, this test is already known to be flaky on Windows 32-bit (may depend on character settings on machine?) * MAINT: MR 2956 revisions * reduce optimization level of MDAnalysis builds on ARM64 to avoid problems with `ap.c` causing test failures on that architecture * revert any source changes to `ap.c` --- .disabled-travis.yml | 25 +++++++++++++++++++ package/setup.py | 11 ++++++-- .../MDAnalysisTests/formats/test_libdcd.py | 7 ++++-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.disabled-travis.yml b/.disabled-travis.yml index 8638059e0ab..1569758168d 100644 --- a/.disabled-travis.yml +++ b/.disabled-travis.yml @@ -111,6 +111,31 @@ jobs: INSTALL_HOLE="false" CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - os: linux + language: python + arch: arm64-graviton2 + python: + - "3.7" + dist: focal + virt: vm + group: edge + before_install: + - python -m pip install cython numpy + # special test SciPy wheel for ARM64: + - python -m pip install https://anaconda.org/multibuild-wheels-staging/scipy/1.6.0.dev0+a240c17/download/scipy-1.6.0.dev0+a240c17-cp37-cp37m-manylinux2014_aarch64.whl + - python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm + install: + - cd package + - python setup.py install + - cd ../testsuite + - python setup.py install + - cd .. + script: + - cd testsuite + - python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis + after_success: + - echo "Override this stage for ARM64" + allow_failures: - env: NUMPY_VERSION=dev EVENT_TYPE="cron" diff --git a/package/setup.py b/package/setup.py index e48e12c52e2..c5fc43675d9 100755 --- a/package/setup.py +++ b/package/setup.py @@ -268,8 +268,15 @@ def extensions(config): use_cython = config.get('use_cython', default=not is_release) use_openmp = config.get('use_openmp', default=True) - extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops', - '-fsigned-zeros'] # see #2722 + if platform.machine() == 'aarch64': + # reduce optimization level for ARM64 machines + # because of issues with test failures sourcing to: + # MDAnalysis/analysis/encore/clustering/src/ap.c + extra_compile_args = ['-std=c99', '-ffast-math', '-O1', '-funroll-loops', + '-fsigned-zeros'] + else: + extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops', + '-fsigned-zeros'] # see #2722 define_macros = [] if config.get('debug_cflags', default=False): extra_compile_args.extend(['-Wall', '-pedantic']) diff --git a/testsuite/MDAnalysisTests/formats/test_libdcd.py b/testsuite/MDAnalysisTests/formats/test_libdcd.py index 0028a80bd3b..240aee1a74e 100644 --- a/testsuite/MDAnalysisTests/formats/test_libdcd.py +++ b/testsuite/MDAnalysisTests/formats/test_libdcd.py @@ -22,6 +22,7 @@ import sys import string import struct +import platform import hypothesis.strategies as strategies from hypothesis import example, given @@ -317,8 +318,10 @@ def write_dcd(in_name, out_name, remarks='testing', header=None): f_out.write(xyz=frame.xyz, box=frame.unitcell) -@pytest.mark.xfail(os.name == 'nt' and sys.maxsize <= 2**32, - reason="occasional fail on 32-bit windows") +@pytest.mark.xfail((os.name == 'nt' + and sys.maxsize <= 2**32) or + platform.machine() == 'aarch64', + reason="occasional fail on 32-bit windows and ARM") @given(remarks=strategies.text( alphabet=string.printable, min_size=0, max_size=239)) # handle the printable ASCII strings From 3b941da27393fc97d2b19c62b49685985e8eac90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bouysset?= Date: Fri, 30 Oct 2020 20:50:21 +0100 Subject: [PATCH 08/20] ParmEdConverter: fix NameError when catching NoDataError (#2953) * fix NameError when catching NoDataError * add test + missing imports --- package/MDAnalysis/coordinates/ParmEd.py | 3 +++ testsuite/MDAnalysisTests/coordinates/test_parmed.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/package/MDAnalysis/coordinates/ParmEd.py b/package/MDAnalysis/coordinates/ParmEd.py index c35b16103f0..dfb996903bd 100644 --- a/package/MDAnalysis/coordinates/ParmEd.py +++ b/package/MDAnalysis/coordinates/ParmEd.py @@ -74,10 +74,13 @@ """ from __future__ import absolute_import import functools +import itertools +import warnings from . import base from ..topology.tables import SYMB2Z from ..core.universe import Universe +from ..exceptions import NoDataError class ParmEdReader(base.SingleFrameReaderBase): diff --git a/testsuite/MDAnalysisTests/coordinates/test_parmed.py b/testsuite/MDAnalysisTests/coordinates/test_parmed.py index a1fe4e44326..5dd350e86fd 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_parmed.py +++ b/testsuite/MDAnalysisTests/coordinates/test_parmed.py @@ -206,6 +206,17 @@ def test_equivalent_dihedrals(self, ref, roundtrip): p.improper == q.improper and p.ignore_end == q.ignore_end) for q in original) + def test_missing_attr(self): + n_atoms = 10 + u = mda.Universe.empty(n_atoms) + u.add_TopologyAttr("resid", [1]) + u.add_TopologyAttr("segid", ["DUM"]) + u.add_TopologyAttr("mass", [1] * n_atoms) + with pytest.warns(UserWarning, + match="Supplied AtomGroup was missing the following " + "attributes"): + # should miss names and resnames + u.atoms.convert_to("PARMED") class BaseTestParmEdConverterSubset(BaseTestParmEdConverter): From c07b5c8897688d778e57e1ef34be86f58c969fe7 Mon Sep 17 00:00:00 2001 From: Summersnow Date: Thu, 19 Nov 2020 10:57:47 +0800 Subject: [PATCH 09/20] Improve the performance of ParmEd converter. (Fix #3028) (#3029) Fixes #3028 * Improves the performance of the ParmEd converter by using a dictionary lookup for the atomgroup to universe index mapping. --- package/AUTHORS | 1 + package/CHANGELOG | 3 ++- package/MDAnalysis/coordinates/ParmEd.py | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/AUTHORS b/package/AUTHORS index 401bd935fca..7ebc3b8a96c 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -149,6 +149,7 @@ Chronological list of authors - Marcello Sega - Nicholas Craven - Ramon Crehuet + - Haochuan Chen External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 3dfb362bacb..5e252f2b1af 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -15,7 +15,7 @@ The rules for this file: ------------------------------------------------------------------------------ ??/??/20 richardjgowers, IAlibay, orbeckst, tylerjereddy, jbarnoud, yuxuanzhuang, lilyminium, VOD555, p-j-smith, bieniekmateusz, - calcraven, ianmkenney, rcrehuet, manuel.nuno.melo + calcraven, ianmkenney, rcrehuet, manuel.nuno.melo, hanatok * 1.0.1 @@ -50,6 +50,7 @@ Fixes (Issue #2934) Enhancements + * Improved performance of the ParmEd converter (Issue #3028, PR #3029) * Improved performances when parsing TPR files (PR #2804) Changes (not affecting users) diff --git a/package/MDAnalysis/coordinates/ParmEd.py b/package/MDAnalysis/coordinates/ParmEd.py index dfb996903bd..b2eb92d9c3f 100644 --- a/package/MDAnalysis/coordinates/ParmEd.py +++ b/package/MDAnalysis/coordinates/ParmEd.py @@ -133,7 +133,7 @@ def _read_first_frame(self): } def get_indices_from_subset(i, atomgroup=None, universe=None): - return atomgroup.index(universe.atoms[i]) + return atomgroup[universe.atoms[i]] class ParmEdConverter(base.ConverterBase): """Convert MDAnalysis AtomGroup or Universe to ParmEd :class:`~parmed.structure.Structure`. @@ -263,8 +263,10 @@ def convert(self, obj): struct.box = None if hasattr(ag_or_ts, 'universe'): + atomgroup = {atom: index for index, + atom in enumerate(list(ag_or_ts))} get_atom_indices = functools.partial(get_indices_from_subset, - atomgroup=list(ag_or_ts), + atomgroup=atomgroup, universe=ag_or_ts.universe) else: get_atom_indices = lambda x: x From 082b087bd3af8346befd36448d257134a21063db Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Wed, 9 Dec 2020 12:56:46 +1100 Subject: [PATCH 10/20] mv travis back and only keep 3.5 and 2.7 --- .disabled-travis.yml | 205 ------------------------------------------- .travis.yml | 81 +++++++++++++++++ 2 files changed, 81 insertions(+), 205 deletions(-) delete mode 100644 .disabled-travis.yml create mode 100644 .travis.yml diff --git a/.disabled-travis.yml b/.disabled-travis.yml deleted file mode 100644 index 1569758168d..00000000000 --- a/.disabled-travis.yml +++ /dev/null @@ -1,205 +0,0 @@ -version: ~> 1.0 -language: generic -group: travis_latest - -# Only build for develop and master (and PRs) -branches: - only: - - master - - develop - -os: - linux - -env: - global: - - secure: "VJ8cMKXuVe7e6vlBeUkd8j6wUbxYF0Yja6CHn0tmpzVGm3CCBXxoZcgvgtfyJTjf+2nqKIjsIy4FdYIkotXYaDwAX5XHHHWS/++7917pddJ2nZkBnBI069c2gLL6vU7E7jbGUzmKywsA73Of44pVsYgtGneK0F7/guLawpWBOOpLsui+pL2X4jYXZL4WHjTPGTphUN4uhQIkqKkuu9ZSR6uodzZDjzkH+q0FT5RLqmgVttnCD9ZmS2ppQsI9f0jZUd8V0M4NGaTHd439uj1UpMMriSJEzcq9DsKZEncjoJZGqfnXPUG9j5Z+jZ8TyxClma93HxeXbXa8A4B6V0wwNA2VG3ZCCeSQon2iNVl8YNZLPaMQleeoQ+uT6D4z26fHVGzk4knMeTROCfHoZo2T8as5EeFDvcbXGva82BnF+aCFxj/d9f1VC3too7bsY+gBBUu/oxVizDWDEby+2Iz2EzUGG3YltF0MjaLrFQ5ggox4vZVVgmlJo8KT6zonTNl8EdKwIzUDh1ZrpiNv3yMgt030heTFL6EJ30xRQJZkwwklJBPgDuARz2FxyKk+hO8IR7AuGLICwP1IpUASXaKeSD1K09qUnmB8W8RO5YhnLu7ABr6oghU9t63r1V0jLTCvYbO4SQIJ2muNsTay/rKo5QtzklPka/5Kud6KyIrsKb4=" - - GH_DOC_BRANCH=develop - - GH_REPOSITORY=github.com/MDAnalysis/mdanalysis.git - - GIT_CI_USER=TravisCI - - GIT_CI_EMAIL=TravisCI@mdanalysis.org - - MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html - - MAINTAIN_DIR=${TRAVIS_BUILD_DIR}/maintainer - # Set default python version to avoid repetition later - - PYTHON_VERSION=3.7 - - BUILD_DOCS=false - - CODECOV=false - - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" - - PYTEST_LIST="testsuite/MDAnalysisTests" - - MAIN_CMD="pytest ${PYTEST_LIST}" - - SETUP_CMD="${PYTEST_FLAGS}" - - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" - - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" - - CONDA_PY2_DEPENDENCIES="six funcsigs" - - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 tqdm>=4.43.0" - - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} chemfiles" - - CONDA_CHANNELS='biobuilds conda-forge' - - CONDA_CHANNEL_PRIORITY=True - - PIP_DEPENDENCIES="duecredit parmed" - - NUMPY_VERSION=stable - - INSTALL_HOLE="true" - - CYTHON_TRACE_NOGIL=1 - - MPLBACKEND=agg - - MAMBA=true - - jobs: - # Run a coverage test for most versions - - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.8 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.7 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.6 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - NUMPY_VERSION=1.13.3 PYTHON_VERSION=3.6 - - NUMPY_VERSION=dev EVENT_TYPE="cron" - -jobs: - fast_finish: true - include: - - env: NAME="Doc" - MAIN_CMD="cd package && python setup.py" - SETUP_CMD="build_sphinx" - BUILD_DOCS=true - BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace" - INSTALL_HOLE="false" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} sphinx==1.8.5 sphinx-sitemap sphinx_rtd_theme msmb_theme==1.2.0" - - - env: NAME="Lint" - PYLINTRC="${TRAVIS_BUILD_DIR}/package/.pylintrc" - MAIN_CMD="pylint package/MDAnalysis && pylint testsuite/MDAnalysisTests" - SETUP_CMD="" - BUILD_CMD="" - CONDA_DEPENDENCIES="" - INSTALL_HOLE="false" - - # pin dependencies for legacy: - # - ensure that chemfiles can get the last netcdf4 that is still supported - # see https://github.com/MDAnalysis/mdanalysis/pull/2798#issuecomment-679991785 - # - install chemfiles and chemfiles-lib via pip (conda times out) - - env: NAME="python 2.7" - PYTHON_VERSION=2.7 - CODECOV="true" - NUMPY_VERSION=1.16 - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" - - - env: NAME="asv check" - PYTHON_VERSION=2.7 - CODECOV="false" - MAIN_CMD="" - SETUP_CMD="" - NUMPY_VERSION=1.16 - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0" - ASV_CHECK="true" - - - env: NAME="pypi check" - CODECOV="false" - MAIN_CMD="cd package && python setup.py" - SETUP_CMD="sdist" - BUILD_CMD="" - INSTALL_HOLE="false" - CONDA_DEPENDENCIES="setuptools cython twine" - PYPI_CHECK="true" - - - os: osx - env: PYTHON_VERSION=3.6 - NUMPY_VERSION=1.17.3 - - - env: NAME='minimal' - PIP_DEPENDENCIES="" - CONDA_DEPENDENCIES=${CONDA_MIN_DEPENDENCIES} - INSTALL_HOLE="false" - CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - - os: linux - language: python - arch: arm64-graviton2 - python: - - "3.7" - dist: focal - virt: vm - group: edge - before_install: - - python -m pip install cython numpy - # special test SciPy wheel for ARM64: - - python -m pip install https://anaconda.org/multibuild-wheels-staging/scipy/1.6.0.dev0+a240c17/download/scipy-1.6.0.dev0+a240c17-cp37-cp37m-manylinux2014_aarch64.whl - - python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm - install: - - cd package - - python setup.py install - - cd ../testsuite - - python setup.py install - - cd .. - script: - - cd testsuite - - python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis - after_success: - - echo "Override this stage for ARM64" - - allow_failures: - - env: NUMPY_VERSION=dev EVENT_TYPE="cron" - -before_install: - # Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307) - # See https://github.com/searchivarius/nmslib/pull/259 - - | - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - command curl -sSL https://rvm.io/mpapis.asc | gpg --import -; - rvm get head || true - fi - -install: - # download hole first to use system curl - # additional external tools (Issue #898) -- HOLE - - | - if [[ $INSTALL_HOLE == 'true' ]]; then \ - bash ./maintainer/install_hole.sh $TRAVIS_OS_NAME "${HOME}"; \ - HOLE_BINDIR="${HOME}/hole2/exe"; \ - export PATH=${PATH}:${HOLE_BINDIR}; \ - fi - - git clone git://github.com/astropy/ci-helpers.git - - source ci-helpers/travis/setup_conda.sh - - eval $BUILD_CMD - -script: - - cd ${TRAVIS_BUILD_DIR} - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then ulimit -S -n 2048; fi - - echo $MAIN_CMD $SETUP_CMD - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then pip install pytest; fi - - eval $MAIN_CMD $SETUP_CMD - # check benchmark suite for basic issues - - | - if [ "${ASV_CHECK}" == "true" ]; then - python -m pip install asv - cd testsuite - python setup.py install - cd ../benchmarks - time python -m asv check -E existing - fi - # check pypi package build - - | - if [[ "${PYPI_CHECK}" == "true" ]]; then - DISTRIBUTION=$(ls -t1 ${TRAVIS_BUILD_DIR}/package/dist/MDAnalysis-*.tar.gz | head -n 1) - test -n "${DISTRIBUTION}" || { echo "no distribution package/dist/MDAnalysis-*.tar.gz found"; exit 1; } - echo "twine check $DISTRIBUTION" - twine check $DISTRIBUTION - fi - -after_success: - - | - if [[ $CODECOV == 'true' ]]; then \ - codecov; \ - fi - # can't use test here since this leads to travis fails even though the build passes - # turn off blocking as it causes large writes to stdout to fail - # (see https://github.com/travis-ci/travis-ci/issues/4704) - - | - if [[ ${TRAVIS_PULL_REQUEST} == "false" ]] && [[ ${BUILD_DOCS} == "true" ]] ; then - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - cd ${TRAVIS_BUILD_DIR}/package/MDAnalysis - export GH_DOC_BRANCH=${TRAVIS_BRANCH} - export VERSION=$(python -c "import version; print(version.__version__)") - cd - - bash ${TRAVIS_BUILD_DIR}/maintainer/deploy_docs_via_travis.sh; - fi - diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..d2106c68684 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,81 @@ +version: ~> 1.0 +language: generic +group: travis_latest + +# Only build for develop and master (and PRs) +branches: + only: + - master + - develop + +os: + linux + +env: + global: + - secure: "VJ8cMKXuVe7e6vlBeUkd8j6wUbxYF0Yja6CHn0tmpzVGm3CCBXxoZcgvgtfyJTjf+2nqKIjsIy4FdYIkotXYaDwAX5XHHHWS/++7917pddJ2nZkBnBI069c2gLL6vU7E7jbGUzmKywsA73Of44pVsYgtGneK0F7/guLawpWBOOpLsui+pL2X4jYXZL4WHjTPGTphUN4uhQIkqKkuu9ZSR6uodzZDjzkH+q0FT5RLqmgVttnCD9ZmS2ppQsI9f0jZUd8V0M4NGaTHd439uj1UpMMriSJEzcq9DsKZEncjoJZGqfnXPUG9j5Z+jZ8TyxClma93HxeXbXa8A4B6V0wwNA2VG3ZCCeSQon2iNVl8YNZLPaMQleeoQ+uT6D4z26fHVGzk4knMeTROCfHoZo2T8as5EeFDvcbXGva82BnF+aCFxj/d9f1VC3too7bsY+gBBUu/oxVizDWDEby+2Iz2EzUGG3YltF0MjaLrFQ5ggox4vZVVgmlJo8KT6zonTNl8EdKwIzUDh1ZrpiNv3yMgt030heTFL6EJ30xRQJZkwwklJBPgDuARz2FxyKk+hO8IR7AuGLICwP1IpUASXaKeSD1K09qUnmB8W8RO5YhnLu7ABr6oghU9t63r1V0jLTCvYbO4SQIJ2muNsTay/rKo5QtzklPka/5Kud6KyIrsKb4=" + - GH_DOC_BRANCH=develop + - GH_REPOSITORY=github.com/MDAnalysis/mdanalysis.git + - GIT_CI_USER=TravisCI + - GIT_CI_EMAIL=TravisCI@mdanalysis.org + - MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html + - MAINTAIN_DIR=${TRAVIS_BUILD_DIR}/maintainer + # Set default python version to avoid repetition later + - PYTHON_VERSION=3.7 + - BUILD_DOCS=false + - CODECOV=false + - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" + - PYTEST_LIST="testsuite/MDAnalysisTests" + - MAIN_CMD="pytest ${PYTEST_LIST}" + - SETUP_CMD="${PYTEST_FLAGS}" + - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" + - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" + - CONDA_PY2_DEPENDENCIES="six funcsigs" + - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 tqdm>=4.43.0" + - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} chemfiles" + - CONDA_CHANNELS='biobuilds conda-forge' + - CONDA_CHANNEL_PRIORITY=True + - PIP_DEPENDENCIES="duecredit parmed" + - NUMPY_VERSION=stable + - INSTALL_HOLE="true" + - CYTHON_TRACE_NOGIL=1 + - MPLBACKEND=agg + - MAMBA=true + + jobs: + # Run a coverage test for most versions + - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + +jobs: + fast_finish: true + include: + + # pin dependencies for legacy: + # - ensure that chemfiles can get the last netcdf4 that is still supported + # see https://github.com/MDAnalysis/mdanalysis/pull/2798#issuecomment-679991785 + # - install chemfiles and chemfiles-lib via pip (conda times out) + - env: NAME="python 2.7" + PYTHON_VERSION=2.7 + CODECOV="true" + NUMPY_VERSION=1.16 + CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" + SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" + +install: + # download hole first to use system curl + # additional external tools (Issue #898) -- HOLE + - | + if [[ $INSTALL_HOLE == 'true' ]]; then \ + bash ./maintainer/install_hole.sh $TRAVIS_OS_NAME "${HOME}"; \ + HOLE_BINDIR="${HOME}/hole2/exe"; \ + export PATH=${PATH}:${HOLE_BINDIR}; \ + fi + - git clone git://github.com/astropy/ci-helpers.git + - source ci-helpers/travis/setup_conda.sh + - eval $BUILD_CMD + +script: + - cd ${TRAVIS_BUILD_DIR} + - echo $MAIN_CMD $SETUP_CMD + - eval $MAIN_CMD $SETUP_CMD \ No newline at end of file From 74f229c60ec236911cf4c0e460d4de1ea0cc99a7 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Wed, 9 Dec 2020 14:43:17 +1100 Subject: [PATCH 11/20] move py3.5 job --- .travis.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2106c68684..157868457da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,11 @@ env: # Set default python version to avoid repetition later - PYTHON_VERSION=3.7 - BUILD_DOCS=false - - CODECOV=false + - CODECOV=true - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" - PYTEST_LIST="testsuite/MDAnalysisTests" - MAIN_CMD="pytest ${PYTEST_LIST}" - - SETUP_CMD="${PYTEST_FLAGS}" + - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" - CONDA_PY2_DEPENDENCIES="six funcsigs" @@ -42,10 +42,6 @@ env: - MPLBACKEND=agg - MAMBA=true - jobs: - # Run a coverage test for most versions - - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - jobs: fast_finish: true include: @@ -56,12 +52,15 @@ jobs: # - install chemfiles and chemfiles-lib via pip (conda times out) - env: NAME="python 2.7" PYTHON_VERSION=2.7 - CODECOV="true" NUMPY_VERSION=1.16 CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" + - env: NAME="python 3.5" + PYTHON_VERSION=3.5 + MAMBA=false + + install: # download hole first to use system curl # additional external tools (Issue #898) -- HOLE From 383d15e0a673350fd33070448a6d3470498d9e3b Mon Sep 17 00:00:00 2001 From: Irfan Alibay Date: Wed, 2 Dec 2020 18:56:39 +0000 Subject: [PATCH 12/20] Adds basic GH Actions CI workflow (#3040) Fixes #3036 ## Work done in this PR - Adds a continuous integration workflow based on github actions. - Disables previous continuous integration workflow based on TravisCI. - Fixes minor Visibledeprecation warnings with the hole2 tests. --- .travis.yml => .disabled-travis.yml | 0 .github/workflows/gh-ci.yaml | 281 ++++++++++++++++++ maintainer/install_hole.sh | 115 ------- .../MDAnalysisTests/analysis/test_hole2.py | 6 +- 4 files changed, 284 insertions(+), 118 deletions(-) rename .travis.yml => .disabled-travis.yml (100%) create mode 100644 .github/workflows/gh-ci.yaml delete mode 100755 maintainer/install_hole.sh diff --git a/.travis.yml b/.disabled-travis.yml similarity index 100% rename from .travis.yml rename to .disabled-travis.yml diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml new file mode 100644 index 00000000000..a9fee810031 --- /dev/null +++ b/.github/workflows/gh-ci.yaml @@ -0,0 +1,281 @@ +name: mda_gh_ci +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +defaults: + run: + shell: bash -l {0} + +env: + MDA_CONDA_MIN_DEPS: "pip pytest mmtf-python biopython networkx cython matplotlib 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_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist' + MDA_PIP_EXTRA_DEPS: 'duecredit parmed' + +jobs: + main_tests: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ] + python-version: [3.6, 3.7, 3.8] + run_type: [FULL, ] + install_hole: [true, ] + codecov: [true, ] + include: + - name: macOS + os: macOS-latest + python-version: 3.7 + run_type: FULL + install_hole: true + codecov: true + - name: minimal-ubuntu + os: ubuntu-latest + python-version: 3.6 + run_type: MIN + install_hole: false + codecov: true + - name: numpy_min + os: ubuntu-latest + python-version: 3.6 + run_type: FULL + install_hole: false + codecov: false + numpy: numpy=1.16.0 + - name: asv_check + os: ubuntu-latest + python-version: 3.7 + run_type: FULL + install_hole: false + codecov: false + env: + CYTHON_TRACE_NOGIL: 1 + MPLBACKEND: agg + GH_OS: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: setup_osx + if: startsWith(matrix.os, 'macOS') + run: | + # Set OS specific vars and compiler flags + echo "OS_NAME=osx" >> $GITHUB_ENV + # TODO: work out why this is necessary (from CI helpers) + echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV + ulimit -S -n 2048 + clang -v + echo "CC=clang" >> $GITHUB_ENV + clang++ -v + echo "CXX=clang++" >> $GITHUB_ENV + gfortran-9 -v + echo "FC=gfortran-9" >> $GITHUB_ENV + + - name: setup_linux + if: startsWith(matrix.os, 'ubuntu') + run: | + # Set OS specific vars and compiler flags + echo "OS_NAME=linux" >> $GITHUB_ENV + gcc -v + echo "CC=gcc" >> $GITHUB_ENV + g++ -v + echo "CXX=g++" >> $GITHUB_ENV + gfortran -v + echo "FC=gfortran" >> $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 + add-pip-as-python-dependency: true + # TODO: mamba causes pip to segfault, switch when fixed + #mamba-version: "*" + architecture: x64 + + - name: install_deps + env: + MDA_CONDA_FULL_DEPS: "${{ env.MDA_CONDA_MIN_DEPS }} ${{ env.MDA_CONDA_EXTRA_DEPS }}" + MDA_PIP_FULL_DEPS: "${{ env.MDA_PIP_MIN_DEPS }} ${{ env.MDA_PIP_EXTRA_DEPS }}" + run: | + # NOTE: vars need to be re-assigned + # 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} + pip install ${pip_deps} + + # also install asv if required + if [ ${{ matrix.name }} = "asv_check" ]; then + pip install asv + fi + + - name: check_setup + run: | + # Check OS and python setup + echo "OS: ${OS_NAME}" + which python + which pip + pip list + conda info + conda list + + - name: install_hole + if : matrix.install_hole + run: | + # We manually build hole2 to avoid OS incompatibilities + git clone https://github.com/MDAnalysis/hole2.git + cd hole2/src + source ../source.apache + (make FC=${FC}) && (make PREFIX=${HOME}/hole2 FC=${FC} install) + source ../source.unset + echo "HOLE_BINDIR=${HOME}/hole2/bin" >> $GITHUB_ENV + echo "${HOME}/hole2/bin" >> $GITHUB_PATH + + - name: install_mda + run: | + # TODO: using install instead of develop here causes coverage to drop + # for .pyx file. If possible a solution for this should be found. + (cd package/ && python setup.py develop) && (cd testsuite/ && python setup.py install) + + - name: run_tests + if: contains(matrix.name, 'asv_check') != true + run: | + PYTEST_FLAGS="--disable-pytest-warnings --durations=50" + if [ ${{ matrix.codecov }} = "true" ]; then + PYTEST_FLAGS="${PYTEST_FLAGS} --cov=MDAnalysis --cov-report=xml" + fi + echo $PYTEST_FLAGS + pytest -n 2 testsuite/MDAnalysisTests $PYTEST_FLAGS + + - name: run_asv + if: contains(matrix.name, 'asv_check') + run: | + cd benchmarks + time python -m asv check -E existing + + - name: codecov + if: matrix.codecov + uses: codecov/codecov-action@v1 + with: + file: coverage.xml + fail_ci_if_error: True + verbose: True + + + build_docs: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + env: + CYTHON_TRACE_NOGIL: 1 + MPLBACKEND: agg + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: biobuilds, conda-forge + add-pip-as-python-dependency: true + architecture: x64 + + - 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} + pip install ${pip_deps} + + - name: install_mda + run: | + cd package && python setup.py develop + + - name: build_docs + run: | + cd package && python setup.py build_sphinx -E + + - name: deploy_docs + if: github.event_name != 'pull_request' + run: | + # place the deploy call here + echo "Oh, maple syrup roast parsnips [Richard Gowers]" + + + pylint_check: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: conda-forge + add-pip-as-python-dependency: true + mamba-version: "*" + architecture: x64 + + - name: install + run: | + which pip + which python + pip install pylint + + - name: pylint + env: + PYLINTRC: package/.pylintrc + run: | + pylint --py3k package/MDAnalysis && pylint --py3k testsuite/MDAnalysisTests + + + pypi_check: + if: "github.repository == 'MDAnalysis/mdanalysis'" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: setup_miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: 3.7 + auto-update-conda: true + channel-priority: flexible + channels: conda-forge + add-pip-as-python-dependency: true + mamba-version: "*" + architecture: x64 + + - name: install_conda + run: | + conda install setuptools cython numpy twine + + - name: install_mdanalysis + run: | + cd package && python setup.py sdist + + - name: check_package_build + run: | + DISTRIBUTION=$(ls -t1 package/dist/MDAnalysis-*.tar.gz | head -n 1) + test -n "${DISTRIBUTION}" || { echo "no distribution package/dist/MDAnalysis-*.tar.gz found"; exit 1; } + echo "twine check $DISTRIBUTION" + twine check $DISTRIBUTION diff --git a/maintainer/install_hole.sh b/maintainer/install_hole.sh deleted file mode 100755 index 8e2046ae310..00000000000 --- a/maintainer/install_hole.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# -# Written by Oliver Beckstein, 2016 -# -# This script is placed into the Public Domain using the CC0 1.0 Public Domain -# Dedication https://creativecommons.org/publicdomain/zero/1.0/ -# -# -# NOTE: IF YOU RUN THIS SCRIPT YOU MUST BE ABLE TO COMPLY WITH THE HOLE -# NOT-FOR-PROFIT LICENSE. -# -# -# Install HOLE from http://www.holeprogram.org/ -# -# arguments -# OSNAME : linux | darwin -# PREFIX : "path/to/installdir" -# -# PREFIX can be relative to CWD or an absolute path; it will be created -# and HOLE unpacked under PREFIX (the tar file contains "hole2/...") -# -# -# HOLE v2.2004 is used under the terms of the 'HOLE END USER LICENCE AGREEMENT -# NOT-FOR-PROFIT VERSION' as provided in the installation tarball as file -# 'doc/Licence-not-for-profit.asciidoc' and see copy at -# https://github.com/MDAnalysis/mdanalysis/files/372246/Licence-not-for-profit.txt -# (recent as of 2016-07-19). -# - - -set -o errexit -o nounset - -SCRIPT=$(basename $0) - -# We still use the 2.2004 versions (academic only) because -# for the v2.2005 (Apache license) there are no pre-compiled binaries -# available at http://www.holeprogram.org/ as of 2018-02-22 - -# could switch to http://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Linux-i686.tar.gz -DOWNLOAD_URL_LINUX='https://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Linux-x86_64.tar.gz' -TARFILE_LINUX='hole2-NotForProfit-2.2.004-Linux-x86_64.tar.gz' - -# could switch to http://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz -DOWNLOAD_URL_DARWIN='https://www.holeprogram.org/downloads/2.2.004/hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz' -TARFILE_DARWIN=hole2-NotForProfit-2.2.004-Darwin-i386.tar.gz - -# path to dir with executables in the current HOLE distribution -HOLE_EXE_DIR=hole2/exe - -function die () { - local msg="$1" err=$2 - echo "[${SCRIPT}] ERROR: $msg [$err]" - exit $err -} - -function is_native_executable () { - local filename="$1" OSNAME="$2" - file "${filename}" | grep -qi ${OFORMAT} - return $? -} - -OSNAME="$1" -case "$OSNAME" in - Linux|linux) - OSNAME=Linux - OFORMAT=Linux - DOWNLOAD_URL="${DOWNLOAD_URL_LINUX}" - TARFILE=${TARFILE_LINUX} - ;; - OSX|osx|Darwin|darwin) - OSNAME=Darwin - OFORMAT="Mach-O" - DOWNLOAD_URL="${DOWNLOAD_URL_DARWIN}" - TARFILE=${TARFILE_DARWIN} - ;; - *) - die "OS '${OSNAME}' not supported." 10;; -esac - -PREFIX="$2" -test -n "$PREFIX" || die "missing second argument PREFIX (installation directory)" 10 - -#------------------------------------------------------------ -# start installation -#------------------------------------------------------------ - -mkdir -p "$PREFIX" && cd "$PREFIX" || die "Failed to create and cd to $PREFIX" 1 -if ! test -f ${TARFILE}; then - echo "Downloading ${TARFILE} from ${DOWNLOAD_URL}..." - # fixing curl on travis/anaconda, see http://stackoverflow.com/a/31060428/334357 - export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt - curl -L ${DOWNLOAD_URL} -o ${TARFILE} || \ - die "Failed to download ${TARFILE} from ${DOWNLOAD_URL}" 1 -fi - -# only install the executables in HOLE_EXE_DIR -tar xvf ${TARFILE} ${HOLE_EXE_DIR} || die "Failed 'tar xvf ${TARFILE} ${HOLE_EXE_DIR}'" 1 - -MDA_HOLE_BINDIR="${PWD}/${HOLE_EXE_DIR}" -HOLE_EXE="${MDA_HOLE_BINDIR}/hole" - -test -d "${MDA_HOLE_BINDIR}" || { \ - echo "Content of ${PWD}:"; - ls -la; - die "no HOLE exe dir ${MDA_HOLE_BINDIR} in $PWD" 2; } -test -f "${HOLE_EXE}" || die "hole executable ${HOLE_EXE} not installed" 2 -is_native_executable ${HOLE_EXE} ${OFORMAT} || \ - { file ${HOLE_EXE}; \ - die "${HOLE_EXE} will not run on ${OSNAME} (object format ${OFORMAT})" 3; } - -echo "HOLE executables were installed into ${MDA_HOLE_BINDIR}" -echo ">>> export PATH=\${PATH}:${MDA_HOLE_BINDIR}" - -# repeat this line in .travis.yml -export PATH=${PATH}:${MDA_HOLE_BINDIR} diff --git a/testsuite/MDAnalysisTests/analysis/test_hole2.py b/testsuite/MDAnalysisTests/analysis/test_hole2.py index 700827f027f..580b28485aa 100644 --- a/testsuite/MDAnalysisTests/analysis/test_hole2.py +++ b/testsuite/MDAnalysisTests/analysis/test_hole2.py @@ -488,7 +488,7 @@ def test_over_order_parameters(self, hole): assert key == rmsd idx = np.argsort(op) - arr = np.array(list(hole.profiles.values())) + arr = np.array(list(hole.profiles.values()), dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof @@ -504,7 +504,7 @@ def test_over_order_parameters_file(self, hole, tmpdir): assert key == rmsd idx = np.argsort(op) - arr = np.array(list(hole.profiles.values())) + arr = np.array(list(hole.profiles.values()), dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof @@ -528,7 +528,7 @@ def test_over_order_parameters_frames(self, hole): idx = np.argsort(op[:n_frames]) values = list(hole.profiles.values())[:n_frames] - arr = np.array(values) + arr = np.array(values, dtype=object) for op_prof, arr_prof in zip(profiles.values(), arr[idx]): assert op_prof is arr_prof From 86eb383b6efaf2b14543679766b5e90ea264faa9 Mon Sep 17 00:00:00 2001 From: Lily Wang <31115101+lilyminium@users.noreply.github.com> Date: Sun, 6 Dec 2020 11:54:35 +1100 Subject: [PATCH 13/20] Deploy docs via GitHub Actions CI (#3053) Fixes #3046. Deploys docs in gh-ci.yaml script and removes Travis --- .github/workflows/gh-ci.yaml | 53 +++++++++++++++++- maintainer/deploy_docs_via_travis.sh | 82 ---------------------------- 2 files changed, 51 insertions(+), 84 deletions(-) delete mode 100644 maintainer/deploy_docs_via_travis.sh diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index a9fee810031..679dd97ec5f 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -19,6 +19,7 @@ env: MDA_PIP_MIN_DEPS: 'coveralls coverage<5 pytest-cov pytest-xdist' MDA_PIP_EXTRA_DEPS: 'duecredit parmed' + jobs: main_tests: if: "github.repository == 'MDAnalysis/mdanalysis'" @@ -211,9 +212,57 @@ jobs: - name: deploy_docs if: github.event_name != 'pull_request' + env: + GH_USER: github-actions + GH_EMAIL: "github-action@users.noreply.github.com" + GH_REPOSITORY: "github.com/${{ github.repository }}.git" + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + URL: https://docs.mdanalysis.org + run: | - # place the deploy call here - echo "Oh, maple syrup roast parsnips [Richard Gowers]" + # set up environment variables + # cannot execute bash to make variables in env section + # export URL for the Python script $UPDATE_JSON + export URL + export VERSION=$(cd package/MDAnalysis; python -c 'import version; print(version.__version__)') + UPDATE_JSON=$(pwd)/maintainer/update_json_stubs_sitemap.py + BRANCH="${GITHUB_REF#refs/heads/}" + + # the below turns off non-blocking as it causes large writes to stdout to fail + # (see https://github.com/travis-ci/travis-ci/issues/4704) + # commented out as this is not a problem with gh-actions + # python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' + cd package/doc/html/html + + # move docs into version subfolder + mkdir ../${VERSION} && mv * ../${VERSION} && mv ../${VERSION} $VERSION + + # set up git + REV=$(git rev-parse --short HEAD) + git init + git config user.name $GH_USER + git config user.email $GH_EMAIL + git remote add upstream "https://${GH_USER}:${GH_TOKEN}@${GH_REPOSITORY}" + git fetch --depth 50 upstream $BRANCH gh-pages + git reset upstream/gh-pages + + # redirects and copies + mkdir latest + python $UPDATE_JSON + touch . + touch .nojekyll + + git add -A ${VERSION}/ + git add .nojekyll versions.json *.xml *.html index.html latest + + for dirname in dev stable documentation_pages ; do + if [ -d $dirname ]; then git add $dirname; fi + done + + # check for anything to commit + # https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes + git diff-index --quiet HEAD -- || git commit -m "rebuilt html docs for version ${VERSION} from branch ${BRANCH} with sphinx at ${REV}" + git push -q upstream HEAD:gh-pages pylint_check: diff --git a/maintainer/deploy_docs_via_travis.sh b/maintainer/deploy_docs_via_travis.sh deleted file mode 100644 index 52c613e6b89..00000000000 --- a/maintainer/deploy_docs_via_travis.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# Deploying docs from travis-ci. -# See https://github.com/MDAnalysis/mdanalysis/issues/386 -# Script based on https://github.com/steveklabnik/automatically_update_github_pages_with_travis_example - -# Run this script from the top-level of the checked out git -# repository. A github OAuth token must be available in the evironment -# variable GH_TOKEN and is set up through the .travis.yml -# env:global:secure parameter (encrypted with travis-ci's public key)/ -# -# Additional environment variables set in .travis.yml -# GH_REPOSITORY repo to full from and push to -# GH_DOC_BRANCH branch from which the docs are built -# GIT_CI_USER name of the user to push docs as -# GIT_CI_EMAIL email of the user to push docs as -# MDA_DOCDIR path to the docdir from top of repo -# MAINTAIN_DIR path to maintainer/ -# VERSION version of MDAnalysis -# -# NOTE: If any of these environment variables are not set or -# empty then the script will exit with and error (-o nounset). - -set -o errexit -o nounset - -function die () { - local msg="$1" err=${2:-1} - echo "ERROR: $msg [$err]" - exit $err -} - -rev=$(git rev-parse --short HEAD) - -# the following tests should be superfluous because of -o nounset -test -n "${GH_TOKEN}" || die "GH_TOKEN is empty: need OAuth GitHub token to continue" 100 -test -n "${GH_REPOSITORY}" || die "GH_REPOSITORY must be set in .travis.yml" 100 -test -n "${MDA_DOCDIR}" || die "MDA_DOCDIR must be set in .travis.yml" 100 -test -n "${MAINTAIN_DIR}" || die "MAINTAIN_DIR must be set in .travis.yml" 100 -test -n "${VERSION}" || die "VERSION must be set in .travis.yml" 100 - - -cd ${MDA_DOCDIR} || die "Failed to 'cd ${MDA_DOCDIR}'. Run from the top level of the repository" - -# move into $version subdirectory -mkdir ../${VERSION} && mv * ../${VERSION} - -git init -git config user.name "${GIT_CI_USER}" -git config user.email "${GIT_CI_EMAIL}" - -mv ../${VERSION} $VERSION - -git remote add upstream "https://${GH_TOKEN}@${GH_REPOSITORY}" -git fetch --depth 50 upstream ${GH_DOC_BRANCH} gh-pages -git reset upstream/gh-pages - -# === REDIRECTS AND COPIES ==== -# home (index.html) redirects to stable/ -# latest (latest/index.html) redirects to most recent release -# dev/ is a copy of the dev docs with the highest number (so 2.0.0-dev instead of 1.0.1-dev) -# stable/ is a copy of the release docs with the highest number -mkdir latest -export URL="https://docs.mdanalysis.org" -python ${MAINTAIN_DIR}/update_json_stubs_sitemap.py -touch . -touch .nojekyll - -git add -A ${VERSION}/ -git add .nojekyll versions.json -git add index.html latest - -for dirname in dev stable documentation_pages ; do - if [ -d $dirname ]; then git add $dirname; fi -done - -git add *.xml *.html - -# check for anything to commit -# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommited-changes -git diff-index --quiet HEAD -- || git commit -m "rebuilt html docs for version ${VERSION} from branch ${GH_DOC_BRANCH} with sphinx at ${rev}" -git push -q upstream HEAD:gh-pages - - From 0f9a6e558a5798880c7b5604346a8a15826d0187 Mon Sep 17 00:00:00 2001 From: Tyler Reddy Date: Mon, 19 Oct 2020 08:57:47 -0600 Subject: [PATCH 14/20] TST, CI: add ARM64 Graviton 2 to CI (#2956) * TST, CI: add ARM64 Graviton 2 to CI * start testing MDAnalysis on ARM64 using new AWS Graviton 2 architecture available in Travis CI * testing on my fork shows only two failures in the MDAnalysis test suite using a fairly minimal set of dependencies; we can probably either fix those or skip them and open an issue * the test failures are: `test_written_remarks_property` `TestEncoreClustering.test_clustering_three_ensembles_two_identical` * run time for this CI entry is about 23 minutes, which is solid for ARM; we save a lot of time using experimental upstream wheels in some cases and excluding (source builds of) dependencies where possible until the ARM64 binary wheel ecosystem matures a bit more * MAINT: ARM64 shims * adjust `CAffinityPropagation()` C-level function to use `double` instead of `float` in some strategic locations that allow the `test_clustering_three_ensembles_two_identical()` test to pass on gcc115 ARM64 machine * mark `test_written_remarks_property()` as a known failure on ARM64; it fails in Travis CI on that platform, but not on gcc115 ARM64 machine; that said, this test is already known to be flaky on Windows 32-bit (may depend on character settings on machine?) * MAINT: MR 2956 revisions * reduce optimization level of MDAnalysis builds on ARM64 to avoid problems with `ap.c` causing test failures on that architecture * revert any source changes to `ap.c` --- .disabled-travis.yml | 25 +++++++++++++++++++ package/setup.py | 11 ++++++-- .../MDAnalysisTests/formats/test_libdcd.py | 7 ++++-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.disabled-travis.yml b/.disabled-travis.yml index 8638059e0ab..1569758168d 100644 --- a/.disabled-travis.yml +++ b/.disabled-travis.yml @@ -111,6 +111,31 @@ jobs: INSTALL_HOLE="false" CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + - os: linux + language: python + arch: arm64-graviton2 + python: + - "3.7" + dist: focal + virt: vm + group: edge + before_install: + - python -m pip install cython numpy + # special test SciPy wheel for ARM64: + - python -m pip install https://anaconda.org/multibuild-wheels-staging/scipy/1.6.0.dev0+a240c17/download/scipy-1.6.0.dev0+a240c17-cp37-cp37m-manylinux2014_aarch64.whl + - python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm + install: + - cd package + - python setup.py install + - cd ../testsuite + - python setup.py install + - cd .. + script: + - cd testsuite + - python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis + after_success: + - echo "Override this stage for ARM64" + allow_failures: - env: NUMPY_VERSION=dev EVENT_TYPE="cron" diff --git a/package/setup.py b/package/setup.py index e48e12c52e2..c5fc43675d9 100755 --- a/package/setup.py +++ b/package/setup.py @@ -268,8 +268,15 @@ def extensions(config): use_cython = config.get('use_cython', default=not is_release) use_openmp = config.get('use_openmp', default=True) - extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops', - '-fsigned-zeros'] # see #2722 + if platform.machine() == 'aarch64': + # reduce optimization level for ARM64 machines + # because of issues with test failures sourcing to: + # MDAnalysis/analysis/encore/clustering/src/ap.c + extra_compile_args = ['-std=c99', '-ffast-math', '-O1', '-funroll-loops', + '-fsigned-zeros'] + else: + extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops', + '-fsigned-zeros'] # see #2722 define_macros = [] if config.get('debug_cflags', default=False): extra_compile_args.extend(['-Wall', '-pedantic']) diff --git a/testsuite/MDAnalysisTests/formats/test_libdcd.py b/testsuite/MDAnalysisTests/formats/test_libdcd.py index 0028a80bd3b..240aee1a74e 100644 --- a/testsuite/MDAnalysisTests/formats/test_libdcd.py +++ b/testsuite/MDAnalysisTests/formats/test_libdcd.py @@ -22,6 +22,7 @@ import sys import string import struct +import platform import hypothesis.strategies as strategies from hypothesis import example, given @@ -317,8 +318,10 @@ def write_dcd(in_name, out_name, remarks='testing', header=None): f_out.write(xyz=frame.xyz, box=frame.unitcell) -@pytest.mark.xfail(os.name == 'nt' and sys.maxsize <= 2**32, - reason="occasional fail on 32-bit windows") +@pytest.mark.xfail((os.name == 'nt' + and sys.maxsize <= 2**32) or + platform.machine() == 'aarch64', + reason="occasional fail on 32-bit windows and ARM") @given(remarks=strategies.text( alphabet=string.printable, min_size=0, max_size=239)) # handle the printable ASCII strings From 7f83f4a7c9c8abbc2df411a60ffe80dbcfe3fd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bouysset?= Date: Fri, 30 Oct 2020 20:50:21 +0100 Subject: [PATCH 15/20] ParmEdConverter: fix NameError when catching NoDataError (#2953) * fix NameError when catching NoDataError * add test + missing imports --- package/MDAnalysis/coordinates/ParmEd.py | 3 +++ testsuite/MDAnalysisTests/coordinates/test_parmed.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/package/MDAnalysis/coordinates/ParmEd.py b/package/MDAnalysis/coordinates/ParmEd.py index c35b16103f0..dfb996903bd 100644 --- a/package/MDAnalysis/coordinates/ParmEd.py +++ b/package/MDAnalysis/coordinates/ParmEd.py @@ -74,10 +74,13 @@ """ from __future__ import absolute_import import functools +import itertools +import warnings from . import base from ..topology.tables import SYMB2Z from ..core.universe import Universe +from ..exceptions import NoDataError class ParmEdReader(base.SingleFrameReaderBase): diff --git a/testsuite/MDAnalysisTests/coordinates/test_parmed.py b/testsuite/MDAnalysisTests/coordinates/test_parmed.py index a1fe4e44326..5dd350e86fd 100644 --- a/testsuite/MDAnalysisTests/coordinates/test_parmed.py +++ b/testsuite/MDAnalysisTests/coordinates/test_parmed.py @@ -206,6 +206,17 @@ def test_equivalent_dihedrals(self, ref, roundtrip): p.improper == q.improper and p.ignore_end == q.ignore_end) for q in original) + def test_missing_attr(self): + n_atoms = 10 + u = mda.Universe.empty(n_atoms) + u.add_TopologyAttr("resid", [1]) + u.add_TopologyAttr("segid", ["DUM"]) + u.add_TopologyAttr("mass", [1] * n_atoms) + with pytest.warns(UserWarning, + match="Supplied AtomGroup was missing the following " + "attributes"): + # should miss names and resnames + u.atoms.convert_to("PARMED") class BaseTestParmEdConverterSubset(BaseTestParmEdConverter): From a64eed98b38307e4699b59eef9f265cbead37ad6 Mon Sep 17 00:00:00 2001 From: Summersnow Date: Thu, 19 Nov 2020 10:57:47 +0800 Subject: [PATCH 16/20] Improve the performance of ParmEd converter. (Fix #3028) (#3029) Fixes #3028 * Improves the performance of the ParmEd converter by using a dictionary lookup for the atomgroup to universe index mapping. --- package/AUTHORS | 1 + package/CHANGELOG | 3 ++- package/MDAnalysis/coordinates/ParmEd.py | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/AUTHORS b/package/AUTHORS index 401bd935fca..7ebc3b8a96c 100644 --- a/package/AUTHORS +++ b/package/AUTHORS @@ -149,6 +149,7 @@ Chronological list of authors - Marcello Sega - Nicholas Craven - Ramon Crehuet + - Haochuan Chen External code ------------- diff --git a/package/CHANGELOG b/package/CHANGELOG index 3dfb362bacb..5e252f2b1af 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -15,7 +15,7 @@ The rules for this file: ------------------------------------------------------------------------------ ??/??/20 richardjgowers, IAlibay, orbeckst, tylerjereddy, jbarnoud, yuxuanzhuang, lilyminium, VOD555, p-j-smith, bieniekmateusz, - calcraven, ianmkenney, rcrehuet, manuel.nuno.melo + calcraven, ianmkenney, rcrehuet, manuel.nuno.melo, hanatok * 1.0.1 @@ -50,6 +50,7 @@ Fixes (Issue #2934) Enhancements + * Improved performance of the ParmEd converter (Issue #3028, PR #3029) * Improved performances when parsing TPR files (PR #2804) Changes (not affecting users) diff --git a/package/MDAnalysis/coordinates/ParmEd.py b/package/MDAnalysis/coordinates/ParmEd.py index dfb996903bd..b2eb92d9c3f 100644 --- a/package/MDAnalysis/coordinates/ParmEd.py +++ b/package/MDAnalysis/coordinates/ParmEd.py @@ -133,7 +133,7 @@ def _read_first_frame(self): } def get_indices_from_subset(i, atomgroup=None, universe=None): - return atomgroup.index(universe.atoms[i]) + return atomgroup[universe.atoms[i]] class ParmEdConverter(base.ConverterBase): """Convert MDAnalysis AtomGroup or Universe to ParmEd :class:`~parmed.structure.Structure`. @@ -263,8 +263,10 @@ def convert(self, obj): struct.box = None if hasattr(ag_or_ts, 'universe'): + atomgroup = {atom: index for index, + atom in enumerate(list(ag_or_ts))} get_atom_indices = functools.partial(get_indices_from_subset, - atomgroup=list(ag_or_ts), + atomgroup=atomgroup, universe=ag_or_ts.universe) else: get_atom_indices = lambda x: x From 454bd4d85217e7accd5d103debf2f17161cc6e1c Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Wed, 9 Dec 2020 12:56:46 +1100 Subject: [PATCH 17/20] mv travis back and only keep 3.5 and 2.7 --- .disabled-travis.yml | 205 ------------------------------------------- .travis.yml | 81 +++++++++++++++++ 2 files changed, 81 insertions(+), 205 deletions(-) delete mode 100644 .disabled-travis.yml create mode 100644 .travis.yml diff --git a/.disabled-travis.yml b/.disabled-travis.yml deleted file mode 100644 index 1569758168d..00000000000 --- a/.disabled-travis.yml +++ /dev/null @@ -1,205 +0,0 @@ -version: ~> 1.0 -language: generic -group: travis_latest - -# Only build for develop and master (and PRs) -branches: - only: - - master - - develop - -os: - linux - -env: - global: - - secure: "VJ8cMKXuVe7e6vlBeUkd8j6wUbxYF0Yja6CHn0tmpzVGm3CCBXxoZcgvgtfyJTjf+2nqKIjsIy4FdYIkotXYaDwAX5XHHHWS/++7917pddJ2nZkBnBI069c2gLL6vU7E7jbGUzmKywsA73Of44pVsYgtGneK0F7/guLawpWBOOpLsui+pL2X4jYXZL4WHjTPGTphUN4uhQIkqKkuu9ZSR6uodzZDjzkH+q0FT5RLqmgVttnCD9ZmS2ppQsI9f0jZUd8V0M4NGaTHd439uj1UpMMriSJEzcq9DsKZEncjoJZGqfnXPUG9j5Z+jZ8TyxClma93HxeXbXa8A4B6V0wwNA2VG3ZCCeSQon2iNVl8YNZLPaMQleeoQ+uT6D4z26fHVGzk4knMeTROCfHoZo2T8as5EeFDvcbXGva82BnF+aCFxj/d9f1VC3too7bsY+gBBUu/oxVizDWDEby+2Iz2EzUGG3YltF0MjaLrFQ5ggox4vZVVgmlJo8KT6zonTNl8EdKwIzUDh1ZrpiNv3yMgt030heTFL6EJ30xRQJZkwwklJBPgDuARz2FxyKk+hO8IR7AuGLICwP1IpUASXaKeSD1K09qUnmB8W8RO5YhnLu7ABr6oghU9t63r1V0jLTCvYbO4SQIJ2muNsTay/rKo5QtzklPka/5Kud6KyIrsKb4=" - - GH_DOC_BRANCH=develop - - GH_REPOSITORY=github.com/MDAnalysis/mdanalysis.git - - GIT_CI_USER=TravisCI - - GIT_CI_EMAIL=TravisCI@mdanalysis.org - - MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html - - MAINTAIN_DIR=${TRAVIS_BUILD_DIR}/maintainer - # Set default python version to avoid repetition later - - PYTHON_VERSION=3.7 - - BUILD_DOCS=false - - CODECOV=false - - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" - - PYTEST_LIST="testsuite/MDAnalysisTests" - - MAIN_CMD="pytest ${PYTEST_LIST}" - - SETUP_CMD="${PYTEST_FLAGS}" - - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" - - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" - - CONDA_PY2_DEPENDENCIES="six funcsigs" - - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 tqdm>=4.43.0" - - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} chemfiles" - - CONDA_CHANNELS='biobuilds conda-forge' - - CONDA_CHANNEL_PRIORITY=True - - PIP_DEPENDENCIES="duecredit parmed" - - NUMPY_VERSION=stable - - INSTALL_HOLE="true" - - CYTHON_TRACE_NOGIL=1 - - MPLBACKEND=agg - - MAMBA=true - - jobs: - # Run a coverage test for most versions - - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.8 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.7 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - PYTHON_VERSION=3.6 CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - NUMPY_VERSION=1.13.3 PYTHON_VERSION=3.6 - - NUMPY_VERSION=dev EVENT_TYPE="cron" - -jobs: - fast_finish: true - include: - - env: NAME="Doc" - MAIN_CMD="cd package && python setup.py" - SETUP_CMD="build_sphinx" - BUILD_DOCS=true - BUILD_CMD="cd ${TRAVIS_BUILD_DIR}/package && python setup.py build_ext --inplace" - INSTALL_HOLE="false" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} sphinx==1.8.5 sphinx-sitemap sphinx_rtd_theme msmb_theme==1.2.0" - - - env: NAME="Lint" - PYLINTRC="${TRAVIS_BUILD_DIR}/package/.pylintrc" - MAIN_CMD="pylint package/MDAnalysis && pylint testsuite/MDAnalysisTests" - SETUP_CMD="" - BUILD_CMD="" - CONDA_DEPENDENCIES="" - INSTALL_HOLE="false" - - # pin dependencies for legacy: - # - ensure that chemfiles can get the last netcdf4 that is still supported - # see https://github.com/MDAnalysis/mdanalysis/pull/2798#issuecomment-679991785 - # - install chemfiles and chemfiles-lib via pip (conda times out) - - env: NAME="python 2.7" - PYTHON_VERSION=2.7 - CODECOV="true" - NUMPY_VERSION=1.16 - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" - - - env: NAME="asv check" - PYTHON_VERSION=2.7 - CODECOV="false" - MAIN_CMD="" - SETUP_CMD="" - NUMPY_VERSION=1.16 - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0" - ASV_CHECK="true" - - - env: NAME="pypi check" - CODECOV="false" - MAIN_CMD="cd package && python setup.py" - SETUP_CMD="sdist" - BUILD_CMD="" - INSTALL_HOLE="false" - CONDA_DEPENDENCIES="setuptools cython twine" - PYPI_CHECK="true" - - - os: osx - env: PYTHON_VERSION=3.6 - NUMPY_VERSION=1.17.3 - - - env: NAME='minimal' - PIP_DEPENDENCIES="" - CONDA_DEPENDENCIES=${CONDA_MIN_DEPENDENCIES} - INSTALL_HOLE="false" - CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - - - os: linux - language: python - arch: arm64-graviton2 - python: - - "3.7" - dist: focal - virt: vm - group: edge - before_install: - - python -m pip install cython numpy - # special test SciPy wheel for ARM64: - - python -m pip install https://anaconda.org/multibuild-wheels-staging/scipy/1.6.0.dev0+a240c17/download/scipy-1.6.0.dev0+a240c17-cp37-cp37m-manylinux2014_aarch64.whl - - python -m pip install --no-build-isolation hypothesis matplotlib pytest pytest-cov pytest-xdist tqdm - install: - - cd package - - python setup.py install - - cd ../testsuite - - python setup.py install - - cd .. - script: - - cd testsuite - - python -m pytest ./MDAnalysisTests --disable-pytest-warnings -n 8 -rsx --cov=MDAnalysis - after_success: - - echo "Override this stage for ARM64" - - allow_failures: - - env: NUMPY_VERSION=dev EVENT_TYPE="cron" - -before_install: - # Workaround for Travis CI macOS bug (https://github.com/travis-ci/travis-ci/issues/6307) - # See https://github.com/searchivarius/nmslib/pull/259 - - | - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - command curl -sSL https://rvm.io/mpapis.asc | gpg --import -; - rvm get head || true - fi - -install: - # download hole first to use system curl - # additional external tools (Issue #898) -- HOLE - - | - if [[ $INSTALL_HOLE == 'true' ]]; then \ - bash ./maintainer/install_hole.sh $TRAVIS_OS_NAME "${HOME}"; \ - HOLE_BINDIR="${HOME}/hole2/exe"; \ - export PATH=${PATH}:${HOLE_BINDIR}; \ - fi - - git clone git://github.com/astropy/ci-helpers.git - - source ci-helpers/travis/setup_conda.sh - - eval $BUILD_CMD - -script: - - cd ${TRAVIS_BUILD_DIR} - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then ulimit -S -n 2048; fi - - echo $MAIN_CMD $SETUP_CMD - - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then pip install pytest; fi - - eval $MAIN_CMD $SETUP_CMD - # check benchmark suite for basic issues - - | - if [ "${ASV_CHECK}" == "true" ]; then - python -m pip install asv - cd testsuite - python setup.py install - cd ../benchmarks - time python -m asv check -E existing - fi - # check pypi package build - - | - if [[ "${PYPI_CHECK}" == "true" ]]; then - DISTRIBUTION=$(ls -t1 ${TRAVIS_BUILD_DIR}/package/dist/MDAnalysis-*.tar.gz | head -n 1) - test -n "${DISTRIBUTION}" || { echo "no distribution package/dist/MDAnalysis-*.tar.gz found"; exit 1; } - echo "twine check $DISTRIBUTION" - twine check $DISTRIBUTION - fi - -after_success: - - | - if [[ $CODECOV == 'true' ]]; then \ - codecov; \ - fi - # can't use test here since this leads to travis fails even though the build passes - # turn off blocking as it causes large writes to stdout to fail - # (see https://github.com/travis-ci/travis-ci/issues/4704) - - | - if [[ ${TRAVIS_PULL_REQUEST} == "false" ]] && [[ ${BUILD_DOCS} == "true" ]] ; then - python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' - cd ${TRAVIS_BUILD_DIR}/package/MDAnalysis - export GH_DOC_BRANCH=${TRAVIS_BRANCH} - export VERSION=$(python -c "import version; print(version.__version__)") - cd - - bash ${TRAVIS_BUILD_DIR}/maintainer/deploy_docs_via_travis.sh; - fi - diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..d2106c68684 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,81 @@ +version: ~> 1.0 +language: generic +group: travis_latest + +# Only build for develop and master (and PRs) +branches: + only: + - master + - develop + +os: + linux + +env: + global: + - secure: "VJ8cMKXuVe7e6vlBeUkd8j6wUbxYF0Yja6CHn0tmpzVGm3CCBXxoZcgvgtfyJTjf+2nqKIjsIy4FdYIkotXYaDwAX5XHHHWS/++7917pddJ2nZkBnBI069c2gLL6vU7E7jbGUzmKywsA73Of44pVsYgtGneK0F7/guLawpWBOOpLsui+pL2X4jYXZL4WHjTPGTphUN4uhQIkqKkuu9ZSR6uodzZDjzkH+q0FT5RLqmgVttnCD9ZmS2ppQsI9f0jZUd8V0M4NGaTHd439uj1UpMMriSJEzcq9DsKZEncjoJZGqfnXPUG9j5Z+jZ8TyxClma93HxeXbXa8A4B6V0wwNA2VG3ZCCeSQon2iNVl8YNZLPaMQleeoQ+uT6D4z26fHVGzk4knMeTROCfHoZo2T8as5EeFDvcbXGva82BnF+aCFxj/d9f1VC3too7bsY+gBBUu/oxVizDWDEby+2Iz2EzUGG3YltF0MjaLrFQ5ggox4vZVVgmlJo8KT6zonTNl8EdKwIzUDh1ZrpiNv3yMgt030heTFL6EJ30xRQJZkwwklJBPgDuARz2FxyKk+hO8IR7AuGLICwP1IpUASXaKeSD1K09qUnmB8W8RO5YhnLu7ABr6oghU9t63r1V0jLTCvYbO4SQIJ2muNsTay/rKo5QtzklPka/5Kud6KyIrsKb4=" + - GH_DOC_BRANCH=develop + - GH_REPOSITORY=github.com/MDAnalysis/mdanalysis.git + - GIT_CI_USER=TravisCI + - GIT_CI_EMAIL=TravisCI@mdanalysis.org + - MDA_DOCDIR=${TRAVIS_BUILD_DIR}/package/doc/html/html + - MAINTAIN_DIR=${TRAVIS_BUILD_DIR}/maintainer + # Set default python version to avoid repetition later + - PYTHON_VERSION=3.7 + - BUILD_DOCS=false + - CODECOV=false + - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" + - PYTEST_LIST="testsuite/MDAnalysisTests" + - MAIN_CMD="pytest ${PYTEST_LIST}" + - SETUP_CMD="${PYTEST_FLAGS}" + - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" + - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" + - CONDA_PY2_DEPENDENCIES="six funcsigs" + - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 tqdm>=4.43.0" + - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} chemfiles" + - CONDA_CHANNELS='biobuilds conda-forge' + - CONDA_CHANNEL_PRIORITY=True + - PIP_DEPENDENCIES="duecredit parmed" + - NUMPY_VERSION=stable + - INSTALL_HOLE="true" + - CYTHON_TRACE_NOGIL=1 + - MPLBACKEND=agg + - MAMBA=true + + jobs: + # Run a coverage test for most versions + - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + +jobs: + fast_finish: true + include: + + # pin dependencies for legacy: + # - ensure that chemfiles can get the last netcdf4 that is still supported + # see https://github.com/MDAnalysis/mdanalysis/pull/2798#issuecomment-679991785 + # - install chemfiles and chemfiles-lib via pip (conda times out) + - env: NAME="python 2.7" + PYTHON_VERSION=2.7 + CODECOV="true" + NUMPY_VERSION=1.16 + CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" + SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" + PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" + +install: + # download hole first to use system curl + # additional external tools (Issue #898) -- HOLE + - | + if [[ $INSTALL_HOLE == 'true' ]]; then \ + bash ./maintainer/install_hole.sh $TRAVIS_OS_NAME "${HOME}"; \ + HOLE_BINDIR="${HOME}/hole2/exe"; \ + export PATH=${PATH}:${HOLE_BINDIR}; \ + fi + - git clone git://github.com/astropy/ci-helpers.git + - source ci-helpers/travis/setup_conda.sh + - eval $BUILD_CMD + +script: + - cd ${TRAVIS_BUILD_DIR} + - echo $MAIN_CMD $SETUP_CMD + - eval $MAIN_CMD $SETUP_CMD \ No newline at end of file From 60ea0bbfe1ccd01845378e11ba827bb32a3de414 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Wed, 9 Dec 2020 14:43:17 +1100 Subject: [PATCH 18/20] move py3.5 job --- .travis.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2106c68684..157868457da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,11 @@ env: # Set default python version to avoid repetition later - PYTHON_VERSION=3.7 - BUILD_DOCS=false - - CODECOV=false + - CODECOV=true - PYTEST_FLAGS="--disable-pytest-warnings --durations=50" - PYTEST_LIST="testsuite/MDAnalysisTests" - MAIN_CMD="pytest ${PYTEST_LIST}" - - SETUP_CMD="${PYTEST_FLAGS}" + - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" - CONDA_PY2_DEPENDENCIES="six funcsigs" @@ -42,10 +42,6 @@ env: - MPLBACKEND=agg - MAMBA=true - jobs: - # Run a coverage test for most versions - - PYTHON_VERSION=3.5 MAMBA=false CODECOV="true" SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - jobs: fast_finish: true include: @@ -56,12 +52,15 @@ jobs: # - install chemfiles and chemfiles-lib via pip (conda times out) - env: NAME="python 2.7" PYTHON_VERSION=2.7 - CODECOV="true" NUMPY_VERSION=1.16 CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" + - env: NAME="python 3.5" + PYTHON_VERSION=3.5 + MAMBA=false + + install: # download hole first to use system curl # additional external tools (Issue #898) -- HOLE From 6a99f57bab43897370cd2e755f6dd3676596c77c Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Tue, 15 Dec 2020 09:22:31 +1100 Subject: [PATCH 19/20] rm appveyor --- .appveyor.yml | 73 --------------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index c3b2171bb0d..00000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,73 +0,0 @@ -# config based on examples from SciPy & NumPy repositories, which -# themselves credit an original example by Olivier Grisel at -# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml -clone_depth: 50 -max_jobs: 100 - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -environment: - global: - CONDA_CHANNELS: conda-forge - CONDA_DEPENDENCIES: pip setuptools wheel cython mock six biopython networkx joblib matplotlib scipy vs2015_runtime pytest mmtf-python GridDataFormats hypothesis pytest-cov codecov chemfiles tqdm - PIP_DEPENDENCIES: gsd==1.9.3 duecredit parmed - DEBUG: "False" - MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin - APPVEYOR_SAVE_CACHE_ON_ERROR: true - APPVEYOR_SKIP_FINALIZE_ON_EXIT: true - TEST_TIMEOUT: 1000 - PYTHON: "C:\\conda" - # Temporarily fall back to default MINICONDA_VERSION in ci-helpers until https://github.com/MDAnalysis/mdanalysis/issues/2311 - # is fixed in ci-helpers https://github.com/astropy/ci-helpers/issues/406 - # MINICONDA_VERSION: "latest" - MPLBACKEND: "agg" - - matrix: - - PYTHON_VERSION: 3.6 - PYTHON_ARCH: 64 - MSVC_VERSION: "Visual Studio 10 Win64" - - - PYTHON_VERSION: 3.8 - PYTHON_ARCH: 64 - MSVC_VERSION: "Visual Studio 10 Win64" - -init: - - ps: Write-Host ${env:PYTHON} ${env:PYTHON_VERSION} ${env:PYTHON_ARCH} - - ps: Write-Host ${env:APPVEYOR_SCHEDULED_BUILD} - # cancel build if newer one is submitted; complicated - # details for getting this to work are credited to JuliaLang - # developers - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` - https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` - Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` - raise "There are newer queued builds for this pull request, skipping build." - } - -install: - # set up a conda env - - ps: git clone -q --depth 1 git://github.com/astropy/ci-helpers.git - - ps: ci-helpers/appveyor/install-miniconda.ps1 - - ps: $env:PATH = "${env:PYTHON};${env:PYTHON}\Scripts;" + $env:PATH - # deal with missing stdint.h as previously described - # see https://github.com/swistakm/pyimgui/blob/master/.appveyor.yml - - ps: activate test - -build_script: - - cmd: cd package - - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 - -test_script: - - cmd: cd ..\testsuite - - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 - - cmd: cd MDAnalysisTests - - cmd: C:\conda\envs\test\Scripts\pytest.exe --cov=MDAnalysis --disable-pytest-warnings 3>&1 - - cmd: codecov - -after_build: - # cache cleanup - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete - # Show size of cache - - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache" From 09bdc9ac5e2728a525eb1680f607b9254025cd59 Mon Sep 17 00:00:00 2001 From: Lily Wang Date: Wed, 16 Dec 2020 11:23:27 +1100 Subject: [PATCH 20/20] try pinning --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 157868457da..44b6346c36d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,10 +29,10 @@ env: - MAIN_CMD="pytest ${PYTEST_LIST}" - SETUP_CMD="${PYTEST_FLAGS} --cov=MDAnalysis" - BUILD_CMD="pip install -e package/ && (cd testsuite/ && python setup.py build)" - - CONDA_MIN_DEPENDENCIES="mmtf-python mock biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" + - CONDA_MIN_DEPENDENCIES="mmtf-python biopython networkx cython matplotlib scipy griddataformats hypothesis gsd codecov" - CONDA_PY2_DEPENDENCIES="six funcsigs" - - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4 scikit-learn joblib>=0.12 tqdm>=4.43.0" - - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} chemfiles" + - CONDA_STANDARD_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} seaborn>=0.7.0 clustalw=2.1 netcdf4==1.3.1 scikit-learn joblib>=0.12 tqdm>=4.43.0" + - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} mock chemfiles" - CONDA_CHANNELS='biobuilds conda-forge' - CONDA_CHANNEL_PRIORITY=True - PIP_DEPENDENCIES="duecredit parmed" @@ -53,8 +53,8 @@ jobs: - env: NAME="python 2.7" PYTHON_VERSION=2.7 NUMPY_VERSION=1.16 - CONDA_DEPENDENCIES="${CONDA_STANDARD_DEPENDENCIES} ${CONDA_PY2_DEPENDENCIES}" - PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles" + CONDA_DEPENDENCIES="${CONDA_MIN_DEPENDENCIES} clustalw=2.1 netcdf4=1.3.1 six=1.15.0 funcsigs<=1.0.2 mock<=3.0.5 seaborn" + PIP_DEPENDENCIES="${PIP_DEPENDENCIES} setuptools<45.0.0 chemfiles scikit-learn joblib>=0.12" - env: NAME="python 3.5" PYTHON_VERSION=3.5