Skip to content

Commit

Permalink
change fitdata directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mjburton committed Nov 11, 2017
1 parent 217294e commit e1aca36
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gpkitmodels/GP/aircraft/wing/wing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
" wing.py "
import os
from os import sep
from os.path import abspath, dirname
import numpy as np
import pandas as pd
from gpkit import Variable, Model, Vectorize
Expand Down Expand Up @@ -61,7 +62,8 @@ def setup(self, N):

class WingAero(Model):
"wing aerodynamic model with profile and induced drag"
def setup(self, static, state, fitdata="jho_fitdata.csv"):
def setup(self, static, state,
fitdata=dirname(abspath(__file__)) + sep + "jho_fitdata.csv"):
"wing drag model"
Cd = Variable("C_d", "-", "wing drag coefficient")
CL = Variable("C_L", "-", "lift coefficient")
Expand All @@ -70,8 +72,7 @@ def setup(self, static, state, fitdata="jho_fitdata.csv"):
Re = Variable("Re", "-", "Reynold's number")
cdp = Variable("c_{dp}", "-", "wing profile drag coeff")

path = os.path.dirname(os.path.abspath(fitdata))
df = pd.read_csv(path + os.sep + fitdata)
df = pd.read_csv(fitdata)
fd = df.to_dict(orient="records")[0]

if fd["d"] == 2:
Expand Down

0 comments on commit e1aca36

Please sign in to comment.