Open saltzberg opened 8 years ago
Bruce found the error below when running workbench_executable.py. Unable to recreate on OSX and Fedora with numpy 1.11.2.
Probably because Bruce is using Python 3 and you're trying to reproduce with Python 2. Your best solution would be to write a unit test to exercise this case. IMP nightly builds run all the unit tests on a Python 3 system, e.g. https://salilab.org/internal/imp/nightly/results/?comp=177&plat=3 (it'll be hard to spot the failure though since you have a bunch of other test failures right now!)
I suspect that it is because
numpy.savetxt
writes in binary and we pass it a file that has been opened in text mode?
Looks like it. Why not open the file in binary mode instead? On Python 2 this will make no difference, but on Python 3 it'll treat the file as a set of bytes rather than a string of Unicode characters, and that's probably what you want. Just open the file with "wb" rather than "w".
That change works for me (but of course, it worked before).
And yes, I need to go through and rewrite/expand a bunch of the test functions, including this issue, so keep this open until I write one.
Bruce found the error below when running workbench_executable.py. Unable to recreate on OSX and Fedora with numpy 1.11.2.
This occurs when the sigmas are written to log file. I suspect that it is because
numpy.savetxt
writes in binary and we pass it a file that has been opened in text mode?The sigmas are written out at each step (rather than storing them). We could instead store it and write them at the end, as this write step probably slows down the calculation some.