Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
keszybz opened this issue Sep 21, 2016 · 4 comments
Assignees
Labels

Comments

@keszybz
Copy link

keszybz commented Sep 21, 2016

============================= 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 =====================
@nicain
Copy link
Contributor

nicain commented Sep 26, 2016

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 nicain self-assigned this Sep 26, 2016
@nicain nicain added the bug label Sep 26, 2016
@keszybz
Copy link
Author

keszybz commented Sep 26, 2016

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.

@nicain
Copy link
Contributor

nicain commented Sep 26, 2016

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

@tfliss
Copy link

tfliss commented Sep 27, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants