Skip to content

Commit ba4ed6e

Browse files
authored
Patch: v1.2.2, Replace deprecated NumPy trapz method and sunset Python 3.9 (#198)
* replace deprecated functionality * update changelog and bump version * deprecate 3.9 compatibility for EOL and benedict's lack of support for 3.9
1 parent 95ae354 commit ba4ed6e

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ jobs:
1212
max-parallel: 3
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
15+
python-version: ['3.10', '3.11', '3.12', '3.13']
1616
exclude:
17-
- os: macos-latest
18-
python-version: '3.9'
1917
- os: macos-latest
2018
python-version: '3.10'
2119

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.1"
20+
__version__ = "1.2.2"

ORBIT/phases/design/_cables.py

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

417-
return np.trapz(np.sqrt(1 + np.gradient(y, x) ** 2), x)
417+
return np.trapezoid(np.sqrt(1 + np.gradient(y, x) ** 2), x)
418418

419419
@property
420420
def free_cable_length(self):

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Instructions
7777
Dependencies
7878
~~~~~~~~~~~~
7979

80-
- Python >=3.9, <=3.13
80+
- Python >=3.10, <=3.13
8181
- marmot-agents
8282
- SimPy
8383
- NumPy

docs/source/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
ORBIT Changelog
44
===============
55

6+
1.2.2
7+
-----
8+
- Replaced the deprecated `numpy.trapz` with `numpy.trapezoid`.
9+
- Deprecates Python 3.9 support in preparation for EOL and seamless benedict compatibility.
10+
611
1.2.1
712
-----
813
- Removed `wisdem_api.py` because WISDEM now uses orbit as a pip installed package.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = [
1212
]
1313
readme = {file = "README.rst", content-type = "text/x-rst"}
1414
description = "Offshore Renewables Balance of system and Installation Tool"
15-
requires-python = ">=3.9, <3.14"
15+
requires-python = ">3.9, <3.14"
1616
license = {file = "LICENSE"}
1717
dependencies = [
1818
"numpy",
@@ -42,7 +42,6 @@ classifiers = [
4242
"Operating System :: OS Independent",
4343
"Programming Language :: Python",
4444
"Programming Language :: Python :: 3 :: Only",
45-
"Programming Language :: Python :: 3.9",
4645
"Programming Language :: Python :: 3.10",
4746
"Programming Language :: Python :: 3.11",
4847
"Programming Language :: Python :: 3.12",
@@ -82,7 +81,7 @@ version = {attr = "ORBIT.__version__"}
8281

8382
[tool.black]
8483
line-length = 79
85-
target-version = ['py39']
84+
target-version = ['py310']
8685
include = '\.pyi?$'
8786
exclude = '''
8887
/(
@@ -120,7 +119,7 @@ length_sort = "1"
120119

121120
[tool.ruff]
122121
line-length = 79
123-
target-version = "py39"
122+
target-version = "py310"
124123
exclude = [
125124
".git",
126125
"__pycache__",

0 commit comments

Comments
 (0)