{"action":"created","issue":{"url":"https://api.github.com/repos/vispy/vispy/issues/878","labels_url":"https://api.github.com/repos/vispy/vispy/issues/878/labels{/name}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/878/comments","events_url":"https://api.github.com/repos/vispy/vispy/issues/878/events","html_url":"https://github.com/vispy/vispy/issues/878","id":69123868,"number":878,"title":"point_collection (no key in -> program.vert['transform'] )","user":{"login":"gabyx","id":647437,"avatar_url":"https://avatars.githubusercontent.com/u/647437?v=3","gravatar_id":"","url":"https://api.github.com/users/gabyx","html_url":"https://github.com/gabyx","followers_url":"https://api.github.com/users/gabyx/followers","following_url":"https://api.github.com/users/gabyx/following{/other_user}","gists_url":"https://api.github.com/users/gabyx/gists{/gist_id}","starred_url":"https://api.github.com/users/gabyx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabyx/subscriptions","organizations_url":"https://api.github.com/users/gabyx/orgs","repos_url":"https://api.github.com/users/gabyx/repos","events_url":"https://api.github.com/users/gabyx/events{/privacy}","received_events_url":"https://api.github.com/users/gabyx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-17T11:48:10Z","updated_at":"2015-04-20T19:17:10Z","closed_at":null,"body":"When I try to run the example point_collection \r\nhttps://github.com/vispy/vispy/blob/master/examples/collections/point_collection.py\r\nwith the ``mode='raw' or 'agg'``\r\nthe following error occures: \r\n\r\n\r\n```\r\nKeyError                                  Traceback (most recent call last)\r\n<ipython-input-11-7efb2e73af81> in <module>()\r\n     15 panzoom = PanZoomTransform(canvas)\r\n     16 \r\n---> 17 points = PointCollection(\"raw\", color=\"shared\")\r\n     18 points.append(np.random.normal(0.0, 0.5, (10000, 3)), itemsize=5000)\r\n     19 points[\"color\"] = (1, 0, 0, 1), (0, 0, 1, 1)\r\n\r\n/opt/python3.4env/lib/python3.4/site-packages/vispy-0.4.0_dev-py3.4.egg/vispy/visuals/collections/point_collection.py in PointCollection(mode, *args, **kwargs)\r\n     17 \r\n     18     if mode == \"raw\":\r\n---> 19         return RawPointCollection(*args, **kwargs)\r\n     20     return AggPointCollection(*args, **kwargs)\r\n\r\n/opt/python3.4env/lib/python3.4/site-packages/vispy-0.4.0_dev-py3.4.egg/vispy/visuals/collections/raw_point_collection.py in __init__(self, user_dtype, transform, vertex, fragment, **kwargs)\r\n     71         # Set hooks if necessary\r\n     72         program = self._programs[0]\r\n---> 73         program.vert['transform'] = self.transform\r\n     74 \r\n     75     def append(self, P, itemsize=None, **kwargs):\r\n\r\n/opt/python3.4env/lib/python3.4/site-packages/vispy-0.4.0_dev-py3.4.egg/vispy/visuals/shaders/function.py in __setitem__(self, key, val)\r\n    222                 storage = self._expressions\r\n    223             else:\r\n--> 224                 raise KeyError('Invalid template variable %r' % key)\r\n    225         else:\r\n    226             raise TypeError('In `function[key]` key must be a string or '\r\n\r\nKeyError: \"Invalid template variable 'transform'\"\r\n```"},"comment":{"url":"https://api.github.com/repos/vispy/vispy/issues/comments/94545168","html_url":"https://github.com/vispy/vispy/issues/878#issuecomment-94545168","issue_url":"https://api.github.com/repos/vispy/vispy/issues/878","id":94545168,"user":{"login":"campagnola","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=3","gravatar_id":"","url":"https://api.github.com/users/campagnola","html_url":"https://github.com/campagnola","followers_url":"https://api.github.com/users/campagnola/followers","following_url":"https://api.github.com/users/campagnola/following{/other_user}","gists_url":"https://api.github.com/users/campagnola/gists{/gist_id}","starred_url":"https://api.github.com/users/campagnola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/campagnola/subscriptions","organizations_url":"https://api.github.com/users/campagnola/orgs","repos_url":"https://api.github.com/users/campagnola/repos","events_url":"https://api.github.com/users/campagnola/events{/privacy}","received_events_url":"https://api.github.com/users/campagnola/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T19:17:10Z","updated_at":"2015-04-20T19:17:10Z","body":"Thanks! It looks like one of the GLSL files is not being loaded correctly (the \"collections/raw-point.vert\" at the end of the shader code indicates the file was not found. @rougier, can you have a look? I see this in `vispy/glsl/__init__.py`:\r\n\r\n```\r\ndef get(name):\r\n    \"\"\"Retrieve code from the given filename.\"\"\"\r\n\r\n    filename = find(name)\r\n    if filename is None:\r\n        return name\r\n    with open(filename) as fid:\r\n        return fid.read()\r\n```\r\n\r\nIs the `return name` line necessary? It would be much nicer to just raise an exception here.\r\n"}}