DLCWriter fails when using webt installed from PyPI
EDIT: I've verified that the IEC delcwriter works when you clone then pip install -e .
. However, if you pip install wetb
then it fails with the error below. Perhaps something about the packaging process is not correctly creating the wind.turbulence
submodule?
I think it was after the restructure of the turbulence submodule. Consider including the examples in the docs in testing?
cc @mmpe
MWE:
def make_htc(master_htc_dir='htc_master', htc_dir='htc'):
"""Make htc files"""
master_htc_path = [os.path.join(master_htc_dir, f) for f in os.listdir(master_htc_dir)
if 'master' in f][0]
writer = HAWC2_IEC_DLC_Writer(master_htc_path, diameter=D)
dlb = DTU_IEC64100_1_Ref_DLB(iec_wt_class=iec_wt_class, #IEC wind turbine class
Vin=Vin, # cut-in wind speed
Vout=Vout, # cut-out wind speed
Vr=Vr, # rated wind speed
D=D, # Rotor diameter
z_hub=z_hub # hub height
)
writer.from_pandas(dlb['DLC12']) # only DLC 1.2
writer.write_all(out_dir=htc_dir)
if __name__ == '__main__':
if sys.argv[1] == 'make_htc':
make_htc()
else:
raise ValueError('Unrecognized command line argument "{sys.argv[1]}"!')
results in
(py36-wetb) [rink@jess DTU10MW_v10]$ python cluster_utils.py make_htc
Generating 216 htc files in directory: htc
Traceback (most recent call last):
File "cluster_utils.py", line 33, in <module>
make_htc()
File "cluster_utils.py", line 28, in make_htc
writer.write_all(out_dir=htc_dir)
File "/home/python/miniconda3/envs/py36-wetb/lib/python3.6/site-packages/wetb/hawc2/hawc2_input_writer.py", line 145, in write_all
self.write(out_dir/'{}.htc'.format(row.Name), **row.to_dict())
File "/home/python/miniconda3/envs/py36-wetb/lib/python3.6/site-packages/wetb/hawc2/hawc2_input_writer.py", line 125, in write
getattr(self, 'set_%s' % k)(htc, **kwargs)
File "/home/python/miniconda3/envs/py36-wetb/lib/python3.6/site-packages/wetb/dlb/hawc2_iec_dlc_writer.py", line 54, in set_seed
self.diameter, self.diameter))
File "/home/python/miniconda3/envs/py36-wetb/lib/python3.6/site-packages/wetb/hawc2/htc_extensions.py", line 73, in add_mann_turbulence
from wetb.wind.turbulence import mann_turbulence
ModuleNotFoundError: No module named 'wetb.wind.turbulence'