diff --git a/examples/jupyter/mgxs-part-ii.ipynb b/examples/jupyter/mgxs-part-ii.ipynb index c10f55956..1058b7134 100644 --- a/examples/jupyter/mgxs-part-ii.ipynb +++ b/examples/jupyter/mgxs-part-ii.ipynb @@ -2048,8 +2048,8 @@ "o16 = df[df['nuclide'] == 'O16']['mean']\n", "\n", "# Cast DataFrames as NumPy arrays\n", - "h1 = h1.as_matrix()\n", - "o16 = o16.as_matrix()\n", + "h1 = h1.values\n", + "o16 = o16.values\n", "\n", "# Reshape arrays to 2D matrix for plotting\n", "h1.shape = (fine_groups.num_groups, fine_groups.num_groups)\n", diff --git a/openmc/arithmetic.py b/openmc/arithmetic.py index 4a5e7486a..91e2f1ed4 100644 --- a/openmc/arithmetic.py +++ b/openmc/arithmetic.py @@ -1,6 +1,6 @@ import sys import copy -from collections import Iterable +from collections.abc import Iterable import numpy as np import pandas as pd diff --git a/openmc/data/photon.py b/openmc/data/photon.py index 61c903158..e0f71d5ce 100644 --- a/openmc/data/photon.py +++ b/openmc/data/photon.py @@ -1,4 +1,5 @@ -from collections import OrderedDict, Mapping, Callable +from collections import OrderedDict +from collections.abc import Mapping, Callable from copy import deepcopy from io import StringIO from numbers import Integral, Real @@ -740,7 +741,7 @@ class IncidentPhoton(EqualityMixin): shell_values.insert(0, None) df = relax.transitions[shell].replace( shell_values, range(len(shell_values))) - sub_group.create_dataset('transitions', data=df.as_matrix()) + sub_group.create_dataset('transitions', data=df.values) # Determine threshold threshold = rx.xs.x[0] diff --git a/openmc/data/reaction.py b/openmc/data/reaction.py index 547208dae..11807cadc 100644 --- a/openmc/data/reaction.py +++ b/openmc/data/reaction.py @@ -924,7 +924,7 @@ class Reaction(EqualityMixin): rx = cls(mt) rx.q_value = group.attrs['Q_value'] rx.center_of_mass = bool(group.attrs['center_of_mass']) - rx.redundant = bool(group.attrs['redundant']) + rx.redundant = bool(group.attrs.get('redundant', False)) # Read cross section at each temperature for T, Tgroup in group.items(): diff --git a/openmc/data/resonance_covariance.py b/openmc/data/resonance_covariance.py index 300e6dbf6..9e80e52f2 100644 --- a/openmc/data/resonance_covariance.py +++ b/openmc/data/resonance_covariance.py @@ -1,4 +1,4 @@ -from collections import MutableSequence +from collections.abc import MutableSequence import warnings import io import copy diff --git a/openmc/filter.py b/openmc/filter.py index 6c904e61d..ef68a4961 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1,5 +1,6 @@ from abc import ABCMeta -from collections import Iterable, OrderedDict +from collections import OrderedDict +from collections.abc import Iterable import copy import hashlib from itertools import product diff --git a/openmc/mesh.py b/openmc/mesh.py index f7cba22f8..f454a6f88 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Real, Integral from xml.etree import ElementTree as ET import sys diff --git a/openmc/mgxs/groups.py b/openmc/mgxs/groups.py index 6dd56e8e7..338bc4b00 100644 --- a/openmc/mgxs/groups.py +++ b/openmc/mgxs/groups.py @@ -1,4 +1,4 @@ -from collections import Iterable +from collections.abc import Iterable from numbers import Real import copy import sys diff --git a/openmc/universe.py b/openmc/universe.py index 294b114dd..044da12e3 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -1,4 +1,5 @@ -from collections import OrderedDict, Iterable +from collections import OrderedDict +from collections.abc import Iterable from copy import copy, deepcopy from numbers import Integral, Real import random diff --git a/tests/unit_tests/test_data_decay.py b/tests/unit_tests/test_data_decay.py index be8ad7d64..b925506df 100644 --- a/tests/unit_tests/test_data_decay.py +++ b/tests/unit_tests/test_data_decay.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from collections import Mapping +from collections.abc import Mapping import os from math import log diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index 34686b567..46a9dbd02 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from collections import Mapping +from collections.abc import Mapping import os import numpy as np diff --git a/tests/unit_tests/test_data_neutron.py b/tests/unit_tests/test_data_neutron.py index bbebcb34a..3cf036aa2 100644 --- a/tests/unit_tests/test_data_neutron.py +++ b/tests/unit_tests/test_data_neutron.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from collections import Mapping, Callable +from collections.abc import Mapping, Callable import os import numpy as np diff --git a/tests/unit_tests/test_data_photon.py b/tests/unit_tests/test_data_photon.py index eecef73c4..5036d08fd 100644 --- a/tests/unit_tests/test_data_photon.py +++ b/tests/unit_tests/test_data_photon.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from collections import Mapping, Callable +from collections.abc import Mapping, Callable import os import numpy as np diff --git a/tests/unit_tests/test_data_thermal.py b/tests/unit_tests/test_data_thermal.py index 9def78b38..7d7d4e964 100644 --- a/tests/unit_tests/test_data_thermal.py +++ b/tests/unit_tests/test_data_thermal.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from collections import Callable +from collections.abc import Callable import os import numpy as np