{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/45227168","id":45227168,"diff_hunk":"@@ -223,6 +229,37 @@ def domain_type(self, domain_type):\n         cv.check_value('domain type', domain_type, tuple(openmc.mgxs.DOMAIN_TYPES))\n         self._domain_type = domain_type\n \n+    @domains.setter\n+    def domains(self, domains):\n+\n+        # Use all materials, cells or universes in the geometry as domains\n+        if domains == 'all':\n+            self._domains = domains\n+\n+        # User specified a list of material, cell or universe domains\n+        else:\n+            if self.domain_type == 'material':\n+                cv.check_iterable_type('domain', domains, openmc.Material)\n+                all_domains = self.openmc_geometry.get_all_materials()\n+            elif self.domain_type in ['cell', 'distribcell']:\n+                cv.check_iterable_type('domain', domains, openmc.Cell)\n+                all_domains = self.openmc_geometry.get_all_material_cells()\n+            elif self.domain_type == 'universe':\n+                cv.check_iterable_type('domain', domains, openmc.Universe)\n+                all_domains = self.openmc_geometry.get_all_universes()\n+            else:\n+                msg = 'Unable to set domains with ' \\\n+                      'domain type \"{}\"'.format(self.domain_type)\n+                raise ValueError(msg)\n+\n+            # Check that each domain can be found in the geometry\n+            for domain in domains:\n+                if domain not in all_domains:\n+                    msg = 'Domain \"{}\" could not be found in the geometry'","path":"openmc/mgxs/library.py","position":null,"original_position":92,"commit_id":"e7cb73460792cdcce57e4381c3fa403fdc0a02e9","original_commit_id":"cfe1f1dfcd420bc235432c3edef5848e45f6076f","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":"Got it","created_at":"2015-11-18T17:02:14Z","updated_at":"2015-11-18T17:02:14Z","html_url":"https://github.com/mit-crpg/openmc/pull/502#discussion_r45227168","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/502","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/45227168"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/502#discussion_r45227168"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/502"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/502","id":51029832,"html_url":"https://github.com/mit-crpg/openmc/pull/502","diff_url":"https://github.com/mit-crpg/openmc/pull/502.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/502.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/502","number":502,"state":"open","locked":false,"title":"Fine-Grained MGXS Library Domain Control ","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":"This PR modifies `openmc.mgxs.Library` to allow for fine-grained control over the domains (materials, (distrib)cells or universes) for which `MGXS` objects are created. This follows up on the discussion about this by @paulromano on PR #471. The user now has full fine-grained control over the MGXS types (*e.g.*, \"transport\", \"nu-fission\", etc.) and the spatial tally domains for an MGXS `Library`. The previous behavior of creating `MGXS` objects for each spatial domain for a given domain type (\"material\", \"cell\", \"distribcell\" or \"universe\") is retained as the default or if the user sets the `Library.domain` attribute to \"all\".","created_at":"2015-11-18T01:15:33Z","updated_at":"2015-11-18T17:02:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98de4217e0d17d47d3c41a6785636976c7395b7f","assignee":{"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},"milestone":null,"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/502/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/502/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/502/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/e7cb73460792cdcce57e4381c3fa403fdc0a02e9","head":{"label":"wbinventor:mgxslib-granularity","ref":"mgxslib-granularity","sha":"e7cb73460792cdcce57e4381c3fa403fdc0a02e9","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},"repo":{"id":17599847,"name":"openmc","full_name":"wbinventor/openmc","owner":{"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},"private":false,"html_url":"https://github.com/wbinventor/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/wbinventor/openmc","forks_url":"https://api.github.com/repos/wbinventor/openmc/forks","keys_url":"https://api.github.com/repos/wbinventor/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wbinventor/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wbinventor/openmc/teams","hooks_url":"https://api.github.com/repos/wbinventor/openmc/hooks","issue_events_url":"https://api.github.com/repos/wbinventor/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/wbinventor/openmc/events","assignees_url":"https://api.github.com/repos/wbinventor/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/wbinventor/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/wbinventor/openmc/tags","blobs_url":"https://api.github.com/repos/wbinventor/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wbinventor/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wbinventor/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/wbinventor/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wbinventor/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/wbinventor/openmc/languages","stargazers_url":"https://api.github.com/repos/wbinventor/openmc/stargazers","contributors_url":"https://api.github.com/repos/wbinventor/openmc/contributors","subscribers_url":"https://api.github.com/repos/wbinventor/openmc/subscribers","subscription_url":"https://api.github.com/repos/wbinventor/openmc/subscription","commits_url":"https://api.github.com/repos/wbinventor/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/wbinventor/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/wbinventor/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/wbinventor/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/wbinventor/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/wbinventor/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wbinventor/openmc/merges","archive_url":"https://api.github.com/repos/wbinventor/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wbinventor/openmc/downloads","issues_url":"https://api.github.com/repos/wbinventor/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/wbinventor/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/wbinventor/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/wbinventor/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wbinventor/openmc/labels{/name}","releases_url":"https://api.github.com/repos/wbinventor/openmc/releases{/id}","created_at":"2014-03-10T16:36:03Z","updated_at":"2015-05-07T21:04:05Z","pushed_at":"2015-11-18T16:57:53Z","git_url":"git://github.com/wbinventor/openmc.git","ssh_url":"git@github.com:wbinventor/openmc.git","clone_url":"https://github.com/wbinventor/openmc.git","svn_url":"https://github.com/wbinventor/openmc","homepage":"http://mit-crpg.github.io/openmc/","size":27581,"stargazers_count":1,"watchers_count":1,"language":"FORTRAN","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"75e4aa96ed83999fbc3d3cfaf6a667ebb9a78ad9","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-11-08T23:33:43Z","pushed_at":"2015-11-18T16:57:53Z","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":35889,"stargazers_count":62,"watchers_count":62,"language":"FORTRAN","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"open_issues_count":41,"forks":85,"open_issues":41,"watchers":62,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/502"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/502"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/502"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/502/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/502/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/502/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/e7cb73460792cdcce57e4381c3fa403fdc0a02e9"}}}}