Commit b822b1a
authored
BUG: Fix no time initialization when passing initial_solution as array to Flight object (#844)
## 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] No1 parent b0aacdc commit b822b1a
1 file changed
+5
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 158 | | |
163 | 159 | | |
164 | 160 | | |
| |||
544 | 540 | | |
545 | 541 | | |
546 | 542 | | |
547 | | - | |
| 543 | + | |
548 | 544 | | |
549 | 545 | | |
550 | 546 | | |
| |||
1168 | 1164 | | |
1169 | 1165 | | |
1170 | 1166 | | |
| 1167 | + | |
1171 | 1168 | | |
1172 | 1169 | | |
1173 | 1170 | | |
| |||
2080 | 2077 | | |
2081 | 2078 | | |
2082 | 2079 | | |
2083 | | - | |
| 2080 | + | |
2084 | 2081 | | |
2085 | 2082 | | |
2086 | 2083 | | |
| |||
2976 | 2973 | | |
2977 | 2974 | | |
2978 | 2975 | | |
2979 | | - | |
| 2976 | + | |
2980 | 2977 | | |
2981 | 2978 | | |
2982 | 2979 | | |
| |||
0 commit comments