Aviary icon indicating copy to clipboard operation
Aviary copied to clipboard

Fix 0 pax bug for multi-mission

Open jkirk5 opened this issue 1 year ago • 2 comments

Summary

Fixes a bug in the crew & payload preprocessor where providing a passenger count of 0 for a single mission was confused with not providing that particular passenger count variable at all, leading to overwriting mission pax count with design pax count.

NOTE: This PR is on hold until other default-related tasks are finished

Related Issues

  • Related to #738

Backwards incompatibilities

None

New Dependencies

None

jkirk5 avatar Dec 09 '24 23:12 jkirk5

I will need to update docs once I have tests working

jkirk5 avatar Dec 10 '24 22:12 jkirk5

Examining aviary_options what we find is that 'aircraft:crew_and_payload:num_business_class': (0, 'unitless'), has been set before getting to the following code lines in preprocessor.py:

It appears it is an issue stemming from the way load_vehicle() works, which is to grab every single variable from the metadata with a default and apply it to the aviary inputs. I think this is really bad because it has the potential to accidentally set default values as overrides which 100% isn't intended behavior. It also is really overkill, we only need to set values for inputs the user wants - every other default should come directly from the metadata when adding component inputs/outputs.

This PR may need to stay on hold until we clean up how defaults work in the rest of Aviary, this approach should work with the new paradigm (all defaults come from metadata rather than using user inputs as a vehicle to get those values into the problem)

jkirk5 avatar Dec 27 '24 22:12 jkirk5