Commit d945ea0
committed
MNT: make Parachute base serialization inheritance-safe
The abstract Parachute.to_dict/from_dict referenced model-specific
attributes (cd_s, radius, drag_coefficient, height, porosity) that the
base no longer owns, and from_dict forwarded a `parachute_type` kwarg that
concrete constructors do not accept. They worked only because
HemisphericalParachute fully overrode them; any future parachute model
inheriting them would hit AttributeError/TypeError.
Reduce the base methods to the fields the base actually owns and expose a
shared `_decode_trigger` helper. HemisphericalParachute now builds on
`super().to_dict()` (matching the repo-wide serialization convention) and
adds only its own fields, removing the verbatim duplication. Serialized
output and round-trip behavior are unchanged. Drop the now-unused imports.1 parent 45eb473 commit d945ea0
2 files changed
Lines changed: 29 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
374 | 371 | | |
375 | 372 | | |
376 | 373 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
410 | 384 | | |
411 | 385 | | |
412 | 386 | | |
413 | 387 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 388 | + | |
422 | 389 | | |
423 | 390 | | |
424 | | - | |
| 391 | + | |
425 | 392 | | |
426 | 393 | | |
427 | 394 | | |
| |||
430 | 397 | | |
431 | 398 | | |
432 | 399 | | |
433 | | - | |
434 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
354 | 357 | | |
355 | 358 | | |
356 | 359 | | |
| |||
363 | 366 | | |
364 | 367 | | |
365 | 368 | | |
366 | | - | |
367 | 369 | | |
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 373 | | |
376 | 374 | | |
377 | 375 | | |
| |||
386 | 384 | | |
387 | 385 | | |
388 | 386 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
393 | 391 | | |
394 | | - | |
| 392 | + | |
395 | 393 | | |
396 | | - | |
| 394 | + | |
397 | 395 | | |
398 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
399 | 403 | | |
400 | | - | |
401 | | - | |
| 404 | + | |
402 | 405 | | |
403 | 406 | | |
404 | 407 | | |
405 | 408 | | |
406 | | - | |
407 | | - | |
| |||
0 commit comments