dipde icon indicating copy to clipboard operation
dipde copied to clipboard

test_delay_singlepop fails with "TypeError: cannot determine truth value of Relational"

Open keszybz opened this issue 9 years ago • 4 comments

============================= test session starts ==============================
platform linux2 -- Python 2.7.12, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
rootdir: /var/tmp/dipde, inifile: 
plugins: xdist-1.13.1
collected 18 items 

dipde/test/test_basic.py .
dipde/test/test_delay.py F.
dipde/test/test_examples.py .....
dipde/test/test_propogation_methods.py ...
dipde/test/test_singlepop.py .
dipde/test/test_utilities.py ......

=================================== FAILURES ===================================
_____________________________ test_delay_singlepop _____________________________

    def test_delay_singlepop():

        # Settings:
        t0 = 0.
        dt = .001
        tf = .005
        verbose = False

        # Create simulation:
        b1 = ExternalPopulation('Heaviside(t)*100')
        i1 = InternalPopulation(v_min=0, v_max=.02, dv=.001, update_method='exact')
        b1_i1 = Connection(b1, i1, 1, weights=[.005], probs=[1.], delay=2*dt)
        simulation = Simulation([b1, i1], [b1_i1], verbose=verbose)
>       simulation.run(dt=dt, tf=tf, t0=t0)

dipde/test/test_delay.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
dipde/internals/simulation.py:104: in run
    self.initialize(t0=t0)
dipde/internals/simulation.py:75: in initialize
    p.initialize()
dipde/internals/internalpopulation.py:122: in initialize
    self.initialize_total_input_dict()
dipde/internals/internalpopulation.py:193: in initialize_total_input_dict
    self.total_input_dict[c.connection_distribution] = curr_input + c.curr_delayed_firing_rate * c.nsyn
dipde/internals/connection.py:148: in curr_delayed_firing_rate
    self.initialize_delay_queue()
dipde/internals/connection.py:125: in initialize_delay_queue
    self.delay_queue[i] = self.source.firing_rate(self.simulation.t - self.simulation.dt*i)
dipde/internals/externalpopulation.py:63: in firing_rate
    if curr_firing_rate < 0:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 100*Heaviside(0.0) < 0

    def __nonzero__(self):
>       raise TypeError("cannot determine truth value of Relational")
E       TypeError: cannot determine truth value of Relational

/usr/lib/python2.7/site-packages/sympy/core/relational.py:195: TypeError
---------------- generated xml file: /var/tmp/dipde/result.xml -----------------
===================== 1 failed, 17 passed in 14.14 seconds =====================

keszybz avatar Sep 21 '16 15:09 keszybz

Hello,

I am having trouble reproducing the bug. Can you please tell me what OS and what version of sympy you were using when the test failed?

Best, -n

nicain avatar Sep 26 '16 17:09 nicain

I was using Fedora 25, but it seems to be the same in Fedora 24. In Fedora 24 I have sympy-1.0-2.fc24.noarch.

keszybz avatar Sep 26 '16 18:09 keszybz

Got it. I'm having trouble with my workstation now, but as soon as I get back online Ill make a Fedora docker build and try again to reproduce. I have a patch in mind, so as soon as I can get it reproduced I think Ill get it fixed up and updated. Ill have more information tomorrow.

Best, -n

nicain avatar Sep 26 '16 19:09 nicain

We have a Dockerfile based on fedora:24 that reproduces this test failure now.

tfliss avatar Sep 27 '16 20:09 tfliss