From c5df2bf621ffdd3eee9f07334563c78293fa9519 Mon Sep 17 00:00:00 2001 From: GuySten <62616591+GuySten@users.noreply.github.com> Date: Thu, 22 Jan 2026 05:57:40 +0200 Subject: [PATCH] Fix for pandas version 3 (#3743) --- openmc/data/photon.py | 4 +++- openmc/tallies.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/openmc/data/photon.py b/openmc/data/photon.py index 25ded24cb..bc21b2e56 100644 --- a/openmc/data/photon.py +++ b/openmc/data/photon.py @@ -203,7 +203,9 @@ class AtomicRelaxation(EqualityMixin): for subshell, df in transitions.items(): cv.check_value('subshell', subshell, _SUBSHELLS) cv.check_type('transitions', df, pd.DataFrame) - self._transitions = transitions + self._transitions = { + subshell: df.convert_dtypes() for subshell, df in transitions.items() + } @classmethod def from_ace(cls, ace): diff --git a/openmc/tallies.py b/openmc/tallies.py index 7b1ef0219..74d4722af 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1982,7 +1982,7 @@ class Tally(IDManagerMixin): # Expand the columns into Pandas MultiIndices for readability if pd.__version__ >= '0.16': - columns = copy.deepcopy(df.columns.values) + columns = copy.deepcopy(list(df.columns.values)) # Convert all elements in columns list to tuples for i, column in enumerate(columns):