dimchris / mdanalysis

Automatically exported from code.google.com/p/mdanalysis
0 stars 0 forks source link

from MDAnalysis.tests.datafiles import * fails in 0.7.5 #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. from MDAnalysis.tests.datafiles import *

What is the expected output? What do you see instead?

Should import the test data (via MDAnalysisTests). Instead it fails with

In [2]: from MDAnalysis.tests.datafiles import *
Install MDAnalysisTests first. The source package is available from
http://code.google.com/p/mdanalysis/downloads/list
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
..../<ipython-input-2-1395ed393560> in <module>()
----> 1 from MDAnalysis.tests.datafiles import *
..../mdanalysis/package/MDAnalysis/tests/__init__.py in <module>()
    105     print("Install MDAnalysisTests first. The source package is available from")
    106     print("http://code.google.com/p/mdanalysis/downloads/list")
--> 107     raise ImportError("Package MDAnalysisTests required!")
    108 

ImportError: Package MDAnalysisTests required!

Mea culpa --- I forgot to fix the import statement when switching over from 
MDAnalysisTestData to MDAnalysisTests (Issue 87). The effect is that many of 
the examples will not work with the released 0.7.5.

Workaround: 

  from MDAnalysisTests.datafiles import *

Original issue reported on code.google.com by orbeckst on 13 Feb 2012 at 5:27

GoogleCodeExporter commented 9 years ago
Er, that was not the problem. Rather I had a mismatch between the version of 
MDAnalysis (0.7.6-devel) and MDAnalysisTests (0.7.5). This fails with an 
ImportError but the error message relating to the version mismatch is 
swallowed. Arguably, that should be changed.

To check that things work as expected, do a 

  import MDAnalysisTests

to check that the versions match. It will raise an ImportError if they don't.

Original comment by orbeckst on 13 Feb 2012 at 5:33