{"action":"created","comment":{"url":"https://api.github.com/repos/pyne/pyne/pulls/comments/23052810","id":23052810,"diff_hunk":"@@ -0,0 +1,816 @@\n+#!/usr/bin/env python\n+\n+\"\"\" Module for the production of PartiSn input decks. PartiSn is a discrete\n+ordinates code produced by Los Almos National Laboratory (LANL). Can be used\n+to produce neutron, photon, or coupled neutron photon prblems, adjoint or\n+forward or time dependent problems can be run.\n+\n+Module is designed to work on 1D, 2D, or 3D Cartesian geometries.\n+\n+If PyTaps not installed then this module will not work.\n+\"\"\"\n+\n+from __future__ import print_function, division\n+import sys\n+import collections\n+import string\n+import struct\n+import math\n+import os\n+import linecache\n+import datetime\n+from warnings import warn\n+from pyne.utils import QAWarning\n+import itertools\n+from sets import Set\n+\n+import numpy as np\n+import tables\n+\n+from pyne import dagmc\n+from pyne.material import Material\n+from pyne.material import MultiMaterial\n+from pyne.material import MaterialLibrary\n+\n+from pyne import nucname\n+from pyne.binaryreader import _BinaryReader, _FortranRecord\n+\n+warn(__name__ + \" is not yet QA compliant.\", QAWarning)\n+\n+# Mesh specific imports\n+try:\n+    from itaps import iMesh\n+    HAVE_PYTAPS = True\n+except ImportError:\n+    warn(\"the PyTAPS optional dependency could not be imported. \"\n+                  \"All aspects of the partisn module are not imported.\",\n+                  QAWarning)\n+    HAVE_PYTAPS = False\n+\n+if HAVE_PYTAPS:\n+    from pyne.mesh import Mesh, StatMesh, MeshError, IMeshTag\n+\n+\n+def write_partisn_input(mesh, hdf5, ngroup, nmq, **kwargs):\n+    \"\"\"This definition reads all necessary attributes from a material-laden \n+    geometry file, a pre-made PyNE mesh object, and the nuclear data cross \n+    section library, and any optional inputs that are necessary for creating a \n+    PARTISN input file. It then writes a PARTISN text input file for blocks 1-5.\n+    Note that comments appear in the created input file where more variables\n+    must be set. \n+    \n+    Notes:\n+        This does not write out all necessary inputs for the solver and cross\n+        section library (block 3 and 5). There is no assumed cross section \n+        library type.\n+    \n+    Parameters:\n+    -----------\n+        mesh : PyNE mesh object, a premade mesh object that conforms to the \n+            geometry. Bounds of the mesh must correspond to the desired PartiSn\n+            fine mesh intervals. One fine mesh per coarse mesh will be created. \n+            Can be 1-D, 2-D, or 3-D.\n+            Note: Only Cartesian meshes are currently supported.\n+        hdf5 : file path, a material-laden dagmc geometry file.\n+        ngroup : int, the number of energy groups in the cross section library\n+        nmq : int, the number of moments in a P_n expansion of the source\n+        \n+    Optional Parameters:","path":"pyne/partisn.py","position":78,"original_position":78,"commit_id":"d1317b3550f15a84aa21aa1afcb9782145a8aa56","original_commit_id":"d1317b3550f15a84aa21aa1afcb9782145a8aa56","user":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"body":"No need for an optional paremeters section, should be under parameters","created_at":"2015-01-15T23:24:28Z","updated_at":"2015-01-15T23:24:28Z","html_url":"https://github.com/pyne/pyne/pull/646#discussion_r23052810","pull_request_url":"https://api.github.com/repos/pyne/pyne/pulls/646","_links":{"self":{"href":"https://api.github.com/repos/pyne/pyne/pulls/comments/23052810"},"html":{"href":"https://github.com/pyne/pyne/pull/646#discussion_r23052810"},"pull_request":{"href":"https://api.github.com/repos/pyne/pyne/pulls/646"}}},"pull_request":{"url":"https://api.github.com/repos/pyne/pyne/pulls/646","id":27461166,"html_url":"https://github.com/pyne/pyne/pull/646","diff_url":"https://github.com/pyne/pyne/pull/646.diff","patch_url":"https://github.com/pyne/pyne/pull/646.patch","issue_url":"https://api.github.com/repos/pyne/pyne/issues/646","number":646,"state":"open","locked":false,"title":"Adding partisn module with write_partisn_input","user":{"login":"kkiesling","id":4060017,"avatar_url":"https://avatars.githubusercontent.com/u/4060017?v=3","gravatar_id":"","url":"https://api.github.com/users/kkiesling","html_url":"https://github.com/kkiesling","followers_url":"https://api.github.com/users/kkiesling/followers","following_url":"https://api.github.com/users/kkiesling/following{/other_user}","gists_url":"https://api.github.com/users/kkiesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kkiesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkiesling/subscriptions","organizations_url":"https://api.github.com/users/kkiesling/orgs","repos_url":"https://api.github.com/users/kkiesling/repos","events_url":"https://api.github.com/users/kkiesling/events{/privacy}","received_events_url":"https://api.github.com/users/kkiesling/received_events","type":"User","site_admin":false},"body":"This is a new module for partisn tools. Included in the module is a tool (write_partisn) to create a partisn input file. Also added in this PR is a function to the materials module to return atom density (added userguide entry) and a function in the dagmc module to return a dictionary of material and cell assignments. Note: I played around a bit with the location of the \"get_cell_material_assignments\" so let me know if you think it would work better in a different location within the file. All tests are included.","created_at":"2015-01-15T20:52:24Z","updated_at":"2015-01-15T23:24:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"855175347063619b12bbd7da454e7de1fc0e30f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pyne/pyne/pulls/646/commits","review_comments_url":"https://api.github.com/repos/pyne/pyne/pulls/646/comments","review_comment_url":"https://api.github.com/repos/pyne/pyne/pulls/comments/{number}","comments_url":"https://api.github.com/repos/pyne/pyne/issues/646/comments","statuses_url":"https://api.github.com/repos/pyne/pyne/statuses/d1317b3550f15a84aa21aa1afcb9782145a8aa56","head":{"label":"kkiesling:partisn","ref":"partisn","sha":"d1317b3550f15a84aa21aa1afcb9782145a8aa56","user":{"login":"kkiesling","id":4060017,"avatar_url":"https://avatars.githubusercontent.com/u/4060017?v=3","gravatar_id":"","url":"https://api.github.com/users/kkiesling","html_url":"https://github.com/kkiesling","followers_url":"https://api.github.com/users/kkiesling/followers","following_url":"https://api.github.com/users/kkiesling/following{/other_user}","gists_url":"https://api.github.com/users/kkiesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kkiesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkiesling/subscriptions","organizations_url":"https://api.github.com/users/kkiesling/orgs","repos_url":"https://api.github.com/users/kkiesling/repos","events_url":"https://api.github.com/users/kkiesling/events{/privacy}","received_events_url":"https://api.github.com/users/kkiesling/received_events","type":"User","site_admin":false},"repo":{"id":14724162,"name":"pyne","full_name":"kkiesling/pyne","owner":{"login":"kkiesling","id":4060017,"avatar_url":"https://avatars.githubusercontent.com/u/4060017?v=3","gravatar_id":"","url":"https://api.github.com/users/kkiesling","html_url":"https://github.com/kkiesling","followers_url":"https://api.github.com/users/kkiesling/followers","following_url":"https://api.github.com/users/kkiesling/following{/other_user}","gists_url":"https://api.github.com/users/kkiesling/gists{/gist_id}","starred_url":"https://api.github.com/users/kkiesling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkiesling/subscriptions","organizations_url":"https://api.github.com/users/kkiesling/orgs","repos_url":"https://api.github.com/users/kkiesling/repos","events_url":"https://api.github.com/users/kkiesling/events{/privacy}","received_events_url":"https://api.github.com/users/kkiesling/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkiesling/pyne","description":"PyNE: The Nuclear Engineering Toolkit","fork":true,"url":"https://api.github.com/repos/kkiesling/pyne","forks_url":"https://api.github.com/repos/kkiesling/pyne/forks","keys_url":"https://api.github.com/repos/kkiesling/pyne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkiesling/pyne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkiesling/pyne/teams","hooks_url":"https://api.github.com/repos/kkiesling/pyne/hooks","issue_events_url":"https://api.github.com/repos/kkiesling/pyne/issues/events{/number}","events_url":"https://api.github.com/repos/kkiesling/pyne/events","assignees_url":"https://api.github.com/repos/kkiesling/pyne/assignees{/user}","branches_url":"https://api.github.com/repos/kkiesling/pyne/branches{/branch}","tags_url":"https://api.github.com/repos/kkiesling/pyne/tags","blobs_url":"https://api.github.com/repos/kkiesling/pyne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkiesling/pyne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkiesling/pyne/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkiesling/pyne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkiesling/pyne/statuses/{sha}","languages_url":"https://api.github.com/repos/kkiesling/pyne/languages","stargazers_url":"https://api.github.com/repos/kkiesling/pyne/stargazers","contributors_url":"https://api.github.com/repos/kkiesling/pyne/contributors","subscribers_url":"https://api.github.com/repos/kkiesling/pyne/subscribers","subscription_url":"https://api.github.com/repos/kkiesling/pyne/subscription","commits_url":"https://api.github.com/repos/kkiesling/pyne/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkiesling/pyne/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkiesling/pyne/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkiesling/pyne/issues/comments/{number}","contents_url":"https://api.github.com/repos/kkiesling/pyne/contents/{+path}","compare_url":"https://api.github.com/repos/kkiesling/pyne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkiesling/pyne/merges","archive_url":"https://api.github.com/repos/kkiesling/pyne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkiesling/pyne/downloads","issues_url":"https://api.github.com/repos/kkiesling/pyne/issues{/number}","pulls_url":"https://api.github.com/repos/kkiesling/pyne/pulls{/number}","milestones_url":"https://api.github.com/repos/kkiesling/pyne/milestones{/number}","notifications_url":"https://api.github.com/repos/kkiesling/pyne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkiesling/pyne/labels{/name}","releases_url":"https://api.github.com/repos/kkiesling/pyne/releases{/id}","created_at":"2013-11-26T17:35:47Z","updated_at":"2014-06-14T03:52:28Z","pushed_at":"2015-01-15T20:44:55Z","git_url":"git://github.com/kkiesling/pyne.git","ssh_url":"git@github.com:kkiesling/pyne.git","clone_url":"https://github.com/kkiesling/pyne.git","svn_url":"https://github.com/kkiesling/pyne","homepage":"http://pynesim.org/","size":15834,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"master"}},"base":{"label":"pyne:develop","ref":"develop","sha":"691f2e44e3c38919f9e2515728d4246f1963b7bd","user":{"login":"pyne","id":760696,"avatar_url":"https://avatars.githubusercontent.com/u/760696?v=3","gravatar_id":"","url":"https://api.github.com/users/pyne","html_url":"https://github.com/pyne","followers_url":"https://api.github.com/users/pyne/followers","following_url":"https://api.github.com/users/pyne/following{/other_user}","gists_url":"https://api.github.com/users/pyne/gists{/gist_id}","starred_url":"https://api.github.com/users/pyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyne/subscriptions","organizations_url":"https://api.github.com/users/pyne/orgs","repos_url":"https://api.github.com/users/pyne/repos","events_url":"https://api.github.com/users/pyne/events{/privacy}","received_events_url":"https://api.github.com/users/pyne/received_events","type":"Organization","site_admin":false},"repo":{"id":1684953,"name":"pyne","full_name":"pyne/pyne","owner":{"login":"pyne","id":760696,"avatar_url":"https://avatars.githubusercontent.com/u/760696?v=3","gravatar_id":"","url":"https://api.github.com/users/pyne","html_url":"https://github.com/pyne","followers_url":"https://api.github.com/users/pyne/followers","following_url":"https://api.github.com/users/pyne/following{/other_user}","gists_url":"https://api.github.com/users/pyne/gists{/gist_id}","starred_url":"https://api.github.com/users/pyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyne/subscriptions","organizations_url":"https://api.github.com/users/pyne/orgs","repos_url":"https://api.github.com/users/pyne/repos","events_url":"https://api.github.com/users/pyne/events{/privacy}","received_events_url":"https://api.github.com/users/pyne/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pyne/pyne","description":"PyNE: The Nuclear Engineering Toolkit","fork":false,"url":"https://api.github.com/repos/pyne/pyne","forks_url":"https://api.github.com/repos/pyne/pyne/forks","keys_url":"https://api.github.com/repos/pyne/pyne/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyne/pyne/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyne/pyne/teams","hooks_url":"https://api.github.com/repos/pyne/pyne/hooks","issue_events_url":"https://api.github.com/repos/pyne/pyne/issues/events{/number}","events_url":"https://api.github.com/repos/pyne/pyne/events","assignees_url":"https://api.github.com/repos/pyne/pyne/assignees{/user}","branches_url":"https://api.github.com/repos/pyne/pyne/branches{/branch}","tags_url":"https://api.github.com/repos/pyne/pyne/tags","blobs_url":"https://api.github.com/repos/pyne/pyne/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyne/pyne/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyne/pyne/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyne/pyne/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyne/pyne/statuses/{sha}","languages_url":"https://api.github.com/repos/pyne/pyne/languages","stargazers_url":"https://api.github.com/repos/pyne/pyne/stargazers","contributors_url":"https://api.github.com/repos/pyne/pyne/contributors","subscribers_url":"https://api.github.com/repos/pyne/pyne/subscribers","subscription_url":"https://api.github.com/repos/pyne/pyne/subscription","commits_url":"https://api.github.com/repos/pyne/pyne/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyne/pyne/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyne/pyne/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyne/pyne/issues/comments/{number}","contents_url":"https://api.github.com/repos/pyne/pyne/contents/{+path}","compare_url":"https://api.github.com/repos/pyne/pyne/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyne/pyne/merges","archive_url":"https://api.github.com/repos/pyne/pyne/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyne/pyne/downloads","issues_url":"https://api.github.com/repos/pyne/pyne/issues{/number}","pulls_url":"https://api.github.com/repos/pyne/pyne/pulls{/number}","milestones_url":"https://api.github.com/repos/pyne/pyne/milestones{/number}","notifications_url":"https://api.github.com/repos/pyne/pyne/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyne/pyne/labels{/name}","releases_url":"https://api.github.com/repos/pyne/pyne/releases{/id}","created_at":"2011-04-30T15:04:07Z","updated_at":"2015-01-15T22:40:10Z","pushed_at":"2015-01-15T22:40:10Z","git_url":"git://github.com/pyne/pyne.git","ssh_url":"git@github.com:pyne/pyne.git","clone_url":"https://github.com/pyne/pyne.git","svn_url":"https://github.com/pyne/pyne","homepage":"http://pyne.io/","size":64053,"stargazers_count":41,"watchers_count":41,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":55,"forks":53,"open_issues":55,"watchers":41,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pyne/pyne/pulls/646"},"html":{"href":"https://github.com/pyne/pyne/pull/646"},"issue":{"href":"https://api.github.com/repos/pyne/pyne/issues/646"},"comments":{"href":"https://api.github.com/repos/pyne/pyne/issues/646/comments"},"review_comments":{"href":"https://api.github.com/repos/pyne/pyne/pulls/646/comments"},"review_comment":{"href":"https://api.github.com/repos/pyne/pyne/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/pyne/pyne/pulls/646/commits"},"statuses":{"href":"https://api.github.com/repos/pyne/pyne/statuses/d1317b3550f15a84aa21aa1afcb9782145a8aa56"}}}}