ladybug-tools / ladybug-legacy

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

EPW or epw #436

Closed ayezioro closed 6 years ago

ayezioro commented 6 years ago

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.

chriswmackey commented 6 years ago

Good catch, @ayezioro . I updated the check to be able to handle any arrangement of capital letters: https://github.com/mostaphaRoudsari/ladybug/commit/1023958b5035b2da13f632827b6dd3801115eece

I also added the check to the Import EPW component: https://github.com/mostaphaRoudsari/ladybug/commit/370cfe7ac6d56eb8745cb756557651deb3739b73