mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Fix Chain.form_matrix to work with scipy 1.12 (#2922)
This commit is contained in:
parent
23f19a0310
commit
ce7efa415e
2 changed files with 13 additions and 12 deletions
|
|
@ -597,9 +597,12 @@ class Chain:
|
|||
--------
|
||||
:meth:`get_default_fission_yields`
|
||||
"""
|
||||
matrix = defaultdict(float)
|
||||
reactions = set()
|
||||
|
||||
# Use DOK matrix as intermediate representation for matrix
|
||||
n = len(self)
|
||||
matrix = sp.dok_matrix((n, n))
|
||||
|
||||
if fission_yields is None:
|
||||
fission_yields = self.get_default_fission_yields()
|
||||
|
||||
|
|
@ -674,11 +677,8 @@ class Chain:
|
|||
# Clear set of reactions
|
||||
reactions.clear()
|
||||
|
||||
# Use DOK matrix as intermediate representation, then convert to CSC and return
|
||||
n = len(self)
|
||||
matrix_dok = sp.dok_matrix((n, n))
|
||||
dict.update(matrix_dok, matrix)
|
||||
return matrix_dok.tocsc()
|
||||
# Return CSC representation instead of DOK
|
||||
return matrix.tocsc()
|
||||
|
||||
def form_rr_term(self, tr_rates, mats):
|
||||
"""Function to form the transfer rate term matrices.
|
||||
|
|
@ -711,7 +711,9 @@ class Chain:
|
|||
Sparse matrix representing transfer term.
|
||||
|
||||
"""
|
||||
matrix = defaultdict(float)
|
||||
# Use DOK as intermediate representation
|
||||
n = len(self)
|
||||
matrix = sp.dok_matrix((n, n))
|
||||
|
||||
for i, nuc in enumerate(self.nuclides):
|
||||
elm = re.split(r'\d+', nuc.name)[0]
|
||||
|
|
@ -737,10 +739,9 @@ class Chain:
|
|||
else:
|
||||
matrix[i, i] = 0.0
|
||||
#Nothing else is allowed
|
||||
n = len(self)
|
||||
matrix_dok = sp.dok_matrix((n, n))
|
||||
dict.update(matrix_dok, matrix)
|
||||
return matrix_dok.tocsc()
|
||||
|
||||
# Return CSC instead of DOK
|
||||
return matrix.tocsc()
|
||||
|
||||
def get_branch_ratios(self, reaction="(n,gamma)"):
|
||||
"""Return a dictionary with reaction branching ratios
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -64,7 +64,7 @@ kwargs = {
|
|||
# Dependencies
|
||||
'python_requires': '>=3.7',
|
||||
'install_requires': [
|
||||
'numpy>=1.9', 'h5py', 'scipy<1.12', 'ipython', 'matplotlib',
|
||||
'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib',
|
||||
'pandas', 'lxml', 'uncertainties'
|
||||
],
|
||||
'extras_require': {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue