|
| 1 | +from __future__ import annotations |
1 | 2 | from ast import literal_eval |
2 | 3 | from collections import defaultdict |
3 | 4 | import copy |
4 | 5 | import hashlib |
5 | 6 | import itertools |
6 | | -import os |
7 | | -from pathlib import Path |
8 | 7 | import pickle |
9 | 8 | import threading |
| 9 | +from typing import Literal, Tuple |
10 | 10 |
|
11 | 11 | from PySide6.QtWidgets import QItemDelegate, QColorDialog, QLineEdit, QMessageBox |
12 | 12 | from PySide6.QtCore import QAbstractTableModel, QModelIndex, Qt, QSize, QEvent |
|
60 | 60 | 'Std. Dev.': 'std_dev', |
61 | 61 | 'Rel. Error': 'rel_err'} |
62 | 62 |
|
| 63 | +TallyValueType = Literal['mean', 'std_dev', 'rel_err'] |
| 64 | + |
63 | 65 |
|
64 | 66 | def hash_file(path): |
65 | 67 | # return the md5 hash of a file |
@@ -386,7 +388,7 @@ def create_tally_image(self, view=None): |
386 | 388 | """ |
387 | 389 | Parameters |
388 | 390 | ---------- |
389 | | - view : |
| 391 | + view : PlotView |
390 | 392 | View used to set bounds of the tally data |
391 | 393 |
|
392 | 394 | Returns |
@@ -635,7 +637,10 @@ def _create_distribcell_image(self, tally, tally_value, scores, nuclides, cellin |
635 | 637 |
|
636 | 638 | return image_data, None, data_min, data_max |
637 | 639 |
|
638 | | - def _create_tally_mesh_image(self, tally, tally_value, scores, nuclides, view=None): |
| 640 | + def _create_tally_mesh_image( |
| 641 | + self, tally: openmc.Tally, tally_value: TallyValueType, |
| 642 | + scores: Tuple[str], nuclides: Tuple[str], view: PlotView = None |
| 643 | + ): |
639 | 644 | # some variables used throughout |
640 | 645 | if view is None: |
641 | 646 | view = self.currentView |
|
0 commit comments