Skip to content

Commit a060e55

Browse files
authored
adjusted recent np.trapezoid fix to account for numpy < 2.0 (#199)
* adjusted recent np.trapezoid fix to account for numpy < 2.0 * bumped version and edited changelog.
1 parent ba4ed6e commit a060e55

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

ORBIT/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
from ORBIT.parametric import ParametricManager
1818
from ORBIT.supply_chain import SupplyChainManager
1919

20-
__version__ = "1.2.2"
20+
__version__ = "1.2.3"

ORBIT/phases/design/_cables.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,10 @@ def _get_catenary_length(self, d, h):
414414
)
415415
return d
416416

417-
return np.trapezoid(np.sqrt(1 + np.gradient(y, x) ** 2), x)
417+
if int(np.__version__[0]) < 2:
418+
return np.trapz(np.sqrt(1 + np.gradient(y, x) ** 2), x)
419+
else:
420+
return np.trapezoid(np.sqrt(1 + np.gradient(y, x) ** 2), x)
418421

419422
@property
420423
def free_cable_length(self):

docs/source/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
ORBIT Changelog
44
===============
5+
1.2.3
6+
-----
7+
- Adjusted the recent np.trapz fix to be compatible with numpy < 2.0
58

69
1.2.2
710
-----

0 commit comments

Comments
 (0)