{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/36480325","id":36480325,"diff_hunk":"@@ -701,13 +705,24 @@ def get_unique_universes(self):\n \n         \"\"\"\n \n-        unique_universes = np.unique(self._universes.ravel())\n-        universes = {}\n-\n-        for universe in unique_universes:\n-            universes[universe._id] = universe\n-\n-        return universes\n+        univs = dict()","path":"openmc/universe.py","position":35,"original_position":35,"commit_id":"76e6133512b18d37cd4cd8e61e24f3bf62e62215","original_commit_id":"76e6133512b18d37cd4cd8e61e24f3bf62e62215","user":{"login":"wbinventor","id":209492,"avatar_url":"https://avatars.githubusercontent.com/u/209492?v=3","gravatar_id":"","url":"https://api.github.com/users/wbinventor","html_url":"https://github.com/wbinventor","followers_url":"https://api.github.com/users/wbinventor/followers","following_url":"https://api.github.com/users/wbinventor/following{/other_user}","gists_url":"https://api.github.com/users/wbinventor/gists{/gist_id}","starred_url":"https://api.github.com/users/wbinventor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wbinventor/subscriptions","organizations_url":"https://api.github.com/users/wbinventor/orgs","repos_url":"https://api.github.com/users/wbinventor/repos","events_url":"https://api.github.com/users/wbinventor/events{/privacy}","received_events_url":"https://api.github.com/users/wbinventor/received_events","type":"User","site_admin":false},"body":"Wow that sucks. I can't believe they didn't keep a routine like ``flatten`` around.","created_at":"2015-08-07T00:03:37Z","updated_at":"2015-08-07T00:03:37Z","html_url":"https://github.com/mit-crpg/openmc/pull/425#discussion_r36480325","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/425","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/36480325"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/425#discussion_r36480325"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/425"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/425","id":40970910,"html_url":"https://github.com/mit-crpg/openmc/pull/425","diff_url":"https://github.com/mit-crpg/openmc/pull/425.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/425.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/425","number":425,"state":"open","locked":false,"title":"Fix PyAPI HexLattice.get_unique_universes()","user":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"body":"This PR addresses #413.\r\n\r\nWith this PR, we will no longer try to read in universes as numpy arrays.  Universes can't strictly be considered arrays because the number of columns is not constant across the rows (or vice versa maybe, I can never remember which index is the column and which is the row).  `Lattice.get_unique_universes` is now a little more clunky, but it works with both lattice types.\r\n\r\nTo make the setter type checking a little more precise, I've added a new function to our checking suite, `check_iterable_type`.  That function will crawl down an arbitrarily deep tree of nested iterables and look for the expected type.  Here are a few example inputs that show the exceptions raised by `check_iterable_type`:\r\n\r\nWrong type:\r\n\r\n```python\r\nlattice.universes = [ [univ1]*12, [univ1]*5 + [cell1], [univ1] ]\r\n```\r\n```\r\nValueError: Error setting lattice universes: Items must be of type 'Universe', but item at [1, 5] is of type 'Cell'\r\n```\r\n\r\nToo shallow:\r\n```python\r\nlattice.universes = [univ1]*19\r\n```\r\n```\r\nValueError: Error setting lattice universes: The item at [0] does not meet the minimum depth of 2\r\n```\r\n\r\nToo deep:\r\n```python\r\nlattice.universes = [ [ [univ1]*12, [ [univ1]*5, [univ2] ], [univ1] ] ]\r\n```\r\n```\r\nValueError: Error setting lattice universes: Found an iterable at [0, 1, 0], items in that iterable excceed the maximum depth of 3\r\n```","created_at":"2015-07-28T02:53:11Z","updated_at":"2015-08-07T00:03:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6e5df85cd62cafb9cda2be95212ef120586bd21","assignee":null,"milestone":{"url":"https://api.github.com/repos/mit-crpg/openmc/milestones/11","html_url":"https://github.com/mit-crpg/openmc/milestones/v0.7","labels_url":"https://api.github.com/repos/mit-crpg/openmc/milestones/11/labels","id":769762,"number":11,"title":"v0.7","description":"\"Minor\" release with significant new features such as Python API, material union grid method, distribcell filters, tally triggers, hexagonal lattices, and parallelism enhancements.","creator":{"login":"paulromano","id":743095,"avatar_url":"https://avatars.githubusercontent.com/u/743095?v=3","gravatar_id":"","url":"https://api.github.com/users/paulromano","html_url":"https://github.com/paulromano","followers_url":"https://api.github.com/users/paulromano/followers","following_url":"https://api.github.com/users/paulromano/following{/other_user}","gists_url":"https://api.github.com/users/paulromano/gists{/gist_id}","starred_url":"https://api.github.com/users/paulromano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulromano/subscriptions","organizations_url":"https://api.github.com/users/paulromano/orgs","repos_url":"https://api.github.com/users/paulromano/repos","events_url":"https://api.github.com/users/paulromano/events{/privacy}","received_events_url":"https://api.github.com/users/paulromano/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":29,"state":"open","created_at":"2014-08-28T15:56:37Z","updated_at":"2015-08-06T03:04:41Z","due_on":"2015-08-30T17:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/425/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/425/comments","review_comment_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/issues/425/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/76e6133512b18d37cd4cd8e61e24f3bf62e62215","head":{"label":"smharper:pyapi_lattice_outer","ref":"pyapi_lattice_outer","sha":"76e6133512b18d37cd4cd8e61e24f3bf62e62215","user":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"repo":{"id":10507820,"name":"openmc","full_name":"smharper/openmc","owner":{"login":"smharper","id":4622797,"avatar_url":"https://avatars.githubusercontent.com/u/4622797?v=3","gravatar_id":"","url":"https://api.github.com/users/smharper","html_url":"https://github.com/smharper","followers_url":"https://api.github.com/users/smharper/followers","following_url":"https://api.github.com/users/smharper/following{/other_user}","gists_url":"https://api.github.com/users/smharper/gists{/gist_id}","starred_url":"https://api.github.com/users/smharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smharper/subscriptions","organizations_url":"https://api.github.com/users/smharper/orgs","repos_url":"https://api.github.com/users/smharper/repos","events_url":"https://api.github.com/users/smharper/events{/privacy}","received_events_url":"https://api.github.com/users/smharper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smharper/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/smharper/openmc","forks_url":"https://api.github.com/repos/smharper/openmc/forks","keys_url":"https://api.github.com/repos/smharper/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smharper/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smharper/openmc/teams","hooks_url":"https://api.github.com/repos/smharper/openmc/hooks","issue_events_url":"https://api.github.com/repos/smharper/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/smharper/openmc/events","assignees_url":"https://api.github.com/repos/smharper/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/smharper/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/smharper/openmc/tags","blobs_url":"https://api.github.com/repos/smharper/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smharper/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smharper/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/smharper/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smharper/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/smharper/openmc/languages","stargazers_url":"https://api.github.com/repos/smharper/openmc/stargazers","contributors_url":"https://api.github.com/repos/smharper/openmc/contributors","subscribers_url":"https://api.github.com/repos/smharper/openmc/subscribers","subscription_url":"https://api.github.com/repos/smharper/openmc/subscription","commits_url":"https://api.github.com/repos/smharper/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/smharper/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/smharper/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/smharper/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/smharper/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/smharper/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smharper/openmc/merges","archive_url":"https://api.github.com/repos/smharper/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smharper/openmc/downloads","issues_url":"https://api.github.com/repos/smharper/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/smharper/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/smharper/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/smharper/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smharper/openmc/labels{/name}","releases_url":"https://api.github.com/repos/smharper/openmc/releases{/id}","created_at":"2013-06-05T16:55:01Z","updated_at":"2015-04-28T04:32:11Z","pushed_at":"2015-08-06T04:15:22Z","git_url":"git://github.com/smharper/openmc.git","ssh_url":"git@github.com:smharper/openmc.git","clone_url":"https://github.com/smharper/openmc.git","svn_url":"https://github.com/smharper/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":24440,"stargazers_count":0,"watchers_count":0,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"327600deaaed368752d451090ac1b07225f8101f","user":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"repo":{"id":2081118,"name":"openmc","full_name":"mit-crpg/openmc","owner":{"login":"mit-crpg","id":1247634,"avatar_url":"https://avatars.githubusercontent.com/u/1247634?v=3","gravatar_id":"","url":"https://api.github.com/users/mit-crpg","html_url":"https://github.com/mit-crpg","followers_url":"https://api.github.com/users/mit-crpg/followers","following_url":"https://api.github.com/users/mit-crpg/following{/other_user}","gists_url":"https://api.github.com/users/mit-crpg/gists{/gist_id}","starred_url":"https://api.github.com/users/mit-crpg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mit-crpg/subscriptions","organizations_url":"https://api.github.com/users/mit-crpg/orgs","repos_url":"https://api.github.com/users/mit-crpg/repos","events_url":"https://api.github.com/users/mit-crpg/events{/privacy}","received_events_url":"https://api.github.com/users/mit-crpg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mit-crpg/openmc","description":"OpenMC Monte Carlo Code","fork":false,"url":"https://api.github.com/repos/mit-crpg/openmc","forks_url":"https://api.github.com/repos/mit-crpg/openmc/forks","keys_url":"https://api.github.com/repos/mit-crpg/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mit-crpg/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mit-crpg/openmc/teams","hooks_url":"https://api.github.com/repos/mit-crpg/openmc/hooks","issue_events_url":"https://api.github.com/repos/mit-crpg/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/mit-crpg/openmc/events","assignees_url":"https://api.github.com/repos/mit-crpg/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/mit-crpg/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/mit-crpg/openmc/tags","blobs_url":"https://api.github.com/repos/mit-crpg/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mit-crpg/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mit-crpg/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/mit-crpg/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/mit-crpg/openmc/languages","stargazers_url":"https://api.github.com/repos/mit-crpg/openmc/stargazers","contributors_url":"https://api.github.com/repos/mit-crpg/openmc/contributors","subscribers_url":"https://api.github.com/repos/mit-crpg/openmc/subscribers","subscription_url":"https://api.github.com/repos/mit-crpg/openmc/subscription","commits_url":"https://api.github.com/repos/mit-crpg/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/mit-crpg/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/mit-crpg/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/mit-crpg/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/mit-crpg/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/mit-crpg/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mit-crpg/openmc/merges","archive_url":"https://api.github.com/repos/mit-crpg/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mit-crpg/openmc/downloads","issues_url":"https://api.github.com/repos/mit-crpg/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/mit-crpg/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/mit-crpg/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/mit-crpg/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mit-crpg/openmc/labels{/name}","releases_url":"https://api.github.com/repos/mit-crpg/openmc/releases{/id}","created_at":"2011-07-21T00:33:27Z","updated_at":"2015-07-22T06:10:59Z","pushed_at":"2015-08-06T01:24:58Z","git_url":"git://github.com/mit-crpg/openmc.git","ssh_url":"git@github.com:mit-crpg/openmc.git","clone_url":"https://github.com/mit-crpg/openmc.git","svn_url":"https://github.com/mit-crpg/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":36556,"stargazers_count":57,"watchers_count":57,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":75,"mirror_url":null,"open_issues_count":42,"forks":75,"open_issues":42,"watchers":57,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/425"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/425"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/425"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/425/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/425/comments"},"review_comment":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/425/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/76e6133512b18d37cd4cd8e61e24f3bf62e62215"}}}}