Cleaned up docstring comments in filter.py and cross.py

This commit is contained in:
Will Boyd 2015-10-03 00:04:01 -04:00
parent 3e0c960648
commit 67971b5c60
8 changed files with 551 additions and 660 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -342,7 +342,18 @@
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"0"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Run openmc in plotting mode\n",
"executor = openmc.Executor()\n",
@ -358,7 +369,7 @@
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX///9yEhLpgJFNv8Tq\nQYT7AAAAAWJLR0QAiAUdSAAAAAd0SU1FB98JFQMZGiFPL70AAALKSURBVGje7dpLcqQwDAbgHHE2\nYeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmNP+HDhw8fPnz48Kf6VH9G\n+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4zPji99z0/AJ4n1lfvJ6f\nnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6pA0wfln+ho/fwgYYn19C\n/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tNDbSGz7T0SBEWw4vLXzbQ\n6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X58wZaxWd1+fMGiuFvir8b\nvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV873hB8UnM3xzANtf8nb4\ndwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7T/ppARBvp48UwJnelT5S\nACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4//Jve+fhsH6Ctv7n8PTzj\nvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V32/o9+fl389Xnx+g5x/o\n+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6/4Le/6D3T/D9V67Y/ZsV\nQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/gPs/0P4TtP8F7r9J3AIO\n9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTuf4X7b+H+X7T/+BPuf3aM\n8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMDktMjFUMTA6MDg6\nNTcrMDc6MDALr51VAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA5LTIxVDEwOjA4OjU3KzA3OjAw\nevIl6QAAAABJRU5ErkJggg==\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\nMTUtMTAtMDJUMjM6NDg6NTQtMDQ6MDDJCXMCAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTAy\nVDIzOjQ4OjU0LTA0OjAwuFTLvgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
@ -387,13 +398,12 @@
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": true
"collapsed": false
},
"outputs": [],
"source": [
"# Instantiate an empty TalliesFile\n",
"tallies_file = openmc.TalliesFile()\n",
"tallies_file.tallies = []"
"tallies_file = openmc.TalliesFile()"
]
},
{
@ -569,8 +579,9 @@
" Copyright: 2011-2015 Massachusetts Institute of Technology\n",
" License: http://mit-crpg.github.io/openmc/license.html\n",
" Version: 0.7.0\n",
" Git SHA1: b167d70c877c516deca785801b9fa6f53fb0985b\n",
" Date/Time: 2015-09-21 10:25:26\n",
" Git SHA1: e0c2aace2e73367536fa03e153b67a2d038cd2b3\n",
" Date/Time: 2015-10-02 23:48:55\n",
" MPI Processes: 1\n",
"\n",
" ===========================================================================\n",
" ========================> INITIALIZATION <=========================\n",
@ -625,20 +636,20 @@
"\n",
" =======================> TIMING STATISTICS <=======================\n",
"\n",
" Total time for initialization = 9.1800E-01 seconds\n",
" Reading cross sections = 6.5800E-01 seconds\n",
" Total time in simulation = 1.7037E+01 seconds\n",
" Time in transport only = 1.7024E+01 seconds\n",
" Time in inactive batches = 2.8600E+00 seconds\n",
" Time in active batches = 1.4177E+01 seconds\n",
" Time synchronizing fission bank = 4.0000E-03 seconds\n",
" Sampling source sites = 4.0000E-03 seconds\n",
" Total time for initialization = 5.7300E-01 seconds\n",
" Reading cross sections = 1.2700E-01 seconds\n",
" Total time in simulation = 2.1409E+01 seconds\n",
" Time in transport only = 2.1383E+01 seconds\n",
" Time in inactive batches = 2.7630E+00 seconds\n",
" Time in active batches = 1.8646E+01 seconds\n",
" Time synchronizing fission bank = 2.0000E-03 seconds\n",
" Sampling source sites = 2.0000E-03 seconds\n",
" SEND/RECV source sites = 0.0000E+00 seconds\n",
" Time accumulating tallies = 0.0000E+00 seconds\n",
" Total time for finalization = 1.0000E-03 seconds\n",
" Total time elapsed = 1.7971E+01 seconds\n",
" Calculation Rate (inactive) = 4370.63 neutrons/second\n",
" Calculation Rate (active) = 2645.13 neutrons/second\n",
" Total time elapsed = 2.1994E+01 seconds\n",
" Calculation Rate (inactive) = 4524.07 neutrons/second\n",
" Calculation Rate (active) = 2011.16 neutrons/second\n",
"\n",
" ============================> RESULTS <============================\n",
"\n",
@ -746,13 +757,6 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
@ -767,9 +771,8 @@
"</div>"
],
"text/plain": [
" nuclide score mean std. dev.\n",
"bin \n",
"0 total (nu-fission / absorption) 1.046353 0.00935"
" nuclide score mean std. dev.\n",
"0 total (nu-fission / absorption) 1.046353 0.00935"
]
},
"execution_count": 26,
@ -809,22 +812,17 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>energy [MeV]</th>\n",
" <th>nuclide</th>\n",
" <th>score</th>\n",
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(0.0e+00 - 6.2e-01)</td>\n",
" <td>total</td>\n",
" <td>absorption</td>\n",
" <td>0.95873</td>\n",
@ -835,9 +833,8 @@
"</div>"
],
"text/plain": [
" nuclide score mean std. dev.\n",
"bin \n",
"0 total absorption 0.95873 0.00774"
" energy [MeV] nuclide score mean std. dev.\n",
"0 (0.0e+00 - 6.2e-01) total absorption 0.95873 0.00774"
]
},
"execution_count": 27,
@ -880,13 +877,6 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
@ -901,9 +891,8 @@
"</div>"
],
"text/plain": [
" nuclide score mean std. dev.\n",
"bin \n",
"0 total nu-fission 1.091622 0.011163"
" nuclide score mean std. dev.\n",
"0 total nu-fission 1.091622 0.011163"
]
},
"execution_count": 28,
@ -949,20 +938,11 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.0e+00 - 6.2e-01</td>\n",
" <td>(0.0e+00 - 6.2e-01)</td>\n",
" <td>10000</td>\n",
" <td>total</td>\n",
" <td>absorption</td>\n",
@ -975,8 +955,7 @@
],
"text/plain": [
" energy [MeV] cell nuclide score mean std. dev.\n",
"bin \n",
"0 0.0e+00 - 6.2e-01 10000 total absorption 0.802012 0.006609"
"0 (0.0e+00 - 6.2e-01) 10000 total absorption 0.802012 0.006609"
]
},
"execution_count": 29,
@ -1014,27 +993,16 @@
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>energy [MeV]</th>\n",
" <th>cell</th>\n",
" <th>nuclide</th>\n",
" <th>score</th>\n",
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.0e+00 - 6.2e-01</td>\n",
" <td>10000</td>\n",
" <td>(0.0e+00 - 6.2e-01)</td>\n",
" <td>total</td>\n",
" <td>(nu-fission / absorption)</td>\n",
" <td>1.246604</td>\n",
@ -1045,13 +1013,8 @@
"</div>"
],
"text/plain": [
" energy [MeV] cell nuclide score mean \\\n",
"bin \n",
"0 0.0e+00 - 6.2e-01 10000 total (nu-fission / absorption) 1.246604 \n",
"\n",
" std. dev. \n",
"bin \n",
"0 0.011825 "
" energy [MeV] nuclide score mean std. dev.\n",
"0 (0.0e+00 - 6.2e-01) total (nu-fission / absorption) 1.246604 0.011825"
]
},
"execution_count": 30,
@ -1087,22 +1050,17 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>energy [MeV]</th>\n",
" <th>nuclide</th>\n",
" <th>score</th>\n",
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(0.0e+00 - 6.2e-01)</td>\n",
" <td>total</td>\n",
" <td>(((absorption * nu-fission) * absorption) * (n...</td>\n",
" <td>1.046353</td>\n",
@ -1113,13 +1071,11 @@
"</div>"
],
"text/plain": [
" nuclide score mean \\\n",
"bin \n",
"0 total (((absorption * nu-fission) * absorption) * (n... 1.046353 \n",
" energy [MeV] nuclide \\\n",
"0 (0.0e+00 - 6.2e-01) total \n",
"\n",
" std. dev. \n",
"bin \n",
"0 0.01894 "
" score mean std. dev. \n",
"0 (((absorption * nu-fission) * absorption) * (n... 1.046353 0.01894 "
]
},
"execution_count": 31,
@ -1179,87 +1135,78 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>(U-238 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>0.000001</td>\n",
" <td>6.641746e-07</td>\n",
" <td>6.859257e-09</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>(U-238 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>0.209986</td>\n",
" <td>2.099861e-01</td>\n",
" <td>1.966887e-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>(U-235 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>0.355667</td>\n",
" <td>3.556665e-01</td>\n",
" <td>3.717881e-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>(U-235 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>0.005555</td>\n",
" <td>5.554650e-03</td>\n",
" <td>5.218094e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>(U-238 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>0.007165</td>\n",
" <td>7.165057e-03</td>\n",
" <td>5.625590e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>(U-238 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>0.227653</td>\n",
" <td>2.276535e-01</td>\n",
" <td>8.544314e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>(U-235 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>0.008089</td>\n",
" <td>8.089493e-03</td>\n",
" <td>5.080374e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>(U-235 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>0.003370</td>\n",
" <td>3.370111e-03</td>\n",
" <td>1.361116e-05</td>\n",
" </tr>\n",
" </tbody>\n",
@ -1267,27 +1214,25 @@
"</div>"
],
"text/plain": [
" cell energy [MeV] nuclide score mean \\\n",
"bin \n",
"0 10000 0.0e+00 - 6.3e-07 (U-238 / total) (nu-fission / flux) 0.000001 \n",
"1 10000 0.0e+00 - 6.3e-07 (U-238 / total) (scatter / flux) 0.209986 \n",
"2 10000 0.0e+00 - 6.3e-07 (U-235 / total) (nu-fission / flux) 0.355667 \n",
"3 10000 0.0e+00 - 6.3e-07 (U-235 / total) (scatter / flux) 0.005555 \n",
"4 10000 6.3e-07 - 2.0e+01 (U-238 / total) (nu-fission / flux) 0.007165 \n",
"5 10000 6.3e-07 - 2.0e+01 (U-238 / total) (scatter / flux) 0.227653 \n",
"6 10000 6.3e-07 - 2.0e+01 (U-235 / total) (nu-fission / flux) 0.008089 \n",
"7 10000 6.3e-07 - 2.0e+01 (U-235 / total) (scatter / flux) 0.003370 \n",
" cell energy [MeV] nuclide score \\\n",
"0 10000 (0.0e+00 - 6.3e-07) (U-238 / total) (nu-fission / flux) \n",
"1 10000 (0.0e+00 - 6.3e-07) (U-238 / total) (scatter / flux) \n",
"2 10000 (0.0e+00 - 6.3e-07) (U-235 / total) (nu-fission / flux) \n",
"3 10000 (0.0e+00 - 6.3e-07) (U-235 / total) (scatter / flux) \n",
"4 10000 (6.3e-07 - 2.0e+01) (U-238 / total) (nu-fission / flux) \n",
"5 10000 (6.3e-07 - 2.0e+01) (U-238 / total) (scatter / flux) \n",
"6 10000 (6.3e-07 - 2.0e+01) (U-235 / total) (nu-fission / flux) \n",
"7 10000 (6.3e-07 - 2.0e+01) (U-235 / total) (scatter / flux) \n",
"\n",
" std. dev. \n",
"bin \n",
"0 6.859257e-09 \n",
"1 1.966887e-03 \n",
"2 3.717881e-03 \n",
"3 5.218094e-05 \n",
"4 5.625590e-05 \n",
"5 8.544314e-04 \n",
"6 5.080374e-05 \n",
"7 1.361116e-05 "
" mean std. dev. \n",
"0 6.641746e-07 6.859257e-09 \n",
"1 2.099861e-01 1.966887e-03 \n",
"2 3.556665e-01 3.717881e-03 \n",
"3 5.554650e-03 5.218094e-05 \n",
"4 7.165057e-03 5.625590e-05 \n",
"5 2.276535e-01 8.544314e-04 \n",
"6 8.089493e-03 5.080374e-05 \n",
"7 3.370111e-03 1.361116e-05 "
]
},
"execution_count": 33,
@ -1416,21 +1361,12 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>U-238</td>\n",
" <td>nu-fission</td>\n",
" <td>0.000002</td>\n",
@ -1439,7 +1375,7 @@
" <tr>\n",
" <th>1</th>\n",
" <td>10000</td>\n",
" <td>0.0e+00 - 6.3e-07</td>\n",
" <td>(0.0e+00 - 6.3e-07)</td>\n",
" <td>U-235</td>\n",
" <td>nu-fission</td>\n",
" <td>0.867982</td>\n",
@ -1448,7 +1384,7 @@
" <tr>\n",
" <th>2</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>U-238</td>\n",
" <td>nu-fission</td>\n",
" <td>0.082801</td>\n",
@ -1457,7 +1393,7 @@
" <tr>\n",
" <th>3</th>\n",
" <td>10000</td>\n",
" <td>6.3e-07 - 2.0e+01</td>\n",
" <td>(6.3e-07 - 2.0e+01)</td>\n",
" <td>U-235</td>\n",
" <td>nu-fission</td>\n",
" <td>0.093484</td>\n",
@ -1468,12 +1404,11 @@
"</div>"
],
"text/plain": [
" cell energy [MeV] nuclide score mean std. dev.\n",
"bin \n",
"0 10000 0.0e+00 - 6.3e-07 U-238 nu-fission 0.000002 1.284890e-08\n",
"1 10000 0.0e+00 - 6.3e-07 U-235 nu-fission 0.867982 7.022256e-03\n",
"2 10000 6.3e-07 - 2.0e+01 U-238 nu-fission 0.082801 6.087096e-04\n",
"3 10000 6.3e-07 - 2.0e+01 U-235 nu-fission 0.093484 5.275039e-04"
" cell energy [MeV] nuclide score mean std. dev.\n",
"0 10000 (0.0e+00 - 6.3e-07) U-238 nu-fission 0.000002 1.284890e-08\n",
"1 10000 (0.0e+00 - 6.3e-07) U-235 nu-fission 0.867982 7.022256e-03\n",
"2 10000 (6.3e-07 - 2.0e+01) U-238 nu-fission 0.082801 6.087096e-04\n",
"3 10000 (6.3e-07 - 2.0e+01) U-235 nu-fission 0.093484 5.275039e-04"
]
},
"execution_count": 37,
@ -1509,21 +1444,12 @@
" <th>mean</th>\n",
" <th>std. dev.</th>\n",
" </tr>\n",
" <tr>\n",
" <th>bin</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>10002</td>\n",
" <td>1.0e-08 - 1.1e-07</td>\n",
" <td>(1.0e-08 - 1.1e-07)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>4.620525</td>\n",
@ -1532,7 +1458,7 @@
" <tr>\n",
" <th>1</th>\n",
" <td>10002</td>\n",
" <td>1.1e-07 - 1.2e-06</td>\n",
" <td>(1.1e-07 - 1.2e-06)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>2.036841</td>\n",
@ -1541,7 +1467,7 @@
" <tr>\n",
" <th>2</th>\n",
" <td>10002</td>\n",
" <td>1.2e-06 - 1.3e-05</td>\n",
" <td>(1.2e-06 - 1.3e-05)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>1.659916</td>\n",
@ -1550,7 +1476,7 @@
" <tr>\n",
" <th>3</th>\n",
" <td>10002</td>\n",
" <td>1.3e-05 - 1.4e-04</td>\n",
" <td>(1.3e-05 - 1.4e-04)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>1.861546</td>\n",
@ -1559,7 +1485,7 @@
" <tr>\n",
" <th>4</th>\n",
" <td>10002</td>\n",
" <td>1.4e-04 - 1.5e-03</td>\n",
" <td>(1.4e-04 - 1.5e-03)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>2.049664</td>\n",
@ -1568,7 +1494,7 @@
" <tr>\n",
" <th>5</th>\n",
" <td>10002</td>\n",
" <td>1.5e-03 - 1.6e-02</td>\n",
" <td>(1.5e-03 - 1.6e-02)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>2.162157</td>\n",
@ -1577,7 +1503,7 @@
" <tr>\n",
" <th>6</th>\n",
" <td>10002</td>\n",
" <td>1.6e-02 - 1.7e-01</td>\n",
" <td>(1.6e-02 - 1.7e-01)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>2.224496</td>\n",
@ -1586,7 +1512,7 @@
" <tr>\n",
" <th>7</th>\n",
" <td>10002</td>\n",
" <td>1.7e-01 - 1.9e+00</td>\n",
" <td>(1.7e-01 - 1.9e+00)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>1.997585</td>\n",
@ -1595,7 +1521,7 @@
" <tr>\n",
" <th>8</th>\n",
" <td>10002</td>\n",
" <td>1.9e+00 - 2.0e+01</td>\n",
" <td>(1.9e+00 - 2.0e+01)</td>\n",
" <td>H-1</td>\n",
" <td>scatter</td>\n",
" <td>0.373472</td>\n",
@ -1606,17 +1532,16 @@
"</div>"
],
"text/plain": [
" cell energy [MeV] nuclide score mean std. dev.\n",
"bin \n",
"0 10002 1.0e-08 - 1.1e-07 H-1 scatter 4.620525 0.038249\n",
"1 10002 1.1e-07 - 1.2e-06 H-1 scatter 2.036841 0.013203\n",
"2 10002 1.2e-06 - 1.3e-05 H-1 scatter 1.659916 0.010107\n",
"3 10002 1.3e-05 - 1.4e-04 H-1 scatter 1.861546 0.013328\n",
"4 10002 1.4e-04 - 1.5e-03 H-1 scatter 2.049664 0.008215\n",
"5 10002 1.5e-03 - 1.6e-02 H-1 scatter 2.162157 0.010245\n",
"6 10002 1.6e-02 - 1.7e-01 H-1 scatter 2.224496 0.013796\n",
"7 10002 1.7e-01 - 1.9e+00 H-1 scatter 1.997585 0.009161\n",
"8 10002 1.9e+00 - 2.0e+01 H-1 scatter 0.373472 0.003922"
" cell energy [MeV] nuclide score mean std. dev.\n",
"0 10002 (1.0e-08 - 1.1e-07) H-1 scatter 4.620525 0.038249\n",
"1 10002 (1.1e-07 - 1.2e-06) H-1 scatter 2.036841 0.013203\n",
"2 10002 (1.2e-06 - 1.3e-05) H-1 scatter 1.659916 0.010107\n",
"3 10002 (1.3e-05 - 1.4e-04) H-1 scatter 1.861546 0.013328\n",
"4 10002 (1.4e-04 - 1.5e-03) H-1 scatter 2.049664 0.008215\n",
"5 10002 (1.5e-03 - 1.6e-02) H-1 scatter 2.162157 0.010245\n",
"6 10002 (1.6e-02 - 1.7e-01) H-1 scatter 2.224496 0.013796\n",
"7 10002 (1.7e-01 - 1.9e+00) H-1 scatter 1.997585 0.009161\n",
"8 10002 (1.9e+00 - 2.0e+01) H-1 scatter 0.373472 0.003922"
]
},
"execution_count": 38,
@ -1649,7 +1574,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
"version": "2.7.6"
}
},
"nbformat": 4,

View file

@ -14,7 +14,7 @@ TALLY_ARITHMETIC_OPS = ['+', '-', '*', '/', '^']
class CrossScore(object):
"""A special-purpose tally score used to encapsulate all combinations of two
tally's scores as a outer product for tally arithmetic.
tally's scores as an outer product for tally arithmetic.
Parameters
----------
@ -270,7 +270,6 @@ class CrossFilter(object):
self._left_filter = None
self._right_filter = None
self._binary_op = None
self._num_bins = 0
if left_filter is not None:
self.left_filter = left_filter
@ -281,9 +280,6 @@ class CrossFilter(object):
if binary_op is not None:
self.binary_op = binary_op
if self.left_filter is not None and self.right_filter is not None:
self._num_bins = left_filter.num_bins * right_filter.num_bins
def __hash__(self):
return hash((self.left_filter, self.right_filter))
@ -337,7 +333,10 @@ class CrossFilter(object):
@property
def num_bins(self):
return self._num_bins
if self.left_filter is not None and self.right_filter is not None:
return self.left_filter.num_bins * self.right_filter.num_bins
else:
return 0
@property
def stride(self):
@ -356,11 +355,13 @@ class CrossFilter(object):
def left_filter(self, left_filter):
cv.check_type('left_filter', left_filter, (Filter, CrossFilter))
self._left_filter = left_filter
self._bins['left'] = left_filter.bins
@right_filter.setter
def right_filter(self, right_filter):
cv.check_type('right_filter', right_filter, (Filter, CrossFilter))
self._right_filter = right_filter
self._bins['right'] = right_filter.bins
@binary_op.setter
def binary_op(self, binary_op):

View file

@ -35,7 +35,7 @@ class Filter(object):
----------
type : str
The type of the tally filter.
bins : Integral or Iterable of Integral or Iterable of float
bins : Integral or Iterable of Integral or Iterable of Real
The bins for the filter
num_bins : Integral
The number of filter bins
@ -325,8 +325,8 @@ class Filter(object):
elif self.type in ['energy', 'energyout']:
return np.all(self.bins == other.bins)
for bin in self.bins:
if bin not in other.bins:
for bin in other.bins:
if bin not in self.bins:
return False
return True
@ -404,7 +404,7 @@ class Filter(object):
The zero-based index into the filter's array of bins. The bin
index for 'material', 'surface', 'cell', 'cellborn', and 'universe'
filters corresponds to the ID in the filter's list of bins. For
'distribcell' tallies the bin_index necessarily can only be zero
'distribcell' tallies the bin index necessarily can only be zero
since only one cell can be tracked per tally. The bin index for
'energy' and 'energyout' filters corresponds to the energy range of
interest in the filter bins of energies. The bin index for 'mesh'
@ -434,22 +434,28 @@ class Filter(object):
if self.type == 'mesh':
# Construct 3-tuple of x,y,z cell indices for a 3D mesh
if (len(self.mesh.dimension) == 3):
nx, ny, nz = self.mesh.dimension
x = bin_index / (ny * nz)
y = (bin_index - (x * ny * nz)) / nz
z = bin_index - (x * ny * nz) - (y * nz)
filter_bin = (x, y, z)
# Construct 2-tuple of x,y cell indices for a 2D mesh
else:
nx, ny = self.mesh.dimension
x = bin_index / ny
y = bin_index - (x * ny)
filter_bin = (x, y)
# Construct 2-tuple of lower, upper energies for energy(out) filters
elif self.type in ['energy', 'energyout']:
filter_bin = (self.bins[bin_index], self.bins[bin_index+1])
# Construct 1-tuple of with the cell ID for distribcell filters
elif self.type == 'distribcell':
filter_bin = (self.bins[0],)
# Construct 1-tuple with domain ID (e.g., material) for other filters
else:
filter_bin = (self.bins[bin_index],)
@ -586,8 +592,8 @@ class Filter(object):
openmc_geometry = summary.openmc_geometry
# Use OpenCG to compute the number of regions
opencg_geometry.initializeCellOffsets()
num_regions = opencg_geometry._num_regions
opencg_geometry.initialize_cell_offsets()
num_regions = opencg_geometry.num_regions
# Initialize a dictionary mapping OpenMC distribcell
# offsets to OpenCG LocalCoords linked lists
@ -596,7 +602,7 @@ class Filter(object):
# Use OpenCG to compute LocalCoords linked list for
# each region and store in dictionary
for region in range(num_regions):
coords = opencg_geometry.findRegion(region)
coords = opencg_geometry.find_region(region)
path = opencg.get_path(coords)
cell_id = path[-1]

View file

@ -151,7 +151,7 @@ class Mesh(object):
@name.setter
def name(self, name):
if name is not None:
check_type('name for mesh ID="{0}"'.format(self._id),
cv.check_type('name for mesh ID="{0}"'.format(self._id),
name, basestring)
self._name = name
else:

View file

@ -24,7 +24,7 @@ class EnergyGroups(object):
Attributes
----------
group_edges : NumPy array
group_edges : ndarray
The energy group boundaries [MeV]
num_groups : Integral
The number of energy groups
@ -57,6 +57,20 @@ class EnergyGroups(object):
else:
return existing
def __eq__(self, other):
if not isinstance(other, EnergyGroups):
return False
elif self.group_edges != other.group_edges:
return False
else:
return True
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash(tuple(self.group_edges))
@property
def group_edges(self):
return self._group_edges
@ -72,20 +86,6 @@ class EnergyGroups(object):
self._group_edges = np.array(edges)
self._num_groups = len(edges)-1
def __eq__(self, other):
if not isinstance(other, EnergyGroups):
return False
elif self.group_edges != other.group_edges:
return False
else:
return True
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash(tuple(self.group_edges))
def generate_bin_edges(self, start, stop, num_groups, spacing='linear'):
"""Generate equally or logarithmically-spaced energy group boundaries.
@ -97,8 +97,8 @@ class EnergyGroups(object):
The highest energy in MeV
num_groups : Integral
The number of energy groups
spacing : str
The spacing between groups ('linear' or 'logarithmic')
spacing : {'linear', 'logarithmic'}
The spacing between groups
"""
@ -107,15 +107,15 @@ class EnergyGroups(object):
cv.check_type('number of groups', num_groups, Integral)
cv.check_type('spacing', spacing, basestring)
cv.check_greater_than('first edge', start, 0, True)
cv.check_greater_than('first edge', stop, start, False)
cv.check_greater_than('last edge', stop, start, False)
cv.check_greater_than('number of groups', num_groups, 0)
cv.check_value('spacing', spacing, ('linear', 'logarithmic'))
if spacing == 'linear':
self.group_edges = np.linspace(start, stop, num_groups+1)
self.group_edges = np.linspace(start, stop, num_groups + 1)
elif spacing == 'logarithmic':
self.group_edges = \
np.logspace(np.log10(start), np.log10(stop), num_groups+1)
np.logspace(np.log10(start), np.log10(stop), num_groups + 1)
self._num_groups = num_groups
@ -189,7 +189,7 @@ class EnergyGroups(object):
Returns
-------
ndarray
The NumPy array indices for each energy group of interest
The ndarray array indices for each energy group of interest
Raises
------

View file

@ -544,7 +544,7 @@ class StatePoint(object):
contains_filters = False
for test_filter in test_tally.filters:
if filter.is_subset(test_filter):
if test_filter.is_subset(filter):
contains_filters = True
break