ladybug-tools / ladybug-legacy

:beetle: Ladybug is an environmental plugin for Grasshopper.
http://ladybug.tools
Other
195 stars 82 forks source link

bake issues in LB_LineChart & LB_BarChart #457

Open ayezioro opened 5 years ago

ayezioro commented 5 years ago

Hi, I've found a bug in the above components while trying to bake the geometry. The error i get is:

  1. Solution exception:'NoneType' object is not iterable

It is related to the name of the weather station In my case it is "Tel Aviv-Bet Dagan - ISR MSI".

The code error in the BarCharrt is:

The layer name: 'Tel Aviv-Bet Dagan - ISR MSI ' is not a valid layer name. Runtime error (TypeErrorException): 'NoneType' object is not iterable

Traceback: line 1183, in main, "" line 1203, in script

I solved it as follows (in the LineChart component, from line 468):

   try:
        if 'key:location/dataType/units/frequency/startsAt/endsAt' in _inputData[0]:
            clnInpdata = _inputData[1].split()
            weatherStation = ''.join(clnInpdata)
            #placeName = _inputData[1]
            placeName = weatherStation
        else:
            placeName = 'alternateLayerName'

Just deleted the white spaces in the name. Not elegant but works. I noticed than in other components the solution for this situation is diferent and it works, for instance the 3DChart component.

Will be great to solve the issue since it is an easy one and others can be in need of it.

Thanks, -A.

ayezioro commented 5 years ago

For the second issue see the following image: Capture The left image is the GH geometry, the right side shows the baked geometry. As you can see the colors in the graph don't fit and the legend squares are missing (the later happens in both components).

This one i don't know what to suggest to fix.

Thanks, -A.