Skip to content

Commit f55b04c

Browse files
authored
Solving np.trapezoid issue (#1660)
1 parent b7282de commit f55b04c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

activity_browser/bwutils/sensitivity_analysis.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
import pandas as pd
1616
from SALib.analyze import delta
1717

18+
# SALib>=1.5 can call `numpy.trapezoid`, which is only available in NumPy 2.x.
19+
# Keep compatibility with NumPy 1.x environments by aliasing to `trapz`.
20+
# Can be removed when we move to numpy>1
21+
if not hasattr(np, "trapezoid"):
22+
np.trapezoid = np.trapz
23+
1824
from activity_browser.mod import bw2data as bd
1925

2026
from ..settings import ab_settings

0 commit comments

Comments
 (0)