BUG: Fix no time initialization when passing initial_solution as array to Flight object by chasgior214 · Pull Request #844 · RocketPy-Team/RocketPy

@chasgior214

…y to Flight object

## Pull request type

- [x] Code changes (bugfix, features)
- [x] Code maintenance (refactoring, formatting, tests)

## 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 tests -m slow --runslow`) have passed locally
- [ ] `CHANGELOG.md` has been updated (if relevant)

## Current behavior
Passing initial_solution to a Flight object raises `AttributeError: 'Flight' object has no attribute 't_initial'` when running a simulation involving a controller. Attempt to run [this script](https://github.com/werocketry/airbrakes-lookuptable-generator/blob/main/main.py) to reproduce.

## New behavior
Initializes t_initial in __init_flight_state when an array is provided as the initial solution. As a result, a simulation can successfully run from an initial condition when controllers are used.

Additionally, minor fixes to docstrings in Flight.py

## Breaking change

- [ ] Yes
- [x] No

MateusStano

@chasgior214 chasgior214 deleted the bug/fix-no-time-initialization-on-initial-solution-flights branch

September 3, 2025 02:57