Skip to content

Conversation

@chasgior214
Copy link
Contributor

Pull request type

  • Code changes (bugfix, features)
  • 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 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
  • No

…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
@Gui-FernandesBR
Copy link
Member

Noce catch. I will review ASAP, thanks for contributing!!!

@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.03%. Comparing base (f17893b) to head (297d38a).
⚠️ Report is 19 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #844      +/-   ##
===========================================
+ Coverage    80.02%   80.03%   +0.01%     
===========================================
  Files           98      103       +5     
  Lines        12004    12525     +521     
===========================================
+ Hits          9606    10025     +419     
- Misses        2398     2500     +102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR
Copy link
Member

@copilot can you suggest regression tests for this Bug fix?

@github-project-automation github-project-automation bot moved this from Backlog to Next Version in LibDev Roadmap Sep 2, 2025
@MateusStano
Copy link
Member

Great fix!

@MateusStano MateusStano merged commit b822b1a into RocketPy-Team:develop Sep 2, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from Next Version to Closed in LibDev Roadmap Sep 2, 2025
@Gui-FernandesBR
Copy link
Member

@stano,

2 points:

1 - CHANGELOG
2 - Regression tests (avoid the same error to happen again).

Can you open a new PR including these 2 points? If possible, that would be nice. Thanks.

@chasgior214 chasgior214 deleted the bug/fix-no-time-initialization-on-initial-solution-flights branch September 3, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants