diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index d998b5f38..3e5a3e81d 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9"] + python-version: ["3.10"] steps: - uses: actions/checkout@main - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 8724c2a94..ba2de7648 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@main with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test-pytest-slow.yaml b/.github/workflows/test-pytest-slow.yaml index afbcea4df..ce878bc61 100644 --- a/.github/workflows/test-pytest-slow.yaml +++ b/.github/workflows/test-pytest-slow.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, 3.13] + python-version: [3.10, 3.14] env: PYTHON: ${{ matrix.python-version }} MPLBACKEND: Agg diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index a47b2337a..f2a13fb13 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -19,7 +19,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.9, 3.13] + python-version: ["3.10", "3.14"] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} diff --git a/.pylintrc b/.pylintrc index 4ae88a7c6..e417e0b11 100644 --- a/.pylintrc +++ b/.pylintrc @@ -88,7 +88,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.9 +py-version=3.10 # Discover python modules and packages in the file system subtree. recursive=no diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe70b476..8f0ffb99f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Attention: The newest changes should be on top --> ### Added + - ENH: Tank Fluids with Variable Density from Temperature and Pressure [#852](https://github.com/RocketPy-Team/RocketPy/pull/852) - ENH: Controller (AirBrakes) and Sensors Encoding [#849](https://github.com/RocketPy-Team/RocketPy/pull/849) - 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 --> ### Changed +- MNT: bumps min python version to 3.10 [#857](https://github.com/RocketPy-Team/RocketPy/pull/857) - DOC: Update docs dependencies and sub dependencies [#851](https://github.com/RocketPy-Team/RocketPy/pull/851) - MNT: extract flight data exporters [#845](https://github.com/RocketPy-Team/RocketPy/pull/845) - ENH: _MotorPrints inheritance - issue #460 [#828](https://github.com/RocketPy-Team/RocketPy/pull/828) diff --git a/docs/user/installation.rst b/docs/user/installation.rst index d19a42ff3..dcc188d17 100644 --- a/docs/user/installation.rst +++ b/docs/user/installation.rst @@ -85,7 +85,7 @@ Requirements Python Version ^^^^^^^^^^^^^^ -RocketPy supports Python 3.9 and above. +RocketPy supports Python 3.10 and above. Sorry, there are currently no plans to support earlier versions. 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! diff --git a/pyproject.toml b/pyproject.toml index f471085ed..23d6b3998 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "1.10.0" description="Advanced 6-DOF trajectory simulation for High-Power Rocketry." dynamic = ["dependencies"] readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" authors = [ {name = "Giovani Hidalgo Ceotto", email = "ghceotto@gmail.com"}, {name = "Guilherme Fernandes Alves", email = "guilherme_fernandes@usp.br"}, diff --git a/rocketpy/mathutils/function.py b/rocketpy/mathutils/function.py index 7cf9be334..9fe343687 100644 --- a/rocketpy/mathutils/function.py +++ b/rocketpy/mathutils/function.py @@ -449,6 +449,9 @@ def rbf_interpolation(x, x_min, x_max, x_data, y_data, coeffs): # pylint: disab self._interpolation_func = rbf_interpolation + else: + raise ValueError(f"Interpolation {interpolation} method not recognized.") + def __set_extrapolation_func(self): # pylint: disable=too-many-statements """Defines extrapolation function used by the Function. Each 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, _): def natural_extrapolation(x, x_min, x_max, x_data, y_data, coeffs): # pylint: disable=unused-argument return interpolator(x) + else: + raise ValueError( + f"Natural extrapolation not defined for {interpolation}." + ) + self._extrapolation_func = natural_extrapolation elif extrapolation == 2: # constant if self.__dom_dim__ == 1: @@ -547,6 +555,8 @@ def constant_extrapolation(x, x_min, x_max, x_data, y_data, coeffs): return extrapolator(x) self._extrapolation_func = constant_extrapolation + else: + raise ValueError(f"Extrapolation {extrapolation} method not recognized.") def set_get_value_opt(self): """Defines a method that evaluates interpolations. diff --git a/rocketpy/tools.py b/rocketpy/tools.py index 5683f9847..0e80152a7 100644 --- a/rocketpy/tools.py +++ b/rocketpy/tools.py @@ -182,12 +182,13 @@ def find_roots_cubic_function(a, b, c, d): Examples -------- >>> from rocketpy.tools import find_roots_cubic_function + >>> import cmath First we define the coefficients of the function ax**3 + bx**2 + cx + d >>> a, b, c, d = 1, -3, -1, 3 >>> x1, x2, x3 = find_roots_cubic_function(a, b, c, d) - >>> x1 - (-1+0j) + >>> cmath.isclose(x1, (-1+0j)) + True To get the real part of the roots, use the real attribute of the complex number.