ENH: Add multi-dimensional drag coefficient support (Cd as function of M, Re, α) by Copilot · Pull Request #875 · RocketPy-Team/RocketPy

Copilot AI changed the title [WIP] Enhance drag curve to include Re and alpha variables ENH: Add multi-dimensional drag coefficient support (Cd as function of M, Re, α)

Nov 14, 2025

@aZira371 aZira371 marked this pull request as ready for review

November 24, 2025 20:31
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
…tegration tests

Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
- MNT: velocity_body was not being used in get_drag_coefficient, removed it as an input
… test_multidim_drag.py

-MNT:  removed unused velocity in body frame parameter requirement from all instances of get_drag_coefficient in flight.py

- MNT: corrected docstring for get_value_opt_grid in function.py

- MNT: shifted import of classes before the definition of functions in test_multidim_drag.py

@aZira371 @Gui-FernandesBR

- MNT: rearranged the docstring of from_grid in function.py to match the expected output of doctest
- MNT: reran make format and lint on function.py to correct after previous changes to from_grid
- MNT: disables pylint unused private member for get_value_opt_grid as it is called upon dynamically by from_grid

- MNT: disabled pylint too many statement for from_grid for now and added a to-do to refactor it into smaller methods/helper functions

- MNT: updated .pylintrc to record Re as good name

@aZira371 @Gui-FernandesBR

- MNT: Re variable was unused in test_3d_drag_with_varying_alpha thus replaced it

Gui-FernandesBR

Gui-FernandesBR

Gui-FernandesBR

- TST: Added integration-level check to verify the flight simulation actually uses alpha when evaluating multi dim drag coeff.
- TST: utilized pytest fixtures where possible.
- MNT: Function.is_multidimensional property in function.py. It returns True when the function's internal domain dimension is greater than 1 and safely returns False on errors.

- MNT: Replaced the ad-hoc hasattr/len check in flight.py with a clearer check:
if isinstance and drag_function.is_multidimensional
…or when an unsupported extrapolation value is provided.
ENH: Used  shared flight fixtures and simplify multi-drag integration tests in test_multidim_drag.py

ENH: Exposes multidimensionality and validated grid extrapolation in function.py
…clature

- MNT: added a fallback to reynolds calculation in flight.py to avoid mu is zero case

- MNT: updated test_shepard_fallback_warning name and docstring to match implementation in test_function_grid.py
…ueError, OverflowError): in get_drag_coefficient of flight.py

@aZira371

@aZira371

@aZira371

@aZira371

Gui-FernandesBR

@aZira371

…tibility parameter, and early return guard clause

Co-authored-by: aZira371 <99824864+aZira371@users.noreply.github.com>

aZira371

@aZira371

Gui-FernandesBR