|
16 | 16 | from .source import SourceBase, MeshSource, IndependentSource |
17 | 17 | from .utility_funcs import input_path |
18 | 18 | from .volume import VolumeCalculation |
19 | | -from .weight_windows import WeightWindows, WeightWindowGenerator |
| 19 | +from .weight_windows import WeightWindows, WeightWindowGenerator, WeightWindowsList |
20 | 20 |
|
21 | 21 |
|
22 | 22 | class RunMode(Enum): |
@@ -313,7 +313,7 @@ class Settings: |
313 | 313 | described in :ref:`verbosity`. |
314 | 314 | volume_calculations : VolumeCalculation or iterable of VolumeCalculation |
315 | 315 | Stochastic volume calculation specifications |
316 | | - weight_windows : WeightWindows or iterable of WeightWindows |
| 316 | + weight_windows : WeightWindowsList |
317 | 317 | Weight windows to use for variance reduction |
318 | 318 |
|
319 | 319 | .. versionadded:: 0.13 |
@@ -424,7 +424,7 @@ def __init__(self, **kwargs): |
424 | 424 | self._max_particles_in_flight = None |
425 | 425 | self._max_particle_events = None |
426 | 426 | self._write_initial_source = None |
427 | | - self._weight_windows = cv.CheckedList(WeightWindows, 'weight windows') |
| 427 | + self._weight_windows = WeightWindowsList() |
428 | 428 | self._weight_window_generators = cv.CheckedList(WeightWindowGenerator, 'weight window generators') |
429 | 429 | self._weight_windows_on = None |
430 | 430 | self._weight_windows_file = None |
@@ -1095,14 +1095,14 @@ def write_initial_source(self, value: bool): |
1095 | 1095 | self._write_initial_source = value |
1096 | 1096 |
|
1097 | 1097 | @property |
1098 | | - def weight_windows(self) -> list[WeightWindows]: |
| 1098 | + def weight_windows(self) -> WeightWindowsList: |
1099 | 1099 | return self._weight_windows |
1100 | 1100 |
|
1101 | 1101 | @weight_windows.setter |
1102 | | - def weight_windows(self, value: WeightWindows | Iterable[WeightWindows]): |
1103 | | - if not isinstance(value, MutableSequence): |
| 1102 | + def weight_windows(self, value: WeightWindows | Sequence[WeightWindows]): |
| 1103 | + if not isinstance(value, Sequence): |
1104 | 1104 | value = [value] |
1105 | | - self._weight_windows = cv.CheckedList(WeightWindows, 'weight windows', value) |
| 1105 | + self._weight_windows = WeightWindowsList(value) |
1106 | 1106 |
|
1107 | 1107 | @property |
1108 | 1108 | def weight_windows_on(self) -> bool: |
|
0 commit comments