probcomp / Venturecxx

Primary implementation of the Venture probabilistic programming system
http://probcomp.csail.mit.edu/venture/
GNU General Public License v3.0
28 stars 6 forks source link

Crash when comparing with VentureRecord #599

Closed lenaqr closed 8 years ago

lenaqr commented 8 years ago
venture[script] > 1 == return(1)
*** evaluation: <class 'venture.lite.records.VentureRecord'> is not in list
(autorun (eq 1 (return 1)))
         ^^^^^^^^^^^^^^^^^
Caused by
<class 'venture.lite.records.VentureRecord'> is not in list

Here's the end of the stack trace, which suggests that this happens because VentureRecord isn't in the list of venture_types.

.../Venturecxx/build/lib/venture/lite/value.pyc in compare(self, other)
     96     if st in venture_numeric_types and ot in venture_numeric_types:
     97       return stupidCompare(self.getNumber(), other.getNumber())
---> 98     if venture_types.index(st) < venture_types.index(ot) : return -1
     99     else: return 1 # We already checked for equality
    100   def compareSameType(self, _):

ValueError: <class 'venture.lite.records.VentureRecord'> is not in list