TUDelft-CNS-ATM / openap

Open Aircraft Performance Model and Python Toolkit
https://openap.dev
GNU Lesser General Public License v3.0
117 stars 23 forks source link

suggested changes #8

Closed llaluque-ai closed 3 years ago

llaluque-ai commented 3 years ago

In some Jupiter environment, we had errors in fuelflow and emission. We suggest the following patch:

--- openap/prop.py  2021-01-21 15:24:31.007780068 +0000
+++ openap-patch/prop.py    2021-01-21 15:25:48.649416648 +0000
@@ -81,7 +81,7 @@
     ENG = eng.strip().upper()
     engines = pd.read_fwf(db_engine)

-    available_engines = engines.query("name.str.startswith(@ENG)")
+    available_engines = engines.query("name.str.startswith(@ENG)", engine='python')

     if available_engines.shape[0] == 0:
         print("Engine not found.")
@@ -111,7 +111,7 @@
     engines = engines.merge(emissions, how="left", left_on="name", right_on="engine")

     # try to look for the unique engine
-    available_engines = engines.query("name.str.upper().str.startswith(@ENG)")
+    available_engines = engines.query("name.str.upper().str.startswith(@ENG)", engine='python')
     if available_engines.shape[0] >= 1:
         available_engines.index = available_engines.name
junzis commented 3 years ago

Thank you for the feedback, @llaluque-ai. I included this in the newest code.

I think it was a bug only on Windows. I also only realize it because of a student of ours.