From 375af321d89fa5b4af812d73b496639090269a38 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Tue, 1 Nov 2022 15:49:22 +0000 Subject: [PATCH] corrected types from code review by @paulromano Co-authored-by: Paul Romano --- openmc/source.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/source.py b/openmc/source.py index d886e98910..9293a59535 100644 --- a/openmc/source.py +++ b/openmc/source.py @@ -4,7 +4,7 @@ from numbers import Real import warnings import typing # imported separately as py3.8 requires typing.Iterable # also required to prevent typing.Union namespace overwriting Union -from typing import Optional +from typing import Optional, Sequence from xml.etree import ElementTree as ET import numpy as np @@ -77,7 +77,7 @@ class Source: def __init__( self, space: Optional[openmc.stats.Spatial] = None, - angle: Optional[openmc.stats.Spatial] = None, + angle: Optional[openmc.stats.UnitSphere] = None, energy: Optional[openmc.stats.Univariate] = None, time: Optional[openmc.stats.Univariate] = None, filename: Optional[str] = None, @@ -85,7 +85,7 @@ class Source: parameters: Optional[str] = None, strength: float = 1.0, particle: str = 'neutron', - domains: Optional[typing.Union[openmc.Cell, openmc.Material, openmc.Universe]] = None + domains: Optional[Sequence[typing.Union[openmc.Cell, openmc.Material, openmc.Universe]]] = None ): self._space = None self._angle = None