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

ENH: new Flight.get_solution_at_time() method #441

Merged
merged 5 commits into from
Oct 15, 2023

Conversation

Gui-FernandesBR
Copy link
Member

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest --runslow) have passed locally

Current behavior

If by any chance you want to know the state vector that corresponds to a specific time of the flight, there's no easy way to do so.

New behavior

There's this new method that returns the numpy array of the solution state at a specific time. If the user choose a time that do not exists in the timesteps, a warning is raised and the code automatically changes to the closest time step.

Breaking change

  • No

Additional information

  • This feature is particularly important for us to work on multi-stage and deployable flights.
  • I was not sure if it was better to return the np.array object or a list. I chose array because I thought it could be more useful and faster, but honestly this was arbitrary and I don't think there is a big difference between the two options.
  • as I am creating this PR on windows, I wonder if the integrators of the Flight class will give the exact same behavior on linux when I upload this to github actions. Let's see!

@Gui-FernandesBR Gui-FernandesBR added Enhancement New feature or request, including adjustments in current codes Flight Flight Class related features labels Oct 14, 2023
@Gui-FernandesBR Gui-FernandesBR self-assigned this Oct 14, 2023
rocketpy/simulation/flight.py Outdated Show resolved Hide resolved
@Gui-FernandesBR Gui-FernandesBR merged commit 46725b9 into develop Oct 15, 2023
9 checks passed
@Gui-FernandesBR Gui-FernandesBR deleted the enh/get-solution-at-time branch October 15, 2023 14:53
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request, including adjustments in current codes Flight Flight Class related features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants