Skip to content

Commit

Permalink
Avoid numpy/scipy deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed Mar 2, 2024
1 parent d85f025 commit 726ea72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CADETProcess/comparison/difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from warnings import warn

import numpy as np
from scipy.integrate import simps
from scipy.integrate import simpson
from scipy.special import expit

from CADETProcess import CADETProcessError
Expand Down Expand Up @@ -427,10 +427,10 @@ def _evaluate(self, solution):
Concentration profile of simulation.
"""
area_ref = simps(
area_ref = simpson(
self.reference.solution, self.reference.time, axis=0
)
area_new = simps(solution.solution, solution.time, axis=0)
area_new = simpson(solution.solution, solution.time, axis=0)

return abs(area_ref - area_new)/area_ref

Expand Down
2 changes: 1 addition & 1 deletion CADETProcess/dataStructure/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ def fill_values(self, dims, value):
raise ValueError("Can only set single entry if n_entries == 1.")

if isinstance(value, np.ndarray) and value.size == 1:
value = float(value)
value = float(value.squeeze())

if isinstance(value, (int, float)):
value = n_entries * [value]
Expand Down

0 comments on commit 726ea72

Please sign in to comment.