{"action":"created","issue":{"url":"https://api.github.com/repos/brian-team/brian2/issues/750","repository_url":"https://api.github.com/repos/brian-team/brian2","labels_url":"https://api.github.com/repos/brian-team/brian2/issues/750/labels{/name}","comments_url":"https://api.github.com/repos/brian-team/brian2/issues/750/comments","events_url":"https://api.github.com/repos/brian-team/brian2/issues/750/events","html_url":"https://github.com/brian-team/brian2/pull/750","id":176146725,"number":750,"title":"[WIP] Warn about unstable integration","user":{"login":"thesamovar","id":2903870,"avatar_url":"https://avatars.githubusercontent.com/u/2903870?v=3","gravatar_id":"","url":"https://api.github.com/users/thesamovar","html_url":"https://github.com/thesamovar","followers_url":"https://api.github.com/users/thesamovar/followers","following_url":"https://api.github.com/users/thesamovar/following{/other_user}","gists_url":"https://api.github.com/users/thesamovar/gists{/gist_id}","starred_url":"https://api.github.com/users/thesamovar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesamovar/subscriptions","organizations_url":"https://api.github.com/users/thesamovar/orgs","repos_url":"https://api.github.com/users/thesamovar/repos","events_url":"https://api.github.com/users/thesamovar/events{/privacy}","received_events_url":"https://api.github.com/users/thesamovar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-10T01:27:47Z","updated_at":"2016-09-10T15:17:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/brian-team/brian2/pulls/750","html_url":"https://github.com/brian-team/brian2/pull/750","diff_url":"https://github.com/brian-team/brian2/pull/750.diff","patch_url":"https://github.com/brian-team/brian2/pull/750.patch"},"body":"This isn't quite ready yet, but the basic ideas are there. Would be interested if you took a look and gave me some feedback @mstimberg.\r\n\r\nThe first thing is that by changing the default compiler options for MSVC we avoid the problem reported in #626 (see discussion there).\r\n\r\nThe next thing is that after a run, or on loading a state variable from disk, we check for nans or large values and warn if we find any. Currently, this isn't passing tests because it keeps raising the following error:\r\n\r\n```\r\nERROR: brian2.tests.test_stateupdaters.test_refractory_stochastic\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"C:\\Anaconda\\lib\\site-packages\\nose\\case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"C:\\programming\\brian2\\brian2\\tests\\test_stateupdaters.py\", line 683, in test_refractory_stochastic\r\n    net.run(10*ms)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\base.py\", line 278, in device_override_decorated_function\r\n    return func(*args, **kwds)\r\n  File \"C:\\programming\\brian2\\brian2\\units\\fundamentalunits.py\", line 2424, in new_f\r\n    result = f(*args, **kwds)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\network.py\", line 896, in run\r\n    obj._check_for_invalid_states()\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\group.py\", line 943, in _check_for_invalid_states\r\n    #     return\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\group.py\", line 522, in get_states\r\n    data = ImportExport.methods[format].export_data(self, vars, units=units, level=level)\r\n  File \"C:\\programming\\brian2\\brian2\\importexport\\dictlike.py\", line 22, in export_data\r\n    level=level+1),\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\neurongroup.py\", line 516, in state\r\n    return Group.state(self, name, use_units=use_units, level=level+1)\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\group.py\", line 349, in state\r\n    return var.get_addressable_value_with_unit(name=name, group=self)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\variables.py\", line 256, in get_addressable_value_with_unit\r\n    return self.get_value_with_unit()\r\n  File \"C:\\programming\\brian2\\brian2\\core\\variables.py\", line 208, in get_value_with_unit\r\n    return Quantity(self.get_value(), self.unit.dimensions)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\variables.py\", line 374, in get_value\r\n    raise TypeError('Cannot get the value for an auxiliary variable.')\r\nTypeError: Cannot get the value for an auxiliary variable.\r\n```\r\n\r\nIt seems this error is just being raised by calling ``get_states()`` on certain types of object.\r\n\r\nThe check for \"large\" values is ``abs(v)>1e150`` - I chose this value because SpikeGeneratorGroup has a period of 1e100. However, we could reduce the size of the default period instead of having such a massive threshold for \"too large\" values. A value of 1e50 seems like it would be better, since the largest SI prefix is 1e24.\r\n\r\nMight also be worth adding some tests, and checking performance implications of this test.\r\n\r\nFixes #554"},"comment":{"url":"https://api.github.com/repos/brian-team/brian2/issues/comments/246117261","html_url":"https://github.com/brian-team/brian2/pull/750#issuecomment-246117261","issue_url":"https://api.github.com/repos/brian-team/brian2/issues/750","id":246117261,"user":{"login":"thesamovar","id":2903870,"avatar_url":"https://avatars.githubusercontent.com/u/2903870?v=3","gravatar_id":"","url":"https://api.github.com/users/thesamovar","html_url":"https://github.com/thesamovar","followers_url":"https://api.github.com/users/thesamovar/followers","following_url":"https://api.github.com/users/thesamovar/following{/other_user}","gists_url":"https://api.github.com/users/thesamovar/gists{/gist_id}","starred_url":"https://api.github.com/users/thesamovar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesamovar/subscriptions","organizations_url":"https://api.github.com/users/thesamovar/orgs","repos_url":"https://api.github.com/users/thesamovar/repos","events_url":"https://api.github.com/users/thesamovar/events{/privacy}","received_events_url":"https://api.github.com/users/thesamovar/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T15:17:15Z","updated_at":"2016-09-10T15:17:15Z","body":"This seems like it might be a problem with multicompartmental?\r\n\r\n```\r\n======================================================================\r\nERROR: Rallpack 2\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"C:\\Anaconda\\lib\\site-packages\\nose\\case.py\", line 197, in runTest\r\n    self.test(*self.arg)\r\n  File \"C:\\programming\\brian2\\brian2\\tests\\test_spatialneuron.py\", line 343, in test_rallpack2\r\n    run(250*ms + defaultclock.dt)\r\n  File \"C:\\programming\\brian2\\brian2\\units\\fundamentalunits.py\", line 2424, in new_f\r\n    result = f(*args, **kwds)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\magic.py\", line 371, in run\r\n    namespace=namespace, profile=profile, level=2+level)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\magic.py\", line 231, in run\r\n    namespace=namespace, profile=profile, level=level+1)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\base.py\", line 278, in device_override_decorated_function\r\n    return func(*args, **kwds)\r\n  File \"C:\\programming\\brian2\\brian2\\units\\fundamentalunits.py\", line 2424, in new_f\r\n    result = f(*args, **kwds)\r\n  File \"C:\\programming\\brian2\\brian2\\core\\network.py\", line 880, in run\r\n    obj._check_for_invalid_states()\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\group.py\", line 945, in _check_for_invalid_states\r\n    self._check_for_invalid_values(k, v)\r\n  File \"C:\\programming\\brian2\\brian2\\groups\\group.py\", line 961, in _check_for_invalid_values\r\n    raise ValueError(\"nan for {name}.{k} = {v}\".format(name=self.name, k=k, v=v))\r\nValueError: nan for spatialneuron.y = [  8.00000000e-06              nan              nan ...,              nan\r\n              nan              nan]\r\n```"}}
{"actor":{"display_login":"thesamovar"}}