Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on running tests after setting up development environment #1166

Closed
utkbansal opened this issue Jan 16, 2017 · 14 comments
Closed

Errors on running tests after setting up development environment #1166

utkbansal opened this issue Jan 16, 2017 · 14 comments

Comments

@utkbansal
Copy link
Member

Expected behaviour

I followed the setting up the development guide present at - https://github.com/MDAnalysis/mdanalysis/wiki/Setup-Development-Environment

After cloning the repo and installing the dependencies, I ran the tests which failed.

Actual behaviour

I tried the setup on macOS and Ubuntu and got errors (different) on both.

On Ubuntu (Python 2.7.12)
I got the same error multiple times -
KeyError: 'dtype' (Looks to me like something went wrong with numpy code)

This was the final output-
FAILED (KNOWNFAIL=3, SKIP=132, errors=26)

On macOS (Python 2.7.12)
Got a lot of errors-

Most of them were IOError where the file couldn't be read.
Error: [Errno 5] Cannot open file or stream in mode='rt'.: "'/Users/utkbansal/Code/mdanalysis/testsuite/MDAnalysisTests/data/adk_oplsaa.gro'"

FAILED (SKIP=101, errors=780, failures=4)

The stack trace was huge so I am not posting it, but if its needed I can share it.

Code to reproduce the behaviour

./mda_nosetests
@utkbansal
Copy link
Member Author

utkbansal commented Jan 16, 2017

Update (macOS)

I digged deeper on macOS and found that on macOS the number of files that a process can open simultaneously is quite low (256). So I increased the limit by running the following command -

ulimit -n 4096

So I ran the test suite again and this time I got only one error -

ERROR: test_rmsd_matrix_without_superimposition (MDAnalysisTests.analysis.test_encore.TestEncore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/utkbansal/Code/mdanalysis/testsuite/MDAnalysisTests/analysis/test_encore.py", line 186, in test_rmsd_matrix_without_superimposition
    n_jobs=1)
  File "/Users/utkbansal/Code/mdanalysis/package/MDAnalysis/analysis/encore/confdistmatrix.py", line 166, in conformational_distance_matrix
    masses) for element in indices)
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/parallel.py", line 758, in __call__
    while self.dispatch_one_batch(iterator):
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/parallel.py", line 608, in dispatch_one_batch
    self._dispatch(tasks)
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/parallel.py", line 571, in _dispatch
    job = self._backend.apply_async(batch, callback=cb)
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/_parallel_backends.py", line 109, in apply_async
    result = ImmediateResult(func)
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/_parallel_backends.py", line 326, in __init__
    self.results = batch()
  File "/Users/utkbansal/.virtualenvs/mdanalysis/lib/python2.7/site-packages/joblib/parallel.py", line 131, in __call__
    return [func(*args, **kwargs) for func, args, kwargs in self.items]
  File "/Users/utkbansal/Code/mdanalysis/package/MDAnalysis/analysis/encore/confdistmatrix.py", line 221, in set_rmsd_matrix_elements
    summasses)
  File "MDAnalysis/analysis/encore/cutils.pyx", line 41, in MDAnalysis.analysis.encore.cutils.PureRMSD (MDAnalysis/analysis/encore/cutils.c:1615)
    def PureRMSD(np.ndarray[np.float64_t,ndim=2] coordsi,
ValueError: "Buffer dtype mismatch, expected 'float64_t' but got 'float'\n

Maybe we could mention the file limit problem and its fix in the setup guide?

@utkbansal
Copy link
Member Author

Okay so there is a dependency version issue here.

The setup guide doesn't specify the version of numpy required. It simply specifies the following command -

pip install numpy

In the code, the setup.py present at mdanalysis/package/setup.py specifies only the minimum version of numpy required i.e. 1.5.0

On numpy 1.12.0 (the latest one) we get multiple KeyError: 'dtype' errors as I have mentioned above.

Switching to numpy 1.11.2 we get only one error - ValueError: "Buffer dtype mismatch, expected 'float64_t' but got 'float'\n which also I have mentioned above.

Which exact version of numpy is required? Maybe we should be adding this too to the setup guide.

@utkbansal
Copy link
Member Author

The latest TravisCI builds (https://travis-ci.org/MDAnalysis/mdanalysis/builds/192259974) also have failed due to the same reason. Conda installs numpy 1.11.3 and fails with the same ValueError: "Buffer dtype mismatch, expected 'float64_t' but got 'float'\n.

I wonder why didn't Conda install numpy 1.12.0 which is the lasted (when installed via pip)?

@jdetle
Copy link
Contributor

jdetle commented Jan 17, 2017

@utkbansal For what its worth I was running into the same max open files issue until you gave that fix.

@utkbansal
Copy link
Member Author

@jdetle did you also face the ValueError?

@jbarnoud
Copy link
Contributor

I just updated numpy in my environment from 1.11.3 to 1.12.0. While I had all the tests passing, I now have the KeyError. The problem comes from the implementation of assert_equal in numpy that reveals an innocuous bug in the handling of auxiliary data raising the wrong exception. Since the auxiliary data got introduced for 0.16, the released version of MDAnalysis should be unaffected.

The value error seems unrelated to the numpy version, indeed. analysis.encore.cutils.PureRMSD expects float64_t coordinates but receives float ones. The first commit to fail the test is e356604 (see travis: https://travis-ci.org/MDAnalysis/mdanalysis/builds/192119548). The pull request (#1132) was passing the tests, but it got merged right after #1145 in 789a96c. The two pull requests are touching parts of ENCORE. My guess is that the MemoryReader is now working with float32 rather than float64 which breaks analysis.encore.cutils.PureRMSD. The simple solution would be to change analysis.encore.cutils.PureRMSD to use float32 instead of float64 but I would like to know what @kain88-de and @wouterboomsma think about it before changing this.

The file limit is due to something at least as annoying but completely different. See #875.

@richardjgowers
Copy link
Member

@utkbansal thanks for the awesome issue report. The setup guide is a wiki, so if you want to edit it to include your fix for macOS that would be very handy.

@kain88-de
Copy link
Member

@utkbansal numpy 1.12 has been released very recently and not all packages we install that depend on numpy have been rebuild with that version of numpy. It is good to know that the new version broke some of our code. You can open a new issue with the exact error that you see using numpy version 1.12. Thanks.

@utkbansal
Copy link
Member Author

@richardjgowers I have added the instructions to the wiki. it would be great if you could have a look and tell if it looks fine.

@jdetle
Copy link
Contributor

jdetle commented Jan 17, 2017

@utkbansal I get the same exact behavior.

@richardjgowers
Copy link
Member

@utkbansal yep looks good, thanks

@kain88-de
Copy link
Member

@utkbansal do you still have problems with numpy 1.12 ? My conda packages have recently been updated and first test showed me that everything worked with the new version.

@kain88-de
Copy link
Member

I'm closing this. I now have numpy 1.12 builds of mdanalysis and everything still runs fine.

@utkbansal
Copy link
Member Author

@kain88-de Works on mine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants