Skip to content

Commit 8825405

Browse files
committed
make cell_ids, instances, and mat_ids properties
1 parent 90bf435 commit 8825405

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

openmc_plotter/plotmodel.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ def __init__(self, use_settings_pkl):
124124

125125
# Cell/Material ID by coordinates
126126
self.ids = None
127-
self.instances = None
128127

129128
# Return values from id_map and property_map
130129
self.ids_map = None
@@ -282,10 +281,6 @@ def makePlot(self):
282281
self.ids_map = openmc.lib.id_map(cv.view_params)
283282
self.properties = openmc.lib.property_map(cv.view_params)
284283

285-
self.cell_ids = self.ids_map[:, :, 0]
286-
self.instances = self.ids_map[:, :, 1]
287-
self.mat_ids = self.ids_map[:, :, 2]
288-
289284
# set model ids based on domain
290285
if cv.colorby == 'cell':
291286
self.ids = self.cell_ids
@@ -732,6 +727,19 @@ def _do_op(array, tally_value, ax=0):
732727

733728
return image_data, extents, data_min, data_max
734729

730+
@property
731+
def cell_ids(self):
732+
return self.ids_map[:, :, 0]
733+
734+
@property
735+
def instances(self):
736+
return self.ids_map[:, :, 1]
737+
738+
@property
739+
def mat_ids(self):
740+
return self.ids_map[:, :, 2]
741+
742+
735743
class ViewParam(openmc.lib.plot._PlotBase):
736744
"""Viewer settings that are needed for _PlotBase and are independent
737745
of all other plotter/model settings.

0 commit comments

Comments
 (0)