Skip to content

Commit 0125691

Browse files
authored
Use new slice_data function from OpenMC (#172)
1 parent 86050ce commit 0125691

4 files changed

Lines changed: 225 additions & 84 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,26 @@ jobs:
2424
env:
2525
DISPLAY: ':99.0'
2626
steps:
27-
-
28-
name: Apt dependencies
27+
- name: Apt dependencies
2928
shell: bash
3029
run: |
3130
apt update
3231
apt install -y libglu1-mesa libglib2.0-0 libfontconfig1 libegl-dev libxkbcommon-x11-0 xvfb libdbus-1-3
3332
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
34-
-
35-
uses: actions/checkout@v4
36-
-
37-
name: Install
33+
34+
- uses: actions/checkout@v4
35+
36+
- name: Configure Git safe directory
37+
shell: bash
38+
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
39+
40+
- name: Install
3841
shell: bash
3942
run: |
4043
cd ${GITHUB_WORKSPACE}
4144
pip install .[test]
42-
-
43-
name: Test
45+
46+
- name: Test
4447
shell: bash
4548
run: |
4649
cd ${GITHUB_WORKSPACE}

openmc_plotter/main_window.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ def redo(self):
702702
def restoreDefault(self):
703703
if self.model.currentView != self.model.defaultView:
704704
self.model.storeCurrent()
705-
self.model.activeView.adopt_plotbase(self.model.defaultView)
705+
self.model.activeView.adopt_view_params(self.model.defaultView)
706706
self.geometryPanel.update()
707707
self.colorDialog.updateDialogValues()
708708
self.requestPlotUpdate()
@@ -1242,7 +1242,7 @@ def requestPlotUpdate(self, view=None):
12421242
view_params = self.model.view_params_payload(view_snapshot)
12431243
self.plot_manager.set_latest_view_params(view_params)
12441244
self.plot_manager.clear_pending()
1245-
self.model.makePlot(view_snapshot, self.model.ids_map, self.model.properties)
1245+
self.model.makePlot(view_snapshot, self.model.geom_data, self.model.property_data)
12461246
self.resetModels()
12471247
self.showCurrentView()
12481248
if not self.plot_manager.is_busy:
@@ -1262,10 +1262,10 @@ def _on_plot_started(self):
12621262
def _on_plot_queued(self):
12631263
self.plotIm.showUpdatingOverlay("Generating Plot... (update queued)")
12641264

1265-
def _on_plot_finished(self, view_snapshot, view_params, ids_map, properties):
1265+
def _on_plot_finished(self, view_snapshot, view_params, geom_data, property_data):
12661266
if view_params != self.plot_manager.latest_view_params:
12671267
return
1268-
self.model.makePlot(view_snapshot, ids_map, properties)
1268+
self.model.makePlot(view_snapshot, geom_data, property_data)
12691269
self.resetModels()
12701270
self.showCurrentView()
12711271

openmc_plotter/plotgui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ def getIDinfo(self, event):
310310
and 0 <= xPos and xPos < self.model.currentView.h_res:
311311
id = self.model.ids[yPos, xPos]
312312
instance = self.model.instances[yPos, xPos]
313-
temp = "{:g}".format(self.model.properties[yPos, xPos, 0])
314-
density = "{:g}".format(self.model.properties[yPos, xPos, 1])
313+
temp = "{:g}".format(self.model.property_data[yPos, xPos, 0])
314+
density = "{:g}".format(self.model.property_data[yPos, xPos, 1])
315315
else:
316316
id = _NOT_FOUND
317317
instance = _NOT_FOUND
@@ -635,7 +635,7 @@ def updatePixmap(self):
635635
norm = SymLogNorm(
636636
1E-10) if cv.color_scale_log[cv.colorby] else None
637637

638-
data = self.model.properties[:, :, idx]
638+
data = self.model.property_data[:, :, idx]
639639
self.image = self.figure.subplots().imshow(data,
640640
cmap=cmap,
641641
norm=norm,

0 commit comments

Comments
 (0)