Fix plot_xs type hint (#3184)

This commit is contained in:
Paul Romano 2024-11-06 05:59:25 -06:00 committed by GitHub
parent 7552123c76
commit 339d78c5fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,3 @@
# annotations package is required to enable postponed evaluation of type
# hints in conjugation with the | operator. This avoids TypeError:
# unsupported operand type(s) for |: 'str' and 'NoneType' error
from __future__ import annotations
from itertools import chain
from numbers import Integral, Real
@ -126,7 +123,7 @@ def _get_title(reactions):
def plot_xs(
reactions: Dict[str, openmc.Material | List[str]],
reactions: Dict[str | openmc.Material, List[str]],
divisor_types: Iterable[str] | None = None,
temperature: float = 294.0,
axis: "plt.Axes" | None = None,
@ -139,7 +136,7 @@ def plot_xs(
divisor_orders: Iterable[int] | None = None,
energy_axis_units: str = "eV",
**kwargs,
) -> "plt.Figure":
) -> "plt.Figure" | None:
"""Creates a figure of continuous-energy cross sections for this item.
Parameters
@ -291,7 +288,6 @@ def plot_xs(
return fig
def calculate_cexs(this, types, temperature=294., sab_name=None,
cross_sections=None, enrichment=None, ncrystal_cfg=None):
"""Calculates continuous-energy cross sections of a requested type.