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

Problem running the tutorial #4

Open
rethore opened this issue Jul 9, 2015 · 3 comments
Open

Problem running the tutorial #4

rethore opened this issue Jul 9, 2015 · 3 comments

Comments

@rethore
Copy link
Member

rethore commented Jul 9, 2015

This cell is generating an error:

Loading all the input data
In [4]:
datadir = './'
dat = loadtxt(datadir+'WaterDepth1.dat')
X, Y = meshgrid(linspace(0., 1000., 50), linspace(0., 1000., 50))
depth = array(zip(X.flatten(), Y.flatten(), dat.flatten()))
borders = array([[200, 200], [150, 500], [200, 800], [600, 900], [700, 700], [900, 500], [800, 200], [500, 100], [200, 200]])
baseline = array([[587.5, 223.07692308], [525., 346.15384615], [837.5, 530.76923077], [525., 530.76923077], [525., 838.46153846], [837.5, 469.23076923]])
​
wt_desc = WTDescFromWTG(datadir+'V80-2MW-offshore.wtg').wt_desc
wt_layout = GenericWindFarmTurbineLayout([WTPC(wt_desc=wt_desc, position=pos) for pos in baseline])
​
​
# The wind rose
weibull_array = np.array([[  0.00000000e+00,   3.59673400e-02,  9.22422800e+00,   2.38867200e+00],
                         [  3.00000000e+01,   3.94977300e-02,   9.86435600e+00,   2.44726600e+00],
                         [  6.00000000e+01,   5.17838000e-02,   9.65220200e+00,   2.41992200e+00],
                         [  9.00000000e+01,   6.99794900e-02,   9.98217800e+00,   2.58789100e+00],
                         [  1.20000000e+02,   8.36383000e-02,   1.00946000e+01,   2.74804700e+00],
                         [  1.50000000e+02,   6.43412500e-02,   9.64369000e+00,   2.59179700e+00],
                         [  1.80000000e+02,   8.64220000e-02,   9.63377500e+00,   2.58007800e+00],
                         [  2.10000000e+02,   1.17690000e-01,   1.05678600e+01,   2.54492200e+00],
                         [  2.40000000e+02,   1.51555100e-01,   1.14525200e+01,   2.46679700e+00],
                         [  2.70000000e+02,   1.47361100e-01,   1.17423700e+01,   2.60351600e+00],
                         [  3.00000000e+02,   1.00109800e-01,   1.16923200e+01,   2.62304700e+00],
                         [  3.30000000e+02,   5.16542400e-02,   1.01385800e+01,   2.32226600e+00]])
wind_rose = WeibullWindRoseVT()
wind_rose.wind_directions = weibull_array[:,0]
wind_rose.frequency = weibull_array[:,1]
wind_rose.k = weibull_array[:,3]
wind_rose.A = weibull_array[:,2]
​
# Minimum distance between turbines
dist_WT_D = 3.0

Traceback:

E:root:'' is a reserved or invalid name
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-5ca424573668> in <module>()
      7
      8 wt_desc = WTDescFromWTG(datadir+'V80-2MW-offshore.wtg').wt_desc
----> 9 wt_layout = GenericWindFarmTurbineLayout([WTPC(wt_desc=wt_desc, position=pos) for pos in baseline])
     10
     11

c:\users\moserw\projects\toolsdev\openmdao-0.10.3.2\src\fusedwind\src\fusedwind\plant_flow\vt.pyc in __init__(self, wt_list)
    525         super(GenericWindFarmTurbineLayout, self).__init__()
    526         for wt in wt_list:
--> 527             self.add_wt(wt)
    528
    529     def add_wt(self, wt):

c:\users\moserw\projects\toolsdev\openmdao-0.10.3.2\src\fusedwind\src\fusedwind\plant_flow\vt.pyc in add_wt(self, wt)
    535         """
    536         wt.name = wt.name.replace('-','_')
--> 537         self.add(wt.name, VarTree(wt))
    538         self.wt_names.append(wt.name)
    539

c:\Users\moserw\Projects\ToolsDev\openmdao-0.10.3.2\Lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\vartree.pyc in add(self, name, obj)
    131             msg = "a VariableTree may only contain Variables or VarTrees"
    132             self.raise_exception(msg, TypeError)
--> 133         return super(VariableTree, self).add(name, obj)
    134
    135     def add_trait(self, name, trait, refresh=True):

c:\Users\moserw\Projects\ToolsDev\openmdao-0.10.3.2\Lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\container.pyc in add(self, name, obj)
    587         Returns the added object.
    588         """
--> 589         removed = self._prep_for_add(name, obj)
    590
    591         if has_interface(obj, IContainer):

c:\Users\moserw\Projects\ToolsDev\openmdao-0.10.3.2\Lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\container.pyc in _prep_for_add(self, name, obj)
    553         elif not is_legal_name(name):
    554             self.raise_exception("'%s' is a reserved or invalid name" % name,
--> 555                                  NameError)
    556
    557         removed = False

c:\Users\moserw\Projects\ToolsDev\openmdao-0.10.3.2\Lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\container.pyc in raise_exception(self, msg, exception_class)
   1449             full_msg = '%s: %s' % (self.get_pathname(), msg)
   1450         self._logger.error(msg)
-> 1451         raise exception_class(full_msg)
   1452
   1453     def reraise_exception(self, msg='', info=None):

NameError: : '' is a reserved or invalid name
@rethore
Copy link
Member Author

rethore commented Jul 9, 2015

I think that the error might be in FUSED-Wind, I will try to see if I can fix it there.

@rethore
Copy link
Member Author

rethore commented Jul 9, 2015

Could you tell me how you have installed topfarm? Which OS are you running it on?
Assuming you are running the install_all.sh script, try to rerun it. I have updated the remote_install.txt so that it uses the latest version of FUSED-Wind. That might be where the bug is coming from.

Edit: otherwise try to update FUSED-Wind to its latest version on github.com:

pip install -e  git+http://github.com/FUSED-Wind/fusedwind.git#egg=fusedwind

@moserw
Copy link

moserw commented Jul 9, 2015

Hi Pierre,

I am trying to run TOPFARM under Windows 7. I installed it following your instructions given in github using Python v2.7.9. I used the command
pip install -r http://raw.githubusercontent.com/DTUWindEnergy/TOPFARM/master/remote_install.txt
after installing openmdao in version 10.3.2.

I had to ad a setup.py file in the fusedwake package with the following content:

from setuptools import setup, find_packages

#####################################################################
kwargs = {'author': 'DTU WInd Energy and NREL NWTC',
'author_email': 'TBD',
'classifiers': ['Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering'],
'description': 'Framework for Unified Systems Engineering and Design of Wind Plants',
'include_package_data': True,
'install_requires': ['openmdao.main'],
'keywords': ['openmdao'],
'license': 'Apache v. 2.0',
#'maintainer': '',
#'maintainer_email': '',
'name': 'fusedwake',
'packages': find_packages(),
#'url': '',
'version': '0.1',
'zip_safe': False}

setup(**kwargs)
##################################################################

Unfortunately your update did not have any effect :-(

Best regards,
Wolfgang

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

2 participants