{"action":"created","issue":{"url":"https://api.github.com/repos/arose/nglview/issues/736","repository_url":"https://api.github.com/repos/arose/nglview","labels_url":"https://api.github.com/repos/arose/nglview/issues/736/labels{/name}","comments_url":"https://api.github.com/repos/arose/nglview/issues/736/comments","events_url":"https://api.github.com/repos/arose/nglview/issues/736/events","html_url":"https://github.com/arose/nglview/issues/736","id":311551971,"number":736,"title":"Render static images for ASE","user":{"login":"jan-janssen","id":3854739,"avatar_url":"https://avatars2.githubusercontent.com/u/3854739?v=4","gravatar_id":"","url":"https://api.github.com/users/jan-janssen","html_url":"https://github.com/jan-janssen","followers_url":"https://api.github.com/users/jan-janssen/followers","following_url":"https://api.github.com/users/jan-janssen/following{/other_user}","gists_url":"https://api.github.com/users/jan-janssen/gists{/gist_id}","starred_url":"https://api.github.com/users/jan-janssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jan-janssen/subscriptions","organizations_url":"https://api.github.com/users/jan-janssen/orgs","repos_url":"https://api.github.com/users/jan-janssen/repos","events_url":"https://api.github.com/users/jan-janssen/events{/privacy}","received_events_url":"https://api.github.com/users/jan-janssen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-05T10:16:29Z","updated_at":"2018-04-06T04:44:20Z","closed_at":null,"author_association":"NONE","body":"I try to render static images of an ASE structure: \r\n\r\n```\r\nfrom ase import Atoms\r\nimport nglview\r\n\r\nd = 2.9\r\nL = 10.0\r\nwire = Atoms('Au', positions=[[0, L / 2, L / 2]], cell=[d, L, L], pbc=[1, 0, 0])\r\nview = nglview.show_ase(wire)\r\nview.add_spacefill(radius_type='vdw', scale=0.5)\r\nview.add_unitcell()\r\nview.render_image()\r\nview._display_image()\r\n```\r\n\r\nI get the following error message: \r\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)\r\n    968 \r\n    969             if method is not None:\r\n--> 970                 return method(include=include, exclude=exclude)\r\n    971             return None\r\n    972         else:\r\n\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/display.py in _repr_mimebundle_(self, include, exclude)\r\n   1190         if self.embed:\r\n   1191             mimetype = self._mimetype\r\n-> 1192             data, metadata = self._data_and_metadata(always_both=True)\r\n   1193             if metadata:\r\n   1194                 metadata = {mimetype: metadata}\r\n\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/display.py in _data_and_metadata(self, always_both)\r\n   1199     def _data_and_metadata(self, always_both=False):\r\n   1200         \"\"\"shortcut for returning metadata with shape information, if defined\"\"\"\r\n-> 1201         b64_data = b2a_base64(self.data).decode('ascii')\r\n   1202         md = {}\r\n   1203         if self.metadata:\r\n\r\nTypeError: a bytes-like object is required, not 'str'\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-1-3319cfd15b05> in <module>()\r\n      9 view.add_unitcell()\r\n     10 view.render_image()\r\n---> 11 view._display_image()\r\n\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/displayhook.py in __call__(self, result)\r\n    255             self.start_displayhook()\r\n    256             self.write_output_prompt()\r\n--> 257             format_dict, md_dict = self.compute_format_data(result)\r\n    258             self.update_user_ns(result)\r\n    259             self.fill_exec_result(result)\r\n\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/displayhook.py in compute_format_data(self, result)\r\n    149 \r\n    150         \"\"\"\r\n--> 151         return self.shell.display_formatter.format(result)\r\n    152 \r\n    153     # This can be set to True by the write_output_prompt method in a subclass\r\n\r\n~/anaconda/lib/python3.5/site-packages/IPython/core/formatters.py in format(self, obj, include, exclude)\r\n    148             return {}, {}\r\n    149 \r\n--> 150         format_dict, md_dict = self.mimebundle_formatter(obj, include=include, exclude=exclude)\r\n    151 \r\n    152         if format_dict or md_dict:\r\n\r\nTypeError: 'NoneType' object is not iterable\r\n```\r\n\r\nI tired Nglview versions 1.1.2 and 0.6.2.3, but was not able to get it to work. "},"comment":{"url":"https://api.github.com/repos/arose/nglview/issues/comments/379146543","html_url":"https://github.com/arose/nglview/issues/736#issuecomment-379146543","issue_url":"https://api.github.com/repos/arose/nglview/issues/736","id":379146543,"user":{"login":"hainm","id":4451957,"avatar_url":"https://avatars2.githubusercontent.com/u/4451957?v=4","gravatar_id":"","url":"https://api.github.com/users/hainm","html_url":"https://github.com/hainm","followers_url":"https://api.github.com/users/hainm/followers","following_url":"https://api.github.com/users/hainm/following{/other_user}","gists_url":"https://api.github.com/users/hainm/gists{/gist_id}","starred_url":"https://api.github.com/users/hainm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hainm/subscriptions","organizations_url":"https://api.github.com/users/hainm/orgs","repos_url":"https://api.github.com/users/hainm/repos","events_url":"https://api.github.com/users/hainm/events{/privacy}","received_events_url":"https://api.github.com/users/hainm/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T04:44:20Z","updated_at":"2018-04-06T04:44:20Z","author_association":"COLLABORATOR","body":"Please try the master branch again. I have a fix here (turns out it's much simpler than I though). https://github.com/arose/nglview/commit/f6b665d56fb1d07ccad4447e420c353341ff7ae5\r\n\r\n<img width=\"1132\" alt=\"screen shot 2018-04-06 at 12 41 34 am\" src=\"https://user-images.githubusercontent.com/4451957/38403744-a3ef2212-3933-11e8-8030-a9d02ec75852.png\">\r\n"}}
{"actor":{"display_login":"hainm"}}