pymc.test() errors

41 views
Skip to first unread message

Jennifer

unread,
Apr 21, 2011, 9:39:45 AM4/21/11
to PyMC
Hi,
I'm having trouble getting pymc.test() to run properly after updating
to python 2.7 from Enthought. I'm using Mac OS X 10.6.4. I noticed
that someone else posted a message about the same error recently on
March 17th and the answer was that it doesn't matter unless you need
the hdf5 backend. I do need this backend and thought Enthought
already came bundled with hdf5. Any ideas?
Thanks in advance,
Jennifer

In [2]: pymc.test()
Running unit tests for pymc.tests
NumPy version 1.5.1
NumPy is installed in /Library/Frameworks/EPD64.framework/Versions/7.0/
lib/python2.7/site-packages/numpy
Python version 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Dec 3 2010,
15:56:20) [GCC 4.0.1 (Apple Inc. build 5488)]
nose version 1.0.0
..F................F......EE.................S...............................................................................Warning:
divide by zero encountered in log
Warning: divide by zero encountered in log
Warning: divide by zero encountered in log
Warning: divide by zero encountered in log
.......................F..........................
======================================================================
ERROR: test_xdata_attributes (pymc.tests.test_database.TestHDF5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_database.py", line 237, in test_xdata_attributes
assert_array_equal(db.D, disaster_model.disasters_array)
AttributeError: 'Database' object has no attribute 'D'

======================================================================
ERROR: test_xhdf5_col (pymc.tests.test_database.TestHDF5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_database.py", line 263, in test_xhdf5_col
col = db.e.hdf5_col()
AttributeError: 'Database' object has no attribute 'e'

======================================================================
FAIL: Failure: AssertionError (
Items are not equal:
ACTUAL: 2
DESIRED: 0)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/nose/loader.py", line 390, in loadTestsFromName
addr.filename, addr.module)
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_LazyFunction.py", line 97, in <module>
assert_equal(L.get_cached_counts()[1,cur_frame],
C.counter.get_count())
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/numpy/testing/utils.py", line 313, in assert_equal
raise AssertionError(msg)
AssertionError:
Items are not equal:
ACTUAL: 2
DESIRED: 0

======================================================================
FAIL: test_simple (pymc.tests.test_convergence.test_raftery_lewis)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_convergence.py", line 72, in test_simple
assert(0.8 < (float(nprec)/kmind) / nmin < 1.2)
AssertionError

======================================================================
FAIL: test_gradients (pymc.tests.test_gradients.test_gradients)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_gradients.py", line 284, in test_gradients
check_gradients(gamma)
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/pymc-2.2alpha-py2.7-macosx-10.5-x86_64.egg/pymc/tests/
test_gradients.py", line 112, in check_gradients
" is not correct.")
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/numpy/testing/utils.py", line 774, in
assert_array_almost_equal
header='Arrays are not almost equal')
File "/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/
site-packages/numpy/testing/utils.py", line 618, in
assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal
analytic gradient for gamma with respect to parameter a is not
correct.
(mismatch 100.0%)
x: array([-1.73189107, -0.92868646, -3.52968499, -2.12876472,
-2.03282724])
y: array([-1.30910677, -0.50589983, -3.10690295, -1.70598664,
-1.61004785])

----------------------------------------------------------------------
Ran 175 tests in 27.934s

FAILED (SKIP=1, errors=2, failures=3)
Out[2]: <nose.result.TextTestResult run=175 errors=2 failures=3>



Chris Fonnesbeck

unread,
Apr 21, 2011, 9:28:19 PM4/21/11
to PyMC
Hi Jennifer,

I would not worry about these errors, unless you are looking to use
HDF5 to store your MCMC output. I will open an issue with this
problem, though, for future reference.

cf

David Huard

unread,
Apr 25, 2011, 9:15:40 AM4/25/11
to PyMC
Hi Jennifer,

Could you run

>>> import tables
>>> tables.test()

I'd be surprised if the problem came from pytables, but it seems like
the first logical thing to check.

Thanks,

david

Jennifer

unread,
Apr 28, 2011, 4:51:51 AM4/28/11
to PyMC
Hi David,
Sorry not to get back to you sooner on this - here is the output from
running what you suggested. It all looks ok.
Thanks,
Jennifer


In [1]: import tables

In [2]: tables.test()
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=
PyTables version: 2.2.1
HDF5 version: 1.8.5-patch1
NumPy version: 1.5.1
Numexpr version: 1.4.2 (using VML/MKL 10.3.1)
Zlib version: 1.2.3 (in Python interpreter)
BZIP2 version: 1.0.5 (10-Dec-2007)
Blosc version: 1.1.2 (2010-11-04)
Cython version: 0.14.1
Python version: 2.7.1 |EPD 7.0-2 (64-bit)| (r271:86832, Dec 3
2010, 15:56:20)
[GCC 4.0.1 (Apple Inc. build 5488)]
Platform: darwin-x86_64
Byte-ordering: little
Detected cores: 24
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=
Performing only a light (yet comprehensive) subset of the test suite.
If you want a more complete test, try passing the --heavy flag to this
script
(or set the 'heavy' parameter in case you are using tables.test()
call).
The whole suite will take more than 2 minutes to complete on a
relatively
modern CPU and around 150 MB of main memory.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=
/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-
packages/tables/filters.py:264: FiltersWarning: compression library
``lzo`` is not available; using ``zlib`` instead
% (complib, default_complib), FiltersWarning )
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 2975 tests in 54.081s

OK

Jennifer

unread,
Apr 28, 2011, 4:52:53 AM4/28/11
to PyMC
Hi Chris,
Sorry, I am looking to use HDF5 to store MCMC output.
Thanks,
Jennifer

Chris Fonnesbeck

unread,
May 1, 2011, 4:05:57 PM5/1/11
to PyMC
Jennifer,

A closer look revealed that those are just variable name errors that I
did not account for when updating our unit tests. I have fixed these
now in a recent commit (41e97972) on GitHub, so if you update from
this source, you should be good. Even with your current version, the
HDF5 backend should work, as it was an error in the test, not the
backend itself.

Regards,
cf

Jennifer

unread,
May 2, 2011, 1:46:58 PM5/2/11
to PyMC
Hi Chris,
Thanks so much for looking into this -- I very much appreciate it.
Cheers,
Jen
Reply all
Reply to author
Forward
0 new messages