Skip to content

Commit af7bbff

Browse files
MNT: bumps min python version to 3.10 (#857)
* MNT: Bump minimum python version to 3.10 * change python version for tests * changes more versions of python * trying to pass CI * python 3.4 still note ready * GIT: change workflows to retry Python 3.14. * MNT: Update CHANGELOG. --------- Co-authored-by: Pedro Bressan <[email protected]>
1 parent 34c0273 commit af7bbff

File tree

10 files changed

+22
-9
lines changed

10 files changed

+22
-9
lines changed

.github/workflows/linters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.9"]
19+
python-version: ["3.10"]
2020
steps:
2121
- uses: actions/checkout@main
2222
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/publish-to-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@main
2121
with:
22-
python-version: "3.9"
22+
python-version: "3.10"
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip

.github/workflows/test-pytest-slow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
python-version: [3.9, 3.13]
24+
python-version: [3.10, 3.14]
2525
env:
2626
PYTHON: ${{ matrix.python-version }}
2727
MPLBACKEND: Agg

.github/workflows/test_pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
matrix:
2121
os: [ubuntu-latest, macos-latest, windows-latest]
22-
python-version: [3.9, 3.13]
22+
python-version: ["3.10", "3.14"]
2323
env:
2424
OS: ${{ matrix.os }}
2525
PYTHON: ${{ matrix.python-version }}

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ persistent=yes
8888

8989
# Minimum Python version to use for version dependent checks. Will default to
9090
# the version used to run pylint.
91-
py-version=3.9
91+
py-version=3.10
9292

9393
# Discover python modules and packages in the file system subtree.
9494
recursive=no

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3131
Attention: The newest changes should be on top -->
3232

3333
### Added
34+
3435
- ENH: Tank Fluids with Variable Density from Temperature and Pressure [#852](https://github.com/RocketPy-Team/RocketPy/pull/852)
3536
- ENH: Controller (AirBrakes) and Sensors Encoding [#849](https://github.com/RocketPy-Team/RocketPy/pull/849)
3637
- EHN: Addition of ensemble variable to ECMWF dictionaries [#842](https://github.com/RocketPy-Team/RocketPy/pull/842)
@@ -43,6 +44,7 @@ Attention: The newest changes should be on top -->
4344

4445
### Changed
4546

47+
- MNT: bumps min python version to 3.10 [#857](https://github.com/RocketPy-Team/RocketPy/pull/857)
4648
- DOC: Update docs dependencies and sub dependencies [#851](https://github.com/RocketPy-Team/RocketPy/pull/851)
4749
- MNT: extract flight data exporters [#845](https://github.com/RocketPy-Team/RocketPy/pull/845)
4850
- ENH: _MotorPrints inheritance - issue #460 [#828](https://github.com/RocketPy-Team/RocketPy/pull/828)

docs/user/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Requirements
8585
Python Version
8686
^^^^^^^^^^^^^^
8787

88-
RocketPy supports Python 3.9 and above.
88+
RocketPy supports Python 3.10 and above.
8989
Sorry, there are currently no plans to support earlier versions.
9090
If you really need to run RocketPy on Python 3.8 or earlier, feel free to submit an issue and we will see what we can do!
9191

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "1.10.0"
44
description="Advanced 6-DOF trajectory simulation for High-Power Rocketry."
55
dynamic = ["dependencies"]
66
readme = "README.md"
7-
requires-python = ">=3.9"
7+
requires-python = ">=3.10"
88
authors = [
99
{name = "Giovani Hidalgo Ceotto", email = "[email protected]"},
1010
{name = "Guilherme Fernandes Alves", email = "[email protected]"},

rocketpy/mathutils/function.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ def rbf_interpolation(x, x_min, x_max, x_data, y_data, coeffs): # pylint: disab
449449

450450
self._interpolation_func = rbf_interpolation
451451

452+
else:
453+
raise ValueError(f"Interpolation {interpolation} method not recognized.")
454+
452455
def __set_extrapolation_func(self): # pylint: disable=too-many-statements
453456
"""Defines extrapolation function used by the Function. Each
454457
extrapolation method has its own function. The function is stored in
@@ -532,6 +535,11 @@ def natural_extrapolation(x, x_min, x_max, x_data, y_data, _):
532535
def natural_extrapolation(x, x_min, x_max, x_data, y_data, coeffs): # pylint: disable=unused-argument
533536
return interpolator(x)
534537

538+
else:
539+
raise ValueError(
540+
f"Natural extrapolation not defined for {interpolation}."
541+
)
542+
535543
self._extrapolation_func = natural_extrapolation
536544
elif extrapolation == 2: # constant
537545
if self.__dom_dim__ == 1:
@@ -547,6 +555,8 @@ def constant_extrapolation(x, x_min, x_max, x_data, y_data, coeffs):
547555
return extrapolator(x)
548556

549557
self._extrapolation_func = constant_extrapolation
558+
else:
559+
raise ValueError(f"Extrapolation {extrapolation} method not recognized.")
550560

551561
def set_get_value_opt(self):
552562
"""Defines a method that evaluates interpolations.

rocketpy/tools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,13 @@ def find_roots_cubic_function(a, b, c, d):
182182
Examples
183183
--------
184184
>>> from rocketpy.tools import find_roots_cubic_function
185+
>>> import cmath
185186
186187
First we define the coefficients of the function ax**3 + bx**2 + cx + d
187188
>>> a, b, c, d = 1, -3, -1, 3
188189
>>> x1, x2, x3 = find_roots_cubic_function(a, b, c, d)
189-
>>> x1
190-
(-1+0j)
190+
>>> cmath.isclose(x1, (-1+0j))
191+
True
191192
192193
To get the real part of the roots, use the real attribute of the complex
193194
number.

0 commit comments

Comments
 (0)