Skip to content
Browse files

filters: ProdCPdf: fixup rvs passed as lists

  • Loading branch information...
1 parent 684fd57 commit e92bb400378ae017a7e8c1eb7d8ac5ebc4af96c5 @strohel committed Oct 11, 2011
Showing with 16 additions and 0 deletions.
  1. +3 −0 pybayes/pdfs.py
  2. +13 −0 pybayes/tests/__main__.py
View
3 pybayes/pdfs.py
@@ -1224,6 +1224,9 @@ def _init_with_rvs(self, factors, rv, cond_rv):
:param factors: factor pdfs that will form the product
:type factors: :class:`list` of :class:`CPdf` items
"""
+ # rv, cond_rv could be lists, so convert them if needed
+ rv = RV(rv)
+ cond_rv = RV(cond_rv)
# gradually filled set of components that would be available in e.g.
# sample() computation:
avail_rvcomps = set(cond_rv.components)
View
13 pybayes/tests/__main__.py
@@ -0,0 +1,13 @@
+# Copyright (c) 2011 Matej Laitl <matej@laitl.cz>
+# Distributed under the terms of the GNU General Public License v2 or any
+# later version of the license, at your option.
+
+"""PyBayes test-suite runner. Used when user calls `python -m pybayes.tests"""
+
+import unittest as ut
+
+from pybayes.tests import *
+
+
+if __name__ == '__main__':
+ ut.main()

0 comments on commit e92bb40

Please sign in to comment.
Something went wrong with that request. Please try again.