ladybug-tools / ladybug-legacy

:beetle: Ladybug is an environmental plugin for Grasshopper.

Home Page:http://ladybug.tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EPW or epw

ayezioro opened this issue · comments

Hi,
Using the LB_importLocation and having a EPW file with the extension in CAPITALS makes it fail.
The checking at line 88 doesn't catch those cases. I suggest the next fix:
if _epwFile and (_epwFile.endswith('.epw') or _epwFile.endswith('.EPW')):
instead of the existing:
if _epwFile and _epwFile.endswith('.epw'):

Also, to be consistent, the code in the LB_importEPW, is not checking the extension at all (maybe it is not important ...?). Line 131 looks like:
if initCheck == True and _epwFile:

Maybe both of them should have the same check?

Thanks,
-A.

Good catch, @ayezioro . I updated the check to be able to handle any arrangement of capital letters:
1023958

I also added the check to the Import EPW component:
370cfe7