Skip to content

Commit 2d7ba64

Browse files
authored
Refresh tests (mdtraj#1266)
* Re-work tests * Remove get_fn * Modify examples to not use get_fn * Switch to relative imports * Remove redundant DelayImportError * Use `is` to compare to None * Relative imports * Relative imports * Use `is` to compare to None * Error checking * Relative imports * Topology hash * Trajectory updates - initialize traces - add .dtr file format * Remove package data * fix test_xtc * Spruce up shiftx2 wrapper * Whoops ... revert skip logic for shiftx2 * No crazy recipe * Latest numpy * update doc building requirements * Bump appveyor matrix * Logic to skip openmm notebook where applicable * py2 special logic for comparing longs * skip shiftx2 test on travis
1 parent a579286 commit 2d7ba64

File tree

214 files changed

+3044
-3433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+3044
-3433
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ os:
2424

2525
env:
2626
- CONDA_PY=2.7 CONDA_NPY=1.7
27-
- CONDA_PY=2.7 CONDA_NPY=1.11
28-
- CONDA_PY=3.4 CONDA_NPY=1.10
27+
- CONDA_PY=2.7
2928
- CONDA_PY=3.5 CONDA_NPY=1.11
29+
- CONDA_PY=3.6
3030

3131
# Do include/exclude to add "DOCDEPLOY" to one matrix entry.
3232
matrix:
3333
exclude:
3434
- os: linux
35-
env: CONDA_PY=3.5 CONDA_NPY=1.11
35+
env: CONDA_PY=3.6
3636
include:
3737
- os: linux
38-
env: CONDA_PY=3.5 CONDA_NPY=1.11 DOCDEPLOY=YES
38+
env: CONDA_PY=3.6 DOCDEPLOY=YES
3939

4040
deploy:
4141
- provider: s3

appveyor.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ environment:
88

99
matrix:
1010
- PYTHON: "C:\\Miniconda3"
11-
CONDA_PY: "35"
12-
CONDA_NPY: "1.10"
11+
CONDA_PY: "36"
1312
- PYTHON: "C:\\Miniconda3"
1413
CONDA_PY: "27"
15-
CONDA_NPY: "1.10"
1614
- PYTHON: "C:\\Miniconda3-x64"
1715
CONDA_PY: "27"
18-
CONDA_NPY: "1.10"
1916
ARCH: "64"
2017
- PYTHON: "C:\\Miniconda3-x64"
21-
CONDA_PY: "35"
22-
CONDA_NPY: "1.10"
18+
CONDA_PY: "36"
2319
ARCH: "64"
2420

2521
install:

devtools/conda-recipe/meta.yaml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,52 @@ build:
1515
requirements:
1616
build:
1717
- python
18-
- cython
19-
- numpy x.x
20-
- msinttypes # [win and py2k]
2118
- setuptools
22-
- zlib
19+
- cython
20+
- numpy
21+
- zlib 1.2.8
22+
- msinttypes # [win and py27]
2323

2424
run:
2525
- python
2626
- setuptools
27-
- numpy x.x
28-
- pandas
27+
- numpy
2928
- scipy
29+
- pandas
3030
- pytables
3131

3232
test:
3333
requires:
34-
- nose
35-
- scripttest
34+
- pytest
3635
- networkx
3736
- matplotlib
38-
- pandas
3937
- openmm # [not (win32 or (win and py2k))]
40-
- shiftx2 # [linux]
38+
- shiftx2 # [linux and py2k]
4139
- nbformat
4240
- ipykernel
4341
- scikit-learn
4442

4543
source_files:
4644
- examples/*
45+
- pytest.ini
46+
- tests/*
47+
48+
imports:
49+
- mdtraj
4750

4851
commands:
49-
- nosetests mdtraj -v -s
50-
- cd examples && nosetests test_examples.py -v -s # [not (win32 or (win and py2k))]
52+
- pytest
5153

5254
about:
53-
home: http://mdtraj.org
54-
license: GNU Lesser General Public License v2 or later (LGPLv2+)
55-
summary: A modern, open library for the analysis of molecular dynamics trajectories (development snapshot)
55+
home: https://github.com/mdtraj/mdtraj
56+
license: LGPL-2.1
57+
summary: "A modern, open library for the analysis of molecular dynamics trajectories"
58+
description: |
59+
MDTraj is a python library that allows users to manipulate molecular dynamics
60+
(MD) trajectories and perform a variety of analyses, including fast RMSD,
61+
solvent accessible surface area, hydrogen bonding, etc. A highlight of MDTraj
62+
is the wide variety of molecular dynamics trajectory file formats which are
63+
supported, including RCSB pdb, GROMACS xtc, tng, and trr, CHARMM / NAMD dcd, AMBER
64+
binpos, AMBER NetCDF, AMBER mdcrd, TINKER arc and MDTraj HDF5.
65+
doc_url: http://mdtraj.org/
66+
dev_url: https://github.com/mdtraj/mdtraj

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sphinx
22
matplotlib
3-
ipython-notebook
3+
jupyter
44
jinja2
55
runipy
66
openmm
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/iterload.ipynb

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": null,
6-
"metadata": {
7-
"collapsed": false
8-
},
6+
"metadata": {},
97
"outputs": [],
108
"source": [
119
"from __future__ import print_function\n",
@@ -37,13 +35,10 @@
3735
{
3836
"cell_type": "code",
3937
"execution_count": null,
40-
"metadata": {
41-
"collapsed": false
42-
},
38+
"metadata": {},
4339
"outputs": [],
4440
"source": [
45-
"import mdtraj.testing\n",
46-
"traj_filename = mdtraj.testing.get_fn('frame0.h5')"
41+
"traj_filename = 'data/frame0.h5'"
4742
]
4843
},
4944
{
@@ -58,9 +53,7 @@
5853
{
5954
"cell_type": "code",
6055
"execution_count": null,
61-
"metadata": {
62-
"collapsed": false
63-
},
56+
"metadata": {},
6457
"outputs": [],
6558
"source": [
6659
"first_frame = md.load_frame(traj_filename, 0)\n",
@@ -69,9 +62,7 @@
6962
},
7063
{
7164
"cell_type": "markdown",
72-
"metadata": {
73-
"collapsed": false
74-
},
65+
"metadata": {},
7566
"source": [
7667
"Using `md.iterload`, you can iterate through chunks\n",
7768
"of the trajectory. If you don't retain a reference to the chunk\n",
@@ -82,9 +73,7 @@
8273
{
8374
"cell_type": "code",
8475
"execution_count": null,
85-
"metadata": {
86-
"collapsed": false
87-
},
76+
"metadata": {},
8877
"outputs": [],
8978
"source": [
9079
"rmsds = []\n",
@@ -104,9 +93,7 @@
10493
{
10594
"cell_type": "code",
10695
"execution_count": null,
107-
"metadata": {
108-
"collapsed": false
109-
},
96+
"metadata": {},
11097
"outputs": [],
11198
"source": [
11299
"rmsds = np.concatenate(rmsds)\n",
@@ -118,7 +105,7 @@
118105
],
119106
"metadata": {
120107
"kernelspec": {
121-
"display_name": "Python 3",
108+
"display_name": "Python",
122109
"language": "python",
123110
"name": "python3"
124111
},
@@ -132,9 +119,9 @@
132119
"name": "python",
133120
"nbconvert_exporter": "python",
134121
"pygments_lexer": "ipython3",
135-
"version": "3.5.1"
122+
"version": "3.5.2"
136123
}
137124
},
138125
"nbformat": 4,
139-
"nbformat_minor": 0
126+
"nbformat_minor": 1
140127
}

examples/rmsd-drift.ipynb

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": null,
6-
"metadata": {
7-
"collapsed": false
8-
},
6+
"metadata": {},
97
"outputs": [],
108
"source": [
119
"%matplotlib inline\n",
@@ -17,29 +15,23 @@
1715
"cell_type": "markdown",
1816
"metadata": {},
1917
"source": [
20-
"Find two files that are distributed with MDTraj for testing purposes -- \n",
21-
"we can us them to make our plot"
18+
"Use two files that are distributed with MDTraj examples"
2219
]
2320
},
2421
{
2522
"cell_type": "code",
2623
"execution_count": null,
27-
"metadata": {
28-
"collapsed": false
29-
},
24+
"metadata": {},
3025
"outputs": [],
3126
"source": [
32-
"import mdtraj.testing\n",
33-
"crystal_fn = mdtraj.testing.get_fn('native.pdb')\n",
34-
"trajectory_fn = mdtraj.testing.get_fn('frame0.xtc')"
27+
"crystal_fn = 'data/native.pdb'\n",
28+
"trajectory_fn = 'data/frame0.xtc'"
3529
]
3630
},
3731
{
3832
"cell_type": "code",
3933
"execution_count": null,
40-
"metadata": {
41-
"collapsed": false
42-
},
34+
"metadata": {},
4335
"outputs": [],
4436
"source": [
4537
"crystal = md.load(crystal_fn)\n",
@@ -58,9 +50,7 @@
5850
{
5951
"cell_type": "code",
6052
"execution_count": null,
61-
"metadata": {
62-
"collapsed": false
63-
},
53+
"metadata": {},
6454
"outputs": [],
6555
"source": [
6656
"rmsds_to_crystal = md.rmsd(trajectory, crystal, 0)\n",
@@ -71,20 +61,16 @@
7161
{
7262
"cell_type": "code",
7363
"execution_count": null,
74-
"metadata": {
75-
"collapsed": false
76-
},
64+
"metadata": {},
7765
"outputs": [],
7866
"source": [
79-
"from matplotlib.pylab import *\n",
80-
"\n",
81-
"figure()\n",
82-
"plot(trajectory.time, rmsds_to_crystal, 'r', label='all atom')\n",
83-
"plot(trajectory.time, heavy_rmds_to_crystal, 'b', label='heavy atom')\n",
84-
"legend()\n",
85-
"title('RMSDs to crystal')\n",
86-
"xlabel('simulation time (ps)')\n",
87-
"ylabel('RMSD (nm)')"
67+
"from matplotlib import pyplot as plt\n",
68+
"plt.plot(trajectory.time, rmsds_to_crystal, 'r', label='all atom')\n",
69+
"plt.plot(trajectory.time, heavy_rmds_to_crystal, 'b', label='heavy atom')\n",
70+
"plt.legend()\n",
71+
"plt.title('RMSDs to crystal')\n",
72+
"plt.xlabel('simulation time (ps)')\n",
73+
"plt.ylabel('RMSD (nm)')"
8874
]
8975
}
9076
],
@@ -104,9 +90,9 @@
10490
"name": "python",
10591
"nbconvert_exporter": "python",
10692
"pygments_lexer": "ipython3",
107-
"version": "3.5.1"
93+
"version": "3.5.2"
10894
}
10995
},
11096
"nbformat": 4,
111-
"nbformat_minor": 0
97+
"nbformat_minor": 1
11298
}

0 commit comments

Comments
 (0)