Address comments on #985

This commit is contained in:
Paul Romano 2018-03-19 13:58:58 -05:00
parent 5dc25569f2
commit 85af75c459
2 changed files with 10 additions and 3 deletions

View file

@ -753,7 +753,7 @@ class MeshFilter(Filter):
if n_dim == 3:
# Construct 3-tuple of x,y,z cell indices for a 3D mesh
nx, ny, nz = self.mesh.dimension
x = bin_index % nx + 1
x = (bin_index % nx) + 1
y = (bin_index % (nx * ny)) // nx + 1
z = bin_index // (nx * ny) + 1
return (x, y, z)
@ -761,7 +761,7 @@ class MeshFilter(Filter):
elif n_dim == 2:
# Construct 2-tuple of x,y cell indices for a 2D mesh
nx, ny = self.mesh.dimension
x = bin_index % nx + 1
x = (bin_index % nx) + 1
y = bin_index // nx + 1
return (x, y)
else:

View file

@ -651,9 +651,16 @@ class Plot(IDManagerMixin):
return element
def to_image(self, openmc_exec='openmc', cwd='.', convert_exec='convert'):
def to_ipython_image(self, openmc_exec='openmc', cwd='.',
convert_exec='convert'):
"""Render plot as an image
This method runs OpenMC in plotting mode to produce a bitmap image which
is then converted to a .png file and loaded in as an
:class:`IPython.display.Image` object. As such, it requires that your
model geometry, materials, and settings have already been exported to
XML.
Parameters
----------
openmc_exec : str