Skip to content

Conversation

chasgior214
Copy link

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!!!

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 18 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants