Skip to content

Commit

Permalink
Minor updates for NumPy and CCBlade compatibility:
Browse files Browse the repository at this point in the history
- Replaced np.float() with float() for newer numpy versions.
- RAFT Rotor now tries to import from a standalone CCBlade install before trying from WISDEM.
  • Loading branch information
mattEhall committed Jan 5, 2023
1 parent 5af4b7f commit 7781903
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion raft/raft_fowt.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def calcStatics(self):
self.mballast = np.zeros(len(self.pb)) # make an empty mballast list with len=len(pb)
for i in range(len(self.pb)): # for each ballast density
for j in range(len(mballast)): # loop through each ballast mass
if np.float(pballast[j]) == np.float(self.pb[i]): # but only if the index of the ballast mass (density) matches the value of pb
if float(pballast[j]) == float(self.pb[i]): # but only if the index of the ballast mass (density) matches the value of pb
self.mballast[i] += mballast[j] # add that ballast mass to the correct index of mballast


Expand Down
14 changes: 5 additions & 9 deletions raft/raft_rotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import numpy as np
import matplotlib.pyplot as plt

import pandas as pd


from raft.pyIECWind import pyIECWind_extreme

Expand All @@ -16,19 +14,17 @@

from raft.helpers import rotationMatrix, getFromDict

from wisdem.ccblade.ccblade import CCBlade, CCAirfoil
try:
from ccblade.ccblade import CCBlade, CCAirfoil
except:
from wisdem.ccblade.ccblade import CCBlade, CCAirfoil


import pickle

if False:
thrust_psd = pickle.load( open( "/Users/dzalkind/Tools/RAFT/designs/rotors/thrust_psd.p", "rb" ) )

'''
try:
import ccblade as CCBlade, CCAirfoil # for cloned ccblade
except:
import wisdem.ccblade as CCblade, CCAirfoil # for conda install wisdem
'''

# global constants
raft_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
Expand Down

0 comments on commit 7781903

Please sign in to comment.