added mypy conformity for numpy 2.3.0

This commit is contained in:
Nicolas Kruse 2025-06-18 14:18:46 +02:00
parent 2f5cad3d05
commit d627b87df6
1 changed files with 3 additions and 3 deletions

View File

@ -167,7 +167,7 @@ def equilibrium(f: fluid | elements, t: float | FloatArray, p: float = 1e5) -> f
# the constant np.linalg.pinv(a) can be precomputed for each fs.
return np.dot(np.linalg.pinv(matrix), array_elemental_composition)
print('-->', f.array_elemental_composition.shape, f.fs.array_species_elements.transpose().shape)
# print('-->', f.array_elemental_composition.shape, f.fs.array_species_elements.transpose().shape)
composition = np.apply_along_axis(linalg_lstsq, -1, f.array_elemental_composition, f.fs.array_species_elements.transpose())
return fluid(composition, f.fs)
@ -176,7 +176,7 @@ def equilibrium(f: fluid | elements, t: float | FloatArray, p: float = 1e5) -> f
assert f.shape == tuple(), 'Multidimensional temperature can currently only used for 0D fluids'
t_composition = np.zeros(t.shape + (f.fs.array_species_elements.shape[0],))
for t_index in np.ndindex(t.shape):
t_composition[t_index] = _equilibrium_solver(f.fs, f.array_elemental_composition, t[t_index], p)
t_composition[t_index] = _equilibrium_solver(f.fs, f.array_elemental_composition, float(t[t_index]), p)
return fluid(t_composition, f.fs)
else:
composition = np.ones(f.shape + (len(f.fs.species),), dtype=float)