Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: EmptyMotor class inherits from Motor(ABC) #530

Open
Gui-FernandesBR opened this issue Jan 12, 2024 · 0 comments
Open

MNT: EmptyMotor class inherits from Motor(ABC) #530

Gui-FernandesBR opened this issue Jan 12, 2024 · 0 comments
Assignees
Labels
Motors Every propulsion related issue or PR Refactor

Comments

@Gui-FernandesBR
Copy link
Member

Is your feature request related to a problem? Please describe.

The current EmptyMotor class is a hardcoded class which comes with a large TODO in its docstring.
This approach is complicated because the new additions to the Motor class will not automatically be applied to the EmptyMotor class.

Describe the solution you'd like

  • Define EmptyMotor using EmptyMotor(Motor) inheritance.

Additional context

Here is a code suggestion:

class EmptyMotor(Motor):
    """..."""

    def __init__(self):
        super().__init__(
            thrust_source=Function(0),
            dry_mass=1e-32,
            dry_inertia=(0, 0, 0),
            nozzle_radius=0,
            center_of_dry_mass_position=0,
            nozzle_position=0,
            burn_time=(0, 1),
            reshape_thrust_curve=False,
            interpolation_method="linear",
            coordinate_system_orientation="nozzle_to_combustion_chamber",
        )

    def all_info(self):
        return None

    @cached_property
    def center_of_propellant_mass(self):
        return Function(0)

    @cached_property
    def exhaust_velocity(self):
        return Function(0)

    @cached_property
    def propellant_I_11(self):
        return Function(0)

    @cached_property
    def propellant_I_12(self):
        return Function(0)

    @cached_property
    def propellant_I_13(self):
        return Function(0)

    @cached_property
    def propellant_I_22(self):
        return Function(0)

    @cached_property
    def propellant_I_23(self):
        return Function(0)

    @cached_property
    def propellant_I_33(self):
        return Function(0)

    @cached_property
    def propellant_initial_mass(self):
        return Function(0)
@Gui-FernandesBR Gui-FernandesBR added Motors Every propulsion related issue or PR Refactor labels Jan 12, 2024
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Motors Every propulsion related issue or PR Refactor
Projects
Status: Backlog
Development

No branches or pull requests

2 participants