Title: Issue · GitHub
Open Graph Title: Issue · datajoint/datajoint-python
X Title: Issue · datajoint/datajoint-python
Description: Relational Workflows: where database schemas define executable data pipelines. - Issue · datajoint/datajoint-python
Open Graph Description: Relational Workflows: where database schemas define executable data pipelines. - Issue · datajoint/datajoint-python
X Description: Relational Workflows: where database schemas define executable data pipelines. - Issue · datajoint/datajoint-python
Opengraph URL: https://github.com/datajoint/datajoint-python
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"dj.ERD(schema).draw() throws networkx error","articleBody":"Hey guys, I recently get errors when calling `dj.ERD(schema).draw()` \r\nError Log:\r\n```---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\n/usr/local/lib/python3.5/dist-packages/networkx/classes/function.py in set_node_attributes(G, values, name)\r\n 640 try: # `values` is a dict\r\n--\u003e 641 for n, v in values.items():\r\n 642 try:\r\n\r\nAttributeError: 'str' object has no attribute 'items'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTypeError Traceback (most recent call last)\r\n\u003cipython-input-3-5dee5872e286\u003e in \u003cmodule\u003e()\r\n 1 fig = plt.figure(figsize=(30,30))\r\n----\u003e 2 dj.ERD(schema).draw()\r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/erd.py in draw(self)\r\n 284 \r\n 285 def draw(self):\r\n--\u003e 286 plt.imshow(self.make_image())\r\n 287 plt.gca().axis('off')\r\n 288 plt.show()\r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/erd.py in make_image(self)\r\n 278 \r\n 279 def make_image(self):\r\n--\u003e 280 return plt.imread(self.make_png())\r\n 281 \r\n 282 def _repr_svg_(self):\r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/erd.py in make_png(self)\r\n 275 \r\n 276 def make_png(self):\r\n--\u003e 277 return io.BytesIO(self.make_dot().create_png())\r\n 278 \r\n 279 def make_image(self):\r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/erd.py in make_dot(self)\r\n 218 import networkx as nx\r\n 219 \r\n--\u003e 220 graph = self._make_graph()\r\n 221 graph.nodes()\r\n 222 \r\n\r\n/usr/local/lib/python3.5/dist-packages/datajoint/erd.py in _make_graph(self)\r\n 206 # construct subgraph and rename nodes to class names\r\n 207 graph = nx.DiGraph(self).subgraph(nodes)\r\n--\u003e 208 nx.set_node_attributes(graph, 'node_type', {n: _get_tier(n) for n in graph})\r\n 209 # relabel nodes to class names\r\n 210 mapping = {node: (lookup_class_name(node, self.context) or node) for node in graph.nodes()}\r\n\r\n/usr/local/lib/python3.5/dist-packages/networkx/classes/function.py in set_node_attributes(G, values, name)\r\n 646 except AttributeError: # `values` is a constant\r\n 647 for n in G:\r\n--\u003e 648 G.nodes[n][name] = values\r\n 649 else: # `values` must be dict of dict\r\n 650 for n, d in values.items():\r\n\r\nTypeError: unhashable type: 'dict'\r\n\r\n ```\r\nIt seems to be a bug with networkx, however, I wanted to know if that issue happened with you as well\r\nnetworkx version is '2.0'","author":{"url":"https://github.com/Visdoom","@type":"Person","name":"Visdoom"},"datePublished":"2017-09-27T11:25:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/361/datajoint-python/issues/361"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:2cb356df-3cee-75af-5391-2168182353b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3CA:57E99:951129:C93B50:6A4D7139 |
| html-safe-nonce | fe22b05d59dccb7879684db548243f423f0c79409ddf29bc617435f55e702dd4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0NBOjU3RTk5Ojk1MTEyOTpDOTNCNTA6NkE0RDcxMzkiLCJ2aXNpdG9yX2lkIjoiODQxMzg4MjA0MTc3OTQ1MDE2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3375e4bd9dbd06466b7719341cd21f4a0fb9a951c7ec53e3cdbd9cc4659e5562 |
| hovercard-subject-tag | repository:5866704 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/datajoint/datajoint-python/issues/361 |
| twitter:image | https://repository-images.githubusercontent.com/5866704/e0732380-c920-11ea-87f7-178e13d99e73 |
| twitter:card | summary_large_image |
| og:image | https://repository-images.githubusercontent.com/5866704/e0732380-c920-11ea-87f7-178e13d99e73 |
| og:image:alt | Relational Workflows: where database schemas define executable data pipelines. - Issue · datajoint/datajoint-python |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-cache |
| go-import | github.com/datajoint/datajoint-python git https://github.com/datajoint/datajoint-python.git |
| octolytics-dimension-user_id | 2375501 |
| octolytics-dimension-user_login | datajoint |
| octolytics-dimension-repository_id | 5866704 |
| octolytics-dimension-repository_nwo | datajoint/datajoint-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 5866704 |
| octolytics-dimension-repository_network_root_nwo | datajoint/datajoint-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width