{"action":"opened","issue":{"url":"https://api.github.com/repos/tclose/lib9ML/issues/3","labels_url":"https://api.github.com/repos/tclose/lib9ML/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/tclose/lib9ML/issues/3/comments","events_url":"https://api.github.com/repos/tclose/lib9ML/issues/3/events","html_url":"https://github.com/tclose/lib9ML/issues/3","id":91726705,"number":3,"title":" Missing 'RandomVariable' attribute in OnCondition block attribute error (Dynamics, Transitions, OnCondition).","user":{"login":"russellijarvis","id":7786645,"avatar_url":"https://avatars.githubusercontent.com/u/7786645?v=3","gravatar_id":"","url":"https://api.github.com/users/russellijarvis","html_url":"https://github.com/russellijarvis","followers_url":"https://api.github.com/users/russellijarvis/followers","following_url":"https://api.github.com/users/russellijarvis/following{/other_user}","gists_url":"https://api.github.com/users/russellijarvis/gists{/gist_id}","starred_url":"https://api.github.com/users/russellijarvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/russellijarvis/subscriptions","organizations_url":"https://api.github.com/users/russellijarvis/orgs","repos_url":"https://api.github.com/users/russellijarvis/repos","events_url":"https://api.github.com/users/russellijarvis/events{/privacy}","received_events_url":"https://api.github.com/users/russellijarvis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-29T07:43:01Z","updated_at":"2015-06-29T07:43:01Z","closed_at":null,"body":"lib9ml/test/unit/nineml_test/abstraction_layer/component$ python connectionrule_test.py \r\n---------------------------------------------------------------------------\r\nNineMLRuntimeError                        Traceback (most recent call last)\r\n/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)\r\n    202             else:\r\n    203                 filename = fname\r\n--> 204             __builtin__.execfile(filename, *where)\r\n\r\n/home/russell/git/lib9ml/test/unit/nineml_test/abstraction_layer/component/connectionrule_test.py in <module>()\r\n     45 c4 = nineml.read(\"/home/russell/git/lib9ml/test/xml/connectionrules/RandomFanIn.xml\")\r\n     46 c5 = nineml.read(\"/home/russell/git/lib9ml/test/xml/neurons/HodgkinHuxleyClass.xml\")\r\n---> 47 xml = c5.items()\r\n     48 ConnectionRule.from_xml(xml, Document())\r\n     49 c5.to_xml()\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/document.pyc in items(self)\r\n    117 \r\n    118     def items(self):\r\n--> 119         return list(self.iteritems())\r\n    120 \r\n    121     @property\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/document.pyc in iteritems(self)\r\n    113         for k, v in super(Document, self).iteritems():\r\n    114             if isinstance(v, self._Unloaded):\r\n--> 115                 v = self._load_elem_from_xml(v)\r\n    116             yield k, v\r\n    117 \r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/document.pyc in _load_elem_from_xml(self, unloaded)\r\n    171                                   for u in self._loading)))\r\n    172         self._loading.append(unloaded)\r\n--> 173         elem = unloaded.cls.from_xml(unloaded.xml, self)\r\n    174         assert self._loading[-1] is unloaded\r\n    175         self._loading.pop()\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/abstraction/dynamics/base.pyc in from_xml(cls, element, document, **kwargs)\r\n    696     @classmethod\r\n    697     def from_xml(cls, element, document, **kwargs):  # @UnusedVariable\r\n--> 698         return DynamicsXMLLoader(document).load_dynamics(element)\r\n    699 \r\n    700 \r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/annotations.pyc in annotate_from_xml(cls, element, *args, **kwargs)\r\n     62             kwargs['validate_dimensions'] = (\r\n     63                 annotations[NINEML][VALIDATE_DIMENSIONS] == 'True')\r\n---> 64         nineml_object = from_xml(cls, element, *args, **kwargs)\r\n     65         nineml_object.annotations.update(annotations.iteritems())\r\n     66         return nineml_object\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/abstraction/dynamics/visitors/xml.py in load_dynamics(self, element, **kwargs)\r\n     38                        'Constant')\r\n     39 \r\n---> 40         blocks = self._load_blocks(element, block_names=block_names)\r\n     41 \r\n     42         try:\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/abstraction/componentclass/visitors/xml.pyc in _load_blocks(self, element, block_names)\r\n    120                 raise NineMLRuntimeError(err)\r\n    121             try:\r\n--> 122                 loaded_objects[tag].append(self.tag_to_loader[tag](self, t))\r\n    123             except KeyError, e:\r\n    124                 raise NineMLRuntimeError(\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/annotations.pyc in annotate_from_xml(cls, element, *args, **kwargs)\r\n     62             kwargs['validate_dimensions'] = (\r\n     63                 annotations[NINEML][VALIDATE_DIMENSIONS] == 'True')\r\n---> 64         nineml_object = from_xml(cls, element, *args, **kwargs)\r\n     65         nineml_object.annotations.update(annotations.iteritems())\r\n     66         return nineml_object\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/abstraction/dynamics/visitors/xml.py in load_regime(self, element, **kwargs)\r\n     88         block_names = ('TimeDerivative', 'OnCondition', 'OnEvent',\r\n     89                        'Alias')\r\n---> 90         blocks = self._load_blocks(element, block_names=block_names)\r\n     91         transitions = blocks[\"OnEvent\"] + blocks['OnCondition']\r\n     92         #\r\n\r\n/usr/local/lib/python2.7/dist-packages/nineml/abstraction/componentclass/visitors/xml.pyc in _load_blocks(self, element, block_names)\r\n    127                             (\"'{}' \".format(t.attrib['name'])\r\n    128                              if 'name' in t.attrib else ''), tag,\r\n--> 129                             self.document.url))\r\n    130         return loaded_objects\r\n    131 \r\n\r\n\r\n\r\nNineMLRuntimeError: Missing 'RandomVariable' attribute in OnCondition block in '/lib9ml/test/xml/neurons/HodgkinHuxleyClass.xml' document\r\n\r\n------------------------------------------------------------------------------------------------------------\r\n\r\nAlthough the error message suggests that the problem is that the line of file: /lib9ml/test/xml/neurons/HodgkinHuxleyClass.xml \r\n\r\n<OnCondition target_regime=\"single\" >\r\n\r\nShould read:\r\n<OnCondition target_regime=\"single\" random_variable=\"r\">\r\n\r\nI am unsure if the problem is in the python code base of nineml, and not the XML code. \r\n\r\nI think the problem is that the problem is that the base dynamics object is not properly inheriting the _random_variable attribute from the classes \r\nnineml/abstraction/dynamics/base.py is not properly inheriting the attribute from:\r\n/dynamics/transitions.py (Transitions, and OnCondition)."}}