{"action":"created","comment":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/36604443","id":36604443,"diff_hunk":"@@ -0,0 +1,1512 @@\n+{\n+ \"cells\": [\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"This notebook shows the how tallies can be combined (added, subtracted, multiplied, etc.) using the Python API in order to create derived tallies. Since no covariance information is obtained, it is assumed that tallies are completely independent of one another when propagating uncertainties. The target problem is a simple pin cell.\\n\",\n+    \"\\n\",\n+    \"**Note:** that this Notebook was created using the latest Pandas v0.16.1. Everything in the Notebook will wun with older versions of Pandas, but the multi-indexing option in >v0.15.0 makes the tables look prettier.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 1,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"%load_ext autoreload\\n\",\n+    \"%autoreload 2\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 2,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"import glob\\n\",\n+    \"from IPython.display import Image\\n\",\n+    \"import numpy as np\\n\",\n+    \"\\n\",\n+    \"import openmc\\n\",\n+    \"from openmc.statepoint import StatePoint\\n\",\n+    \"from openmc.summary import Summary\\n\",\n+    \"\\n\",\n+    \"%matplotlib inline\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"## Generate Input Files\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"First we need to define materials that will be used in the problem. Before defining a material, we must create nuclides that are used in the material.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 3,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate some Nuclides\\n\",\n+    \"h1 = openmc.Nuclide('H-1')\\n\",\n+    \"b10 = openmc.Nuclide('B-10')\\n\",\n+    \"o16 = openmc.Nuclide('O-16')\\n\",\n+    \"u235 = openmc.Nuclide('U-235')\\n\",\n+    \"u238 = openmc.Nuclide('U-238')\\n\",\n+    \"zr90 = openmc.Nuclide('Zr-90')\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"With the nuclides we defined, we will now create three materials for the fuel, water, and cladding of the fuel pin.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 4,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# 1.6 enriched fuel\\n\",\n+    \"fuel = openmc.Material(name='1.6% Fuel')\\n\",\n+    \"fuel.set_density('g/cm3', 10.31341)\\n\",\n+    \"fuel.add_nuclide(u235, 3.7503e-4)\\n\",\n+    \"fuel.add_nuclide(u238, 2.2625e-2)\\n\",\n+    \"fuel.add_nuclide(o16, 4.6007e-2)\\n\",\n+    \"\\n\",\n+    \"# borated water\\n\",\n+    \"water = openmc.Material(name='Borated Water')\\n\",\n+    \"water.set_density('g/cm3', 0.740582)\\n\",\n+    \"water.add_nuclide(h1, 4.9457e-2)\\n\",\n+    \"water.add_nuclide(o16, 2.4732e-2)\\n\",\n+    \"water.add_nuclide(b10, 8.0042e-6)\\n\",\n+    \"\\n\",\n+    \"# zircaloy\\n\",\n+    \"zircaloy = openmc.Material(name='Zircaloy')\\n\",\n+    \"zircaloy.set_density('g/cm3', 6.55)\\n\",\n+    \"zircaloy.add_nuclide(zr90, 7.2758e-3)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"With our three materials, we can now create a materials file object that can be exported to an actual XML file.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 5,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate a MaterialsFile, add Materials\\n\",\n+    \"materials_file = openmc.MaterialsFile()\\n\",\n+    \"materials_file.add_material(fuel)\\n\",\n+    \"materials_file.add_material(water)\\n\",\n+    \"materials_file.add_material(zircaloy)\\n\",\n+    \"materials_file.default_xs = '71c'\\n\",\n+    \"\\n\",\n+    \"# Export to \\\"materials.xml\\\"\\n\",\n+    \"materials_file.export_to_xml()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Now let's move on to the geometry. Our problem will have three regions for the fuel, the clad, and the surrounding coolant. The first step is to create the bounding surfaces -- in this case two cylinders and six reflective planes.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 6,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Create cylinders for the fuel and clad\\n\",\n+    \"fuel_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.39218)\\n\",\n+    \"clad_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.45720)\\n\",\n+    \"\\n\",\n+    \"# Create boundary planes to surround the geometry\\n\",\n+    \"# Use both reflective and vacuum boundaries to make life interesting\\n\",\n+    \"min_x = openmc.XPlane(x0=-0.63, boundary_type='reflective')\\n\",\n+    \"max_x = openmc.XPlane(x0=+0.63, boundary_type='reflective')\\n\",\n+    \"min_y = openmc.YPlane(y0=-0.63, boundary_type='reflective')\\n\",\n+    \"max_y = openmc.YPlane(y0=+0.63, boundary_type='reflective')\\n\",\n+    \"min_z = openmc.ZPlane(z0=-0.63, boundary_type='reflective')\\n\",\n+    \"max_z = openmc.ZPlane(z0=+0.63, boundary_type='reflective')\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"With the surfaces defined, we can now create cells that are defined by intersections of half-spaces created by the surfaces.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 7,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Create a Universe to encapsulate a fuel pin\\n\",\n+    \"pin_cell_universe = openmc.Universe(name='1.6% Fuel Pin')\\n\",\n+    \"\\n\",\n+    \"# Create fuel Cell\\n\",\n+    \"fuel_cell = openmc.Cell(name='1.6% Fuel')\\n\",\n+    \"fuel_cell.fill = fuel\\n\",\n+    \"fuel_cell.add_surface(fuel_outer_radius, halfspace=-1)\\n\",\n+    \"pin_cell_universe.add_cell(fuel_cell)\\n\",\n+    \"\\n\",\n+    \"# Create a clad Cell\\n\",\n+    \"clad_cell = openmc.Cell(name='1.6% Clad')\\n\",\n+    \"clad_cell.fill = zircaloy\\n\",\n+    \"clad_cell.add_surface(fuel_outer_radius, halfspace=+1)\\n\",\n+    \"clad_cell.add_surface(clad_outer_radius, halfspace=-1)\\n\",\n+    \"pin_cell_universe.add_cell(clad_cell)\\n\",\n+    \"\\n\",\n+    \"# Create a moderator Cell\\n\",\n+    \"moderator_cell = openmc.Cell(name='1.6% Moderator')\\n\",\n+    \"moderator_cell.fill = water\\n\",\n+    \"moderator_cell.add_surface(clad_outer_radius, halfspace=+1)\\n\",\n+    \"pin_cell_universe.add_cell(moderator_cell)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"OpenMC requires that there is a \\\"root\\\" universe. Let us create a root cell that is filled by the pin cell universe and then assign it to the root universe.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 8,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Create root Cell\\n\",\n+    \"root_cell = openmc.Cell(name='root cell')\\n\",\n+    \"root_cell.fill = pin_cell_universe\\n\",\n+    \"\\n\",\n+    \"# Add boundary planes\\n\",\n+    \"root_cell.add_surface(min_x, halfspace=+1)\\n\",\n+    \"root_cell.add_surface(max_x, halfspace=-1)\\n\",\n+    \"root_cell.add_surface(min_y, halfspace=+1)\\n\",\n+    \"root_cell.add_surface(max_y, halfspace=-1)\\n\",\n+    \"root_cell.add_surface(min_z, halfspace=+1)\\n\",\n+    \"root_cell.add_surface(max_z, halfspace=-1)\\n\",\n+    \"\\n\",\n+    \"# Create root Universe\\n\",\n+    \"root_universe = openmc.Universe(universe_id=0, name='root universe')\\n\",\n+    \"root_universe.add_cell(root_cell)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"We now must create a geometry that is assigned a root universe, put the geometry into a geometry file, and export it to XML.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 9,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Create Geometry and set root Universe\\n\",\n+    \"geometry = openmc.Geometry()\\n\",\n+    \"geometry.root_universe = root_universe\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 10,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate a GeometryFile\\n\",\n+    \"geometry_file = openmc.GeometryFile()\\n\",\n+    \"geometry_file.geometry = geometry\\n\",\n+    \"\\n\",\n+    \"# Export to \\\"geometry.xml\\\"\\n\",\n+    \"geometry_file.export_to_xml()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"With the geometry and materials finished, we now just need to define simulation parameters. In this case, we will use 5 inactive batches and 15 active batches each with 2500 particles.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 11,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# OpenMC simulation parameters\\n\",\n+    \"batches = 20\\n\",\n+    \"inactive = 5\\n\",\n+    \"particles = 2500\\n\",\n+    \"\\n\",\n+    \"# Instantiate a SettingsFile\\n\",\n+    \"settings_file = openmc.SettingsFile()\\n\",\n+    \"settings_file.batches = batches\\n\",\n+    \"settings_file.inactive = inactive\\n\",\n+    \"settings_file.particles = particles\\n\",\n+    \"settings_file.output = {'tallies': True, 'summary': True}\\n\",\n+    \"source_bounds = [-0.63, -0.63, -10, 0.63, 0.63, 10.]\\n\",\n+    \"settings_file.set_source_space('box', source_bounds)\\n\",\n+    \"\\n\",\n+    \"# Export to \\\"settings.xml\\\"\\n\",\n+    \"settings_file.export_to_xml()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Let us also create a plot file that we can use to verify that our pin cell geometry was created successfully.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 12,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate a Plot\\n\",\n+    \"plot = openmc.Plot(plot_id=1)\\n\",\n+    \"plot.filename = 'materials-xy'\\n\",\n+    \"plot.origin = [0, 0, 0]\\n\",\n+    \"plot.width = [1.26, 1.26]\\n\",\n+    \"plot.pixels = [250, 250]\\n\",\n+    \"plot.color = 'mat'\\n\",\n+    \"\\n\",\n+    \"# Instantiate a PlotsFile, add Plot, and export to \\\"plots.xml\\\"\\n\",\n+    \"plot_file = openmc.PlotsFile()\\n\",\n+    \"plot_file.add_plot(plot)\\n\",\n+    \"plot_file.export_to_xml()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"With the plots.xml file, we can now generate and view the plot. OpenMC outputs plots in .ppm format, which can be converted into a compressed format like .png with the convert utility.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 13,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Run openmc in plotting mode\\n\",\n+    \"executor = openmc.Executor()\\n\",\n+    \"executor.plot_geometry(output=False)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 14,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [\n+    {\n+     \"data\": {\n+      \"image/png\": \"iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC\\nAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAxQTFRF\\n////chIS6YCRTb/E6kGE+wAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAALKSURB\\nVGje7dpLcqQwDAbgHHE2YeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmN\\nP+HDhw8fPnz48Kf6VH9G+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4\\nzPji99z0/AJ4n1lfvJ6fnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6\\npA0wfln+ho/fwgYYn19C/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tN\\nDbSGz7T0SBEWw4vLXzbQ6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X5\\n8wZaxWd1+fMGiuFvir8bvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV\\n873hB8UnM3xzANtf8nb4dwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7\\nT/ppARBvp48UwJnelT5SACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4/\\n/Jve+fhsH6Ctv7n8PTzjvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V\\n32/o9+fl389Xnx+g5x/o+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6\\n/4Le/6D3T/D9V67Y/ZsVQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/\\ngPs/0P4TtP8F7r9J3AIO9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTu\\nf4X7b+H+X7T/+BPuf3aM8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIw\\nMTUtMDgtMDZUMTY6NDM6MTMrMDc6MDBtUQj+AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA4LTA2\\nVDE2OjQzOjEzKzA3OjAwHAywQgAAAABJRU5ErkJggg==\\n\",\n+      \"text/plain\": [\n+       \"<IPython.core.display.Image object>\"\n+      ]\n+     },\n+     \"execution_count\": 14,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Convert OpenMC's funky ppm to png\\n\",\n+    \"!convert materials-xy.ppm materials-xy.png\\n\",\n+    \"\\n\",\n+    \"# Display the materials plot inline\\n\",\n+    \"Image(filename='materials-xy.png')\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"As we can see from the plot, we have a nice pin cell with fuel, cladding, and water! Before we run our simulation, we need to tell the code what we want to tally. The following code shows how to create a variety of tallies.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 15,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate an empty TalliesFile\\n\",\n+    \"tallies_file = openmc.TalliesFile()\\n\",\n+    \"tallies_file.tallies = []\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 16,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Create Tallies to compute microscopic multi-group cross-sections\\n\",\n+    \"\\n\",\n+    \"# Instantiate energy filter for multi-group cross-section Tallies\\n\",\n+    \"energy_filter = openmc.Filter(type='energy', bins=[0., 0.625e-6, 20.])\\n\",\n+    \"\\n\",\n+    \"# Instantiate flux Tally in moderator and fuel\\n\",\n+    \"tally = openmc.Tally(name='flux')\\n\",\n+    \"tally.add_filter(openmc.Filter(type='cell', bins=[fuel_cell.id, moderator_cell.id]))\\n\",\n+    \"tally.add_filter(energy_filter)\\n\",\n+    \"tally.add_score('flux')\\n\",\n+    \"tallies_file.add_tally(tally)\\n\",\n+    \"\\n\",\n+    \"# Instantiate reaction rate Tally in fuel\\n\",\n+    \"tally = openmc.Tally(name='fuel rxn rates')\\n\",\n+    \"tally.add_filter(openmc.Filter(type='cell', bins=[fuel_cell.id]))\\n\",\n+    \"tally.add_filter(energy_filter)\\n\",\n+    \"tally.add_score('nu-fission')\\n\",\n+    \"tally.add_score('scatter')\\n\",\n+    \"tally.add_nuclide(u238)\\n\",\n+    \"tally.add_nuclide(u235)\\n\",\n+    \"tallies_file.add_tally(tally)\\n\",\n+    \"\\n\",\n+    \"# Instantiate reaction rate Tally in moderator\\n\",\n+    \"tally = openmc.Tally(name='moderator rxn rates')\\n\",\n+    \"tally.add_filter(openmc.Filter(type='cell', bins=[moderator_cell.id]))\\n\",\n+    \"tally.add_filter(energy_filter)\\n\",\n+    \"tally.add_score('absorption')\\n\",\n+    \"tally.add_score('total')\\n\",\n+    \"tally.add_nuclide(o16)\\n\",\n+    \"tally.add_nuclide(h1)\\n\",\n+    \"tallies_file.add_tally(tally)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 17,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# K-Eigenvalue (infinity) tallies\\n\",\n+    \"fiss_rate = openmc.Tally(name='fiss. rate')\\n\",\n+    \"abs_rate = openmc.Tally(name='abs. rate')\\n\",\n+    \"fiss_rate.add_score('nu-fission')\\n\",\n+    \"abs_rate.add_score('absorption')\\n\",\n+    \"tallies_file.add_tally(fiss_rate)\\n\",\n+    \"tallies_file.add_tally(abs_rate)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 18,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Resonance Escape Probability tallies\\n\",\n+    \"therm_abs_rate = openmc.Tally(name='therm. abs. rate')\\n\",\n+    \"therm_abs_rate.add_score('absorption')\\n\",\n+    \"therm_abs_rate.add_filter(openmc.Filter(type='energy', bins=[0., 0.625]))\\n\",\n+    \"tallies_file.add_tally(therm_abs_rate)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 19,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Thermal Flux Utilization tallies\\n\",\n+    \"fuel_therm_abs_rate = openmc.Tally(name='fuel therm. abs. rate')\\n\",\n+    \"fuel_therm_abs_rate.add_score('absorption')\\n\",\n+    \"fuel_therm_abs_rate.add_filter(openmc.Filter(type='energy', bins=[0., 0.625]))\\n\",\n+    \"fuel_therm_abs_rate.add_filter(openmc.Filter(type='cell', bins=[fuel_cell.id]))\\n\",\n+    \"tallies_file.add_tally(fuel_therm_abs_rate)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 20,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Fast Fission Factor tallies\\n\",\n+    \"therm_fiss_rate = openmc.Tally(name='therm. fiss. rate')\\n\",\n+    \"tot_fiss_rate = openmc.Tally(name='tot. fiss. rate')\\n\",\n+    \"therm_fiss_rate.add_score('fission')\\n\",\n+    \"tot_fiss_rate.add_score('fission')\\n\",\n+    \"therm_fiss_rate.add_filter(openmc.Filter(type='energy', bins=[0., 0.625]))\\n\",\n+    \"tallies_file.add_tally(therm_fiss_rate)\\n\",\n+    \"tallies_file.add_tally(tot_fiss_rate)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 21,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Instantiate energy filter to illustrate Tally slicing\\n\",\n+    \"energy_filter = openmc.Filter(type='energy', bins=np.logspace(np.log10(1e-8), np.log10(20), 10))\\n\",\n+    \"\\n\",\n+    \"# Instantiate flux Tally in moderator and fuel\\n\",\n+    \"tally = openmc.Tally(name='need-to-slice')\\n\",\n+    \"tally.add_filter(openmc.Filter(type='cell', bins=[fuel_cell.id, moderator_cell.id]))\\n\",\n+    \"tally.add_filter(energy_filter)\\n\",\n+    \"tally.add_score('nu-fission')\\n\",\n+    \"tally.add_score('scatter')\\n\",\n+    \"tally.add_nuclide(h1)\\n\",\n+    \"tally.add_nuclide(u238)\\n\",\n+    \"tallies_file.add_tally(tally)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 22,\n+   \"metadata\": {\n+    \"collapsed\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Export to \\\"tallies.xml\\\"\\n\",\n+    \"tallies_file.export_to_xml()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Now we a have a complete set of inputs, so we can go ahead and run our simulation.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 23,\n+   \"metadata\": {\n+    \"collapsed\": false,\n+    \"scrolled\": true\n+   },\n+   \"outputs\": [\n+    {\n+     \"name\": \"stdout\",\n+     \"output_type\": \"stream\",\n+     \"text\": [\n+      \"\\n\",\n+      \"       .d88888b.                             888b     d888  .d8888b.\\n\",\n+      \"      d88P\\\" \\\"Y88b                            8888b   d8888 d88P  Y88b\\n\",\n+      \"      888     888                            88888b.d88888 888    888\\n\",\n+      \"      888     888 88888b.   .d88b.  88888b.  888Y88888P888 888       \\n\",\n+      \"      888     888 888 \\\"88b d8P  Y8b 888 \\\"88b 888 Y888P 888 888       \\n\",\n+      \"      888     888 888  888 88888888 888  888 888  Y8P  888 888    888\\n\",\n+      \"      Y88b. .d88P 888 d88P Y8b.     888  888 888   \\\"   888 Y88b  d88P\\n\",\n+      \"       \\\"Y88888P\\\"  88888P\\\"   \\\"Y8888  888  888 888       888  \\\"Y8888P\\\"\\n\",\n+      \"__________________888______________________________________________________\\n\",\n+      \"                  888\\n\",\n+      \"                  888\\n\",\n+      \"\\n\",\n+      \"      Copyright:      2011-2015 Massachusetts Institute of Technology\\n\",\n+      \"      License:        http://mit-crpg.github.io/openmc/license.html\\n\",\n+      \"      Version:        0.6.2\\n\",\n+      \"      Date/Time:      2015-08-10 06:51:18\\n\",\n+      \"      MPI Processes:  4\\n\",\n+      \"\\n\",\n+      \" ===========================================================================\\n\",\n+      \" ========================>     INITIALIZATION     <=========================\\n\",\n+      \" ===========================================================================\\n\",\n+      \"\\n\",\n+      \" Reading settings XML file...\\n\",\n+      \" Reading cross sections XML file...\\n\",\n+      \" Reading geometry XML file...\\n\",\n+      \" Reading materials XML file...\\n\",\n+      \" Reading tallies XML file...\\n\",\n+      \" Building neighboring cells lists for each surface...\\n\",\n+      \" Loading ACE cross section table: 92238.71c\\n\",\n+      \" Loading ACE cross section table: 8016.71c\\n\",\n+      \" Loading ACE cross section table: 92235.71c\\n\",\n+      \" Loading ACE cross section table: 5010.71c\\n\",\n+      \" Loading ACE cross section table: 1001.71c\\n\",\n+      \" Loading ACE cross section table: 40090.71c\\n\",\n+      \" Initializing source particles...\\n\",\n+      \"\\n\",\n+      \" ===========================================================================\\n\",\n+      \" ====================>     K EIGENVALUE SIMULATION     <====================\\n\",\n+      \" ===========================================================================\\n\",\n+      \"\\n\",\n+      \"  Bat./Gen.      k            Average k         \\n\",\n+      \"  =========   ========   ====================   \\n\",\n+      \"        1/1    1.04944                       \\n\",\n+      \"        2/1    1.03451                       \\n\",\n+      \"        3/1    1.06490                       \\n\",\n+      \"        4/1    1.04020                       \\n\",\n+      \"        5/1    1.03270                       \\n\",\n+      \"        6/1    1.09507                       \\n\",\n+      \"        7/1    1.06827    1.08167 +/- 0.01340\\n\",\n+      \"        8/1    1.06089    1.07474 +/- 0.01038\\n\",\n+      \"        9/1    1.03806    1.06557 +/- 0.01175\\n\",\n+      \"       10/1    1.05032    1.06252 +/- 0.00960\\n\",\n+      \"       11/1    1.03259    1.05753 +/- 0.00929\\n\",\n+      \"       12/1    1.02588    1.05301 +/- 0.00906\\n\",\n+      \"       13/1    1.03872    1.05123 +/- 0.00805\\n\",\n+      \"       14/1    1.05396    1.05153 +/- 0.00710\\n\",\n+      \"       15/1    1.03818    1.05019 +/- 0.00649\\n\",\n+      \"       16/1    1.05015    1.05019 +/- 0.00587\\n\",\n+      \"       17/1    1.01418    1.04719 +/- 0.00614\\n\",\n+      \"       18/1    1.07342    1.04921 +/- 0.00600\\n\",\n+      \"       19/1    1.03023    1.04785 +/- 0.00572\\n\",\n+      \"       20/1    1.05405    1.04827 +/- 0.00534\\n\",\n+      \" Creating state point statepoint.20.h5...\\n\",\n+      \"\\n\",\n+      \" ===========================================================================\\n\",\n+      \" ======================>     SIMULATION FINISHED     <======================\\n\",\n+      \" ===========================================================================\\n\",\n+      \"\\n\",\n+      \"\\n\",\n+      \" =======================>     TIMING STATISTICS     <=======================\\n\",\n+      \"\\n\",\n+      \" Total time for initialization     =  8.9900E-01 seconds\\n\",\n+      \"   Reading cross sections          =  2.5700E-01 seconds\\n\",\n+      \" Total time in simulation          =  9.5070E+00 seconds\\n\",\n+      \"   Time in transport only          =  8.6890E+00 seconds\\n\",\n+      \"   Time in inactive batches        =  1.0080E+00 seconds\\n\",\n+      \"   Time in active batches          =  8.4990E+00 seconds\\n\",\n+      \"   Time synchronizing fission bank =  7.8300E-01 seconds\\n\",\n+      \"     Sampling source sites         =  4.4000E-02 seconds\\n\",\n+      \"     SEND/RECV source sites        =  0.0000E+00 seconds\\n\",\n+      \"   Time accumulating tallies       =  3.0000E-03 seconds\\n\",\n+      \" Total time for finalization       =  2.0000E-03 seconds\\n\",\n+      \" Total time elapsed                =  1.0410E+01 seconds\\n\",\n+      \" Calculation Rate (inactive)       =  12400.8 neutrons/second\\n\",\n+      \" Calculation Rate (active)         =  4412.28 neutrons/second\\n\",\n+      \"\\n\",\n+      \" ============================>     RESULTS     <============================\\n\",\n+      \"\\n\",\n+      \" k-effective (Collision)     =  1.04399 +/-  0.00515\\n\",\n+      \" k-effective (Track-length)  =  1.04827 +/-  0.00534\\n\",\n+      \" k-effective (Absorption)    =  1.03932 +/-  0.00588\\n\",\n+      \" Combined k-effective        =  1.04364 +/-  0.00533\\n\",\n+      \" Leakage Fraction            =  0.00000 +/-  0.00000\\n\",\n+      \"\\n\"\n+     ]\n+    },\n+    {\n+     \"data\": {\n+      \"text/plain\": [\n+       \"0\"\n+      ]\n+     },\n+     \"execution_count\": 23,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Remove old HDF5 (summary, statepoint) files\\n\",\n+    \"!rm statepoint.*\\n\",\n+    \"\\n\",\n+    \"# Run OpenMC with MPI!\\n\",\n+    \"executor.run_simulation(mpi_procs=4)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"## Tally Data Processing\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Our simulation ran successfully and created a statepoint file with all the tally data in it. We begin our analysis here loading the statepoint file and 'reading' the results. By default, the tally results are not read into memory because they might be large, even large enough to exceed the available memory on a computer.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 24,\n+   \"metadata\": {\n+    \"collapsed\": false,\n+    \"scrolled\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Load the statepoint file\\n\",\n+    \"sp = StatePoint('statepoint.20.h5')\\n\",\n+    \"sp.read_results()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"You may have also noticed we instructed OpenMC to create a summary file with lots of geometry information in it. This can help to produce more sensible output from the Python API, so we will use the summary file to link against.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 25,\n+   \"metadata\": {\n+    \"collapsed\": false,\n+    \"scrolled\": true\n+   },\n+   \"outputs\": [],\n+   \"source\": [\n+    \"# Load the summary file and link with statepoint\\n\",\n+    \"su = Summary('summary.h5')\\n\",\n+    \"sp.link_with_summary(su)\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"We have a tally of the total fission rate and the total absorption rate, so we can calculating k-infinity as:\\n\",\n+    \"$$k_\\\\infty = \\\\frac{\\\\nu \\\\Sigma_f \\\\phi}{\\\\Sigma_a \\\\phi}$$\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 26,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [\n+    {\n+     \"data\": {\n+      \"text/html\": [\n+       \"<div style=\\\"max-height:1000px;max-width:1500px;overflow:auto;\\\">\\n\",\n+       \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n+       \"  <thead>\\n\",\n+       \"    <tr style=\\\"text-align: right;\\\">\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th>nuclide</th>\\n\",\n+       \"      <th>score</th>\\n\",\n+       \"      <th>mean</th>\\n\",\n+       \"      <th>std. dev.</th>\\n\",\n+       \"    </tr>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>bin</th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </thead>\\n\",\n+       \"  <tbody>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>0</th>\\n\",\n+       \"      <td>total</td>\\n\",\n+       \"      <td>(nu-fission / absorption)</td>\\n\",\n+       \"      <td>1.042035</td>\\n\",\n+       \"      <td>0.006584</td>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </tbody>\\n\",\n+       \"</table>\\n\",\n+       \"</div>\"\n+      ],\n+      \"text/plain\": [\n+       \"    nuclide                      score      mean  std. dev.\\n\",\n+       \"bin                                                        \\n\",\n+       \"0     total  (nu-fission / absorption)  1.042035   0.006584\"\n+      ]\n+     },\n+     \"execution_count\": 26,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Compute k-infinity using tally arithmetic\\n\",\n+    \"fiss_rate = sp.get_tally(name='fiss. rate')\\n\",\n+    \"abs_rate = sp.get_tally(name='abs. rate')\\n\",\n+    \"keff = fiss_rate / abs_rate\\n\",\n+    \"keff.get_pandas_dataframe()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"Notice that even though the neutron production rate and absorption rate are separate tallies, we still get a first-order estimate of the uncertainty on the quotient of them automatically!\\n\",\n+    \"\\n\",\n+    \"Now, let's analyze of few of the classic factors in the four-factor formula, starting with the resonance escape probability, which we'll define as $$p=\\\\frac{\\\\Sigma_{a,thermal}\\\\phi}{\\\\Sigma_a\\\\phi}$$\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 27,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [\n+    {\n+     \"data\": {\n+      \"text/html\": [\n+       \"<div style=\\\"max-height:1000px;max-width:1500px;overflow:auto;\\\">\\n\",\n+       \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n+       \"  <thead>\\n\",\n+       \"    <tr style=\\\"text-align: right;\\\">\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th>nuclide</th>\\n\",\n+       \"      <th>score</th>\\n\",\n+       \"      <th>mean</th>\\n\",\n+       \"      <th>std. dev.</th>\\n\",\n+       \"    </tr>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>bin</th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </thead>\\n\",\n+       \"  <tbody>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>0</th>\\n\",\n+       \"      <td>total</td>\\n\",\n+       \"      <td>absorption</td>\\n\",\n+       \"      <td>0.959067</td>\\n\",\n+       \"      <td>0.00517</td>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </tbody>\\n\",\n+       \"</table>\\n\",\n+       \"</div>\"\n+      ],\n+      \"text/plain\": [\n+       \"    nuclide       score      mean  std. dev.\\n\",\n+       \"bin                                         \\n\",\n+       \"0     total  absorption  0.959067    0.00517\"\n+      ]\n+     },\n+     \"execution_count\": 27,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Compute resonance escape probability using tally arithmetic\\n\",\n+    \"therm_abs_rate = sp.get_tally(name='therm. abs. rate')\\n\",\n+    \"res_esc = therm_abs_rate / abs_rate\\n\",\n+    \"res_esc.get_pandas_dataframe()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"The fast fission factor can be calculated as\\n\",\n+    \"$$\\\\epsilon=\\\\frac{\\\\Sigma_f\\\\phi}{\\\\Sigma_{f,thermal}\\\\phi}$$\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 28,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [\n+    {\n+     \"data\": {\n+      \"text/html\": [\n+       \"<div style=\\\"max-height:1000px;max-width:1500px;overflow:auto;\\\">\\n\",\n+       \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n+       \"  <thead>\\n\",\n+       \"    <tr style=\\\"text-align: right;\\\">\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th>nuclide</th>\\n\",\n+       \"      <th>score</th>\\n\",\n+       \"      <th>mean</th>\\n\",\n+       \"      <th>std. dev.</th>\\n\",\n+       \"    </tr>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>bin</th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </thead>\\n\",\n+       \"  <tbody>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>0</th>\\n\",\n+       \"      <td>total</td>\\n\",\n+       \"      <td>fission</td>\\n\",\n+       \"      <td>1.080124</td>\\n\",\n+       \"      <td>0.008126</td>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </tbody>\\n\",\n+       \"</table>\\n\",\n+       \"</div>\"\n+      ],\n+      \"text/plain\": [\n+       \"    nuclide    score      mean  std. dev.\\n\",\n+       \"bin                                      \\n\",\n+       \"0     total  fission  1.080124   0.008126\"\n+      ]\n+     },\n+     \"execution_count\": 28,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Compute fast fission factor factor using tally arithmetic\\n\",\n+    \"therm_fiss_rate = sp.get_tally(name='therm. fiss. rate')\\n\",\n+    \"tot_fiss_rate = sp.get_tally(name='tot. fiss. rate')\\n\",\n+    \"fast_fiss = tot_fiss_rate / therm_fiss_rate\\n\",\n+    \"fast_fiss.get_pandas_dataframe()\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"markdown\",\n+   \"metadata\": {},\n+   \"source\": [\n+    \"The thermal flux utilization is calculated as\\n\",\n+    \"$$f=\\\\frac{\\\\Sigma_{a,thermal}^F\\\\phi}{\\\\Sigma_a\\\\phi}$$\\n\",\n+    \"where $F$ denotes fuel.\"\n+   ]\n+  },\n+  {\n+   \"cell_type\": \"code\",\n+   \"execution_count\": 29,\n+   \"metadata\": {\n+    \"collapsed\": false\n+   },\n+   \"outputs\": [\n+    {\n+     \"data\": {\n+      \"text/html\": [\n+       \"<div style=\\\"max-height:1000px;max-width:1500px;overflow:auto;\\\">\\n\",\n+       \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n+       \"  <thead>\\n\",\n+       \"    <tr style=\\\"text-align: right;\\\">\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th>nuclide</th>\\n\",\n+       \"      <th>score</th>\\n\",\n+       \"      <th>mean</th>\\n\",\n+       \"      <th>std. dev.</th>\\n\",\n+       \"    </tr>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>bin</th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"      <th></th>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </thead>\\n\",\n+       \"  <tbody>\\n\",\n+       \"    <tr>\\n\",\n+       \"      <th>0</th>\\n\",\n+       \"      <td>total</td>\\n\",\n+       \"      <td>absorption</td>\\n\",\n+       \"      <td>0.769263</td>\\n\",\n+       \"      <td>0.004172</td>\\n\",\n+       \"    </tr>\\n\",\n+       \"  </tbody>\\n\",\n+       \"</table>\\n\",\n+       \"</div>\"\n+      ],\n+      \"text/plain\": [\n+       \"    nuclide       score      mean  std. dev.\\n\",\n+       \"bin                                         \\n\",\n+       \"0     total  absorption  0.769263   0.004172\"\n+      ]\n+     },\n+     \"execution_count\": 29,\n+     \"metadata\": {},\n+     \"output_type\": \"execute_result\"\n+    }\n+   ],\n+   \"source\": [\n+    \"# Compute thermal flux utilization factor using tally arithmetic\\n\",\n+    \"fuel_therm_abs_rate = sp.get_tally(name='fuel therm. abs. rate')\\n\",\n+    \"therm_util = fuel_therm_abs_rate / abs_rate\\n\",","path":"docs/source/pythonapi/examples/tally-arithmetic.ipynb","position":988,"original_position":988,"commit_id":"20d915809af47949dcaae515578e0fa35e8934ae","original_commit_id":"20d915809af47949dcaae515578e0fa35e8934ae","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":"I knew something looked wrong as I was writing the equations!","created_at":"2015-08-10T06:22:28Z","updated_at":"2015-08-10T06:22:28Z","html_url":"https://github.com/mit-crpg/openmc/pull/434#discussion_r36604443","pull_request_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/434","_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/comments/36604443"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/434#discussion_r36604443"},"pull_request":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/434"}}},"pull_request":{"url":"https://api.github.com/repos/mit-crpg/openmc/pulls/434","id":41979871,"html_url":"https://github.com/mit-crpg/openmc/pull/434","diff_url":"https://github.com/mit-crpg/openmc/pull/434.diff","patch_url":"https://github.com/mit-crpg/openmc/pull/434.patch","issue_url":"https://api.github.com/repos/mit-crpg/openmc/issues/434","number":434,"state":"open","locked":false,"title":"Jupyter notebook Python API examples in documentation","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":"This pull request adds two examples of Python API use in the documentation via Jupyter notebooks. Both are just minor tweaks of the notebooks that @wbinventor showed in #426 and #393. To include them in the Sphinx documentation, I used a combination of the notebook_sphinxext extension included in PyNE and yt. Both are BSD licensed, so there are no issues including that code.\r\n\r\nAlso note that in order to get the notebooks to work, I had to fix a bug in universe.py that was introduced by #425 when Lattice._outer is None.","created_at":"2015-08-10T00:10:41Z","updated_at":"2015-08-10T06:22:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4221f7f7b14744355e15074ab6e329cdbd677722","assignee":{"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},"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":2,"closed_issues":32,"state":"open","created_at":"2014-08-28T15:56:37Z","updated_at":"2015-08-10T00:10:41Z","due_on":"2015-08-30T17:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/434/commits","review_comments_url":"https://api.github.com/repos/mit-crpg/openmc/pulls/434/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/434/comments","statuses_url":"https://api.github.com/repos/mit-crpg/openmc/statuses/20d915809af47949dcaae515578e0fa35e8934ae","head":{"label":"paulromano:python-api-notebooks","ref":"python-api-notebooks","sha":"20d915809af47949dcaae515578e0fa35e8934ae","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},"repo":{"id":6039026,"name":"openmc","full_name":"paulromano/openmc","owner":{"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},"private":false,"html_url":"https://github.com/paulromano/openmc","description":"OpenMC Monte Carlo Code","fork":true,"url":"https://api.github.com/repos/paulromano/openmc","forks_url":"https://api.github.com/repos/paulromano/openmc/forks","keys_url":"https://api.github.com/repos/paulromano/openmc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulromano/openmc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulromano/openmc/teams","hooks_url":"https://api.github.com/repos/paulromano/openmc/hooks","issue_events_url":"https://api.github.com/repos/paulromano/openmc/issues/events{/number}","events_url":"https://api.github.com/repos/paulromano/openmc/events","assignees_url":"https://api.github.com/repos/paulromano/openmc/assignees{/user}","branches_url":"https://api.github.com/repos/paulromano/openmc/branches{/branch}","tags_url":"https://api.github.com/repos/paulromano/openmc/tags","blobs_url":"https://api.github.com/repos/paulromano/openmc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulromano/openmc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulromano/openmc/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulromano/openmc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulromano/openmc/statuses/{sha}","languages_url":"https://api.github.com/repos/paulromano/openmc/languages","stargazers_url":"https://api.github.com/repos/paulromano/openmc/stargazers","contributors_url":"https://api.github.com/repos/paulromano/openmc/contributors","subscribers_url":"https://api.github.com/repos/paulromano/openmc/subscribers","subscription_url":"https://api.github.com/repos/paulromano/openmc/subscription","commits_url":"https://api.github.com/repos/paulromano/openmc/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulromano/openmc/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulromano/openmc/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulromano/openmc/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulromano/openmc/contents/{+path}","compare_url":"https://api.github.com/repos/paulromano/openmc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulromano/openmc/merges","archive_url":"https://api.github.com/repos/paulromano/openmc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulromano/openmc/downloads","issues_url":"https://api.github.com/repos/paulromano/openmc/issues{/number}","pulls_url":"https://api.github.com/repos/paulromano/openmc/pulls{/number}","milestones_url":"https://api.github.com/repos/paulromano/openmc/milestones{/number}","notifications_url":"https://api.github.com/repos/paulromano/openmc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulromano/openmc/labels{/name}","releases_url":"https://api.github.com/repos/paulromano/openmc/releases{/id}","created_at":"2012-10-02T01:55:56Z","updated_at":"2015-04-25T14:43:09Z","pushed_at":"2015-08-09T23:55:58Z","git_url":"git://github.com/paulromano/openmc.git","ssh_url":"git@github.com:paulromano/openmc.git","clone_url":"https://github.com/paulromano/openmc.git","svn_url":"https://github.com/paulromano/openmc","homepage":"","size":18570,"stargazers_count":2,"watchers_count":2,"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":2,"default_branch":"master"}},"base":{"label":"mit-crpg:develop","ref":"develop","sha":"c982eb72ba4bc562c66fe4b8fd146ca6258460e2","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-10T00:10:42Z","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":38,"forks":75,"open_issues":38,"watchers":57,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/434"},"html":{"href":"https://github.com/mit-crpg/openmc/pull/434"},"issue":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/434"},"comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/issues/434/comments"},"review_comments":{"href":"https://api.github.com/repos/mit-crpg/openmc/pulls/434/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/434/commits"},"statuses":{"href":"https://api.github.com/repos/mit-crpg/openmc/statuses/20d915809af47949dcaae515578e0fa35e8934ae"}}}}