Skip to content

AttributeError when calculating fuel flow for A21N #27

Description

@rmonstein

Hi,

First off, thanks for the excellent package; much appreciated!

I'm using OpenAP with the integration in Traffic, and it works mostly fine. But I stumbled into something that looks like a bug. I get the following exception when trying to compute the fuel flow of a A21N:

----> 1 flight.fuelflow()

File ~/bla/.venv/lib/python3.11/site-packages/traffic/algorithms/openap.py:102, in OpenAP.fuelflow(self, initial_mass, typecode, engine)
     98     return self
    100 ac = openap.prop.aircraft(actype)
--> 102 update_mass = True
    104 if initial_mass is not None:
    105     if not isinstance(initial_mass, str):

File ~/bla/.venv/lib/python3.11/site-packages/openap/fuel.py:61, in FuelFlow.__init__(self, ac, eng, **kwargs)
     58 self.drag = self.Drag(ac, **kwargs)
     59 self.wrap = self.WRAP(ac, **kwargs)
---> 61 self.params = self.fuel_params()
     62 self.polyfuel = func_fuel(self.params["fuel_coef"])

File ~/bla/.venv/lib/python3.11/site-packages/openap/fuel.py:77, in FuelFlow.fuel_params(self)
     75 else:
     76     syno = fuel_synonym.query("orig==@self.ac")
---> 77     if self.use_synonym and syno.shape[0] > 0:
     78         ac = syno.new.iloc[0]
     79     else:

AttributeError: 'FuelFlow' object has no attribute 'use_synonym'

Debugging the file shows that I get a match for the synonym and syno has a value, but it seems that self.use_synonymis never assigned.

Would be nice if this could be fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions