Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when calculating fuel flow for A21N #27

Open
rmonstein opened this issue Sep 10, 2024 · 0 comments
Open

AttributeError when calculating fuel flow for A21N #27

rmonstein opened this issue Sep 10, 2024 · 0 comments

Comments

@rmonstein
Copy link

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("[email protected]")
---> 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.

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

No branches or pull requests

1 participant