Skip to content

MNT: Move the Piecewise function to a separate module #667

Description

@Gui-FernandesBR

Reasons for solving this issue:

  • The function.py file is already quite big (more than 3.5k code lines).
  • We should define each class in a separate file, this makes the lib more readable.
  • There is absolutely no need to define the Piecewise Function class in the same file as the Functionclass

Steps for accomplishing a solution to this issue:

  • Create a file named rocketpy\mathutils\piecewise_function.py
  • Move the class PiecewiseFunction(Function): definition to the new file
  • Updates the mathutils/__init__.py file to ensure the imports are working
  • Run the tests (make pytest) and verify everything is working properly
  • Beware of potential breaking changes. What is the behavior of the following command before and after the changes?
from rocketpy.mathutils.function import PiecewiseFunction

Activity

  1. added a commit that references this issue on Dec 5, 2024
    02c3d74
  2. added a commit that references this issue on Dec 16, 2024
    2218f0f
  3. moved this from Backlog to Closed in LibDev Roadmapon Dec 20, 2024
  4. added a commit that references this issue on Jan 19, 2025
    9118d42
  5. added a commit that references this issue on Feb 10, 2025
    0bfec91
  6. added a commit that references this issue on Mar 14, 2025
    88bc043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FunctionEverything related to the Function classGood first issueGood for newcomers

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions