{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/62487632","id":62487632,"diff_hunk":"@@ -553,23 +585,526 @@ def nu_fission(self, nu_fission):\n                 msg = \"Invalid Shape of Nu_fission!\"\n                 raise ValueError(msg)\n         else:\n-            # Get shape of nu_fission so we can figure if we need chi or not\n+            # Get shape of nu_fission to determine if we need chi or not\n             if nu_fission.shape == shape_vec:\n                 self._use_chi = True\n-                shape = shape_vec\n             elif nu_fission.shape == shape_mat:\n                 self._use_chi = False\n-                shape = shape_mat\n             else:\n                 msg = \"Invalid Shape of Nu_fission!\"\n                 raise ValueError(msg)\n \n         # check we have a numpy list\n-        check_type(\"nu_fission\", nu_fission, np.ndarray, expected_iter_type=Real)\n+        check_type(\"nu_fission\", nu_fission, np.ndarray,\n+                   expected_iter_type=Real)\n         self._nu_fission = np.copy(nu_fission)\n         if np.sum(self._nu_fission) > 0.0:\n             self._fissionable = True\n \n+    def set_total(self, total, **kwargs):\n+        if (isinstance(total, openmc.mgxs.TotalXS) or\n+            isinstance(total, openmc.mgxs.TransportXS)):","path":"openmc/mgxs_library.py","position":266,"original_position":266,"commit_id":"4d3e3a49dc3c6486fa91fc0599a525c26b80affa","original_commit_id":"4d3e3a49dc3c6486fa91fc0599a525c26b80affa","user":{"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},"body":"The second argument to `isinstance` can be a tuple of multiple types.","created_at":"2016-05-09T12:08:10Z","updated_at":"2016-05-09T12:08:10Z","html_url":"https://github.com/mit-crpg/openmc/pull/643#discussion_r62487632","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/643","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/62487632"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/643#discussion_r62487632"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/643"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/643","id":69249610,"html_url":"https://github.com/mit-crpg/openmc/pull/643","diff_url":"https://github.com/mit-crpg/openmc/pull/643.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/643.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/643","number":643,"state":"open","locked":false,"title":"Integrated generation of Multi-Group Cross Section libraries with openmc.mgxs.Library","user":{"login":"nelsonag","id":1037107,"avatar_url":"https://avatars.githubusercontent.com/u/1037107?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonag","html_url":"https://github.com/nelsonag","followers_url":"https://api.github.com/users/nelsonag/followers","following_url":"https://api.github.com/users/nelsonag/following{/other_user}","gists_url":"https://api.github.com/users/nelsonag/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonag/subscriptions","organizations_url":"https://api.github.com/users/nelsonag/orgs","repos_url":"https://api.github.com/users/nelsonag/repos","events_url":"https://api.github.com/users/nelsonag/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonag/received_events","type":"User","site_admin":false},"body":"This PR adds the capability to generate a multi-group cross section library for OpenMC's multi-group mode with @wbinventor's great `mgxs.Library` API.  This is done via the `mgxs.Library.write_mg_library(...)` routine.  \r\n\r\nI've also created an example notebook showing this off.  This has been incorporated in to the docs.  \r\n\r\nFinally, to make it a little easier for the user, I've made a list in the `mgxs.Library` module called 'OPENMC_MG_MGXS_TYPES` which can be used by the users to set the `mgxs_types` attribute of a `Library` object and to automatically get the types they'd need for a multi-group MC calculation.\r\n\r\nNote this PR is based off of #611 and so that would need to be merged first (... or just skip to this one after reviewing that one).","created_at":"2016-05-07T18:44:13Z","updated_at":"2016-05-09T12:08:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd00601801ff75fb143e38e983b1fd737481b626","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/643/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/643/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/643/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/4d3e3a49dc3c6486fa91fc0599a525c26b80affa","head":{"label":"nelsonag:mgxs_integration","ref":"mgxs_integration","sha":"4d3e3a49dc3c6486fa91fc0599a525c26b80affa","user":{"login":"nelsonag","id":1037107,"avatar_url":"https://avatars.githubusercontent.com/u/1037107?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonag","html_url":"https://github.com/nelsonag","followers_url":"https://api.github.com/users/nelsonag/followers","following_url":"https://api.github.com/users/nelsonag/following{/other_user}","gists_url":"https://api.github.com/users/nelsonag/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonag/subscriptions","organizations_url":"https://api.github.com/users/nelsonag/orgs","repos_url":"https://api.github.com/users/nelsonag/repos","events_url":"https://api.github.com/users/nelsonag/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonag/received_events","type":"User","site_admin":false},"repo":{"id":18528596,"name":"openmc","full_name":"nelsonag/openmc","owner":{"login":"nelsonag","id":1037107,"avatar_url":"https://avatars.githubusercontent.com/u/1037107?v=3","gravatar_id":"","url":"https://api.github.com/users/nelsonag","html_url":"https://github.com/nelsonag","followers_url":"https://api.github.com/users/nelsonag/followers","following_url":"https://api.github.com/users/nelsonag/following{/other_user}","gists_url":"https://api.github.com/users/nelsonag/gists{/gist_id}","starred_url":"https://api.github.com/users/nelsonag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelsonag/subscriptions","organizations_url":"https://api.github.com/users/nelsonag/orgs","repos_url":"https://api.github.com/users/nelsonag/repos","events_url":"https://api.github.com/users/nelsonag/events{/privacy}","received_events_url":"https://api.github.com/users/nelsonag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nelsonag/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/nelsonag/openmc","forks_url":"https://api.github.com/repos/nelsonag/openmc/forks","keys_url":"https://api.github.com/repos/nelsonag/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelsonag/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelsonag/openmc/teams","hooks_url":"https://api.github.com/repos/nelsonag/openmc/hooks","issue_events_url":"https://api.github.com/repos/nelsonag/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/nelsonag/openmc/events","assignees_url":"https://api.github.com/repos/nelsonag/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/nelsonag/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/nelsonag/openmc/tags","blobs_url":"https://api.github.com/repos/nelsonag/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelsonag/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelsonag/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelsonag/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelsonag/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/nelsonag/openmc/languages","stargazers_url":"https://api.github.com/repos/nelsonag/openmc/stargazers","contributors_url":"https://api.github.com/repos/nelsonag/openmc/contributors","subscribers_url":"https://api.github.com/repos/nelsonag/openmc/subscribers","subscription_url":"https://api.github.com/repos/nelsonag/openmc/subscription","commits_url":"https://api.github.com/repos/nelsonag/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelsonag/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelsonag/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelsonag/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/nelsonag/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/nelsonag/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelsonag/openmc/merges","archive_url":"https://api.github.com/repos/nelsonag/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelsonag/openmc/downloads","issues_url":"https://api.github.com/repos/nelsonag/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/nelsonag/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/nelsonag/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/nelsonag/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelsonag/openmc/labels{/name}","releases_url":"https://api.github.com/repos/nelsonag/openmc/releases{/id}","deployments_url":"https://api.github.com/repos/nelsonag/openmc/deployments","created_at":"2014-04-07T18:40:04Z","updated_at":"2016-01-16T18:49:13Z","pushed_at":"2016-05-08T23:28:41Z","git_url":"git://github.com/nelsonag/openmc.git","ssh_url":"git@github.com:nelsonag/openmc.git","clone_url":"https://github.com/nelsonag/openmc.git","svn_url":"https://github.com/nelsonag/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":27087,"stargazers_count":0,"watchers_count":0,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"ac1c004439986492be25f8926755b46cfba8017b","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}","deployments_url":"https://api.github.com/repos/mit-crpg/openmc/deployments","created_at":"2011-07-21T00:33:27Z","updated_at":"2016-04-26T10:43:19Z","pushed_at":"2016-05-08T23:28:41Z","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":43736,"stargazers_count":77,"watchers_count":77,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":93,"mirror_url":null,"open_issues_count":58,"forks":93,"open_issues":58,"watchers":77,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/643"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/643"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/643"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/643/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/643/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/643/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/4d3e3a49dc3c6486fa91fc0599a525c26b80affa"}}}}