Skip to content

Commit 0407cb7

Browse files
phmbressanGui-FernandesBR
authored andcommitted
GIT: change workflows to retry Python 3.14.
1 parent 815a47c commit 0407cb7

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.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.10, 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.10", "3.13"]
22+
python-version: ["3.10", "3.14"]
2323
env:
2424
OS: ${{ matrix.os }}
2525
PYTHON: ${{ matrix.python-version }}

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)