EPW failing to run after fixing it

Hi @chris,
Our local meteorological Service has made some refinements on the OneBuilding’s EPW files. They said it is related to Wind data Standarizing. Those files will become soon the official ones to be used for energy rating of buildings.
As part of the Rating Committee i’m checking the validity of those files (basically, right now just checking they work with LBT). There is one file that is not, with the error pasted below. I’m comparing the drybulb temperatures of the new and OB’s but can’t find where it fails.

Do you mind taking a look? Want to be sure if this is something that can be fixed on LBT or i need to tell the Service to look again and fix it.
The working and faulty files are attached below.

Thanks,
-A.

Runtime error (ValueErrorException): invalid literal for float():
Traceback:
line 536, in _import_body, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 387, in _import_data, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 863, in _get_data_by_field, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 936, in dry_bulb_temperature, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 113, in script

ISR_JM_Jerusalem.Center.401830_TMYx.2007-2021.rar (267.1 KB)
ISR_JM_Jerusalem.Center.401830_TMYx.2007-2021_Wind Standardized.rar (268.2 KB)

Hey @AbrahamYezioro ,

This case was actually pretty helpful. I decided that this situation has happened enough that I should improve the error message in this case:

And the message in your case here gave me a lot of insight about what went wrong:

It turns out the problem is caused by an extra line break at the end of the EPW file:

Once we delete this, it imports well.
ISR_JM_Jerusalem.Center.401830_TMYx.2007-2021_Wind Standardized.zip (299.0 KB)

1 Like

Also, I realized that EnergyPlus is actually OK with the extra blank line so I tweaked the Ladybug EPW class so that it will also succeed for this case.

1 Like

Hi @chris,
Just to be sure about the status of this topic. The solution is to delete the empty line or it will be possible to use the existing EPW.
Just updated with the Versioner and the error is still there. Probably i should try later or tomorrow …

Thanks,
-A.

Deleting the extra line break from the EPW is good practice and I would recommend you do that no matter what. But, in the very latest version of Ladybug Tools that finished releasing 20 minutes ago, the extra line break won’t stop the EPW from being imported and the line-break EPW can also be simulated in EnergyPlus.

Hi @chris,
After updating i’m getting this error instead the previous one:

Runtime error (ValueErrorException): Failed to parse EPW data for field “Year” at index 8760.
invalid literal for int() with base 10: ‘’

Traceback:
line 544, in _import_body, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 387, in _import_data, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 871, in _get_data_by_field, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 944, in dry_bulb_temperature, “C:\Program Files\ladybug_tools\python\Lib\site-packages\ladybug\epw.py”
line 113, in script

Thanks,
-A.

Hey @AbrahamYezioro ,

It imports fine on my end after I recently ran the Versioner:

Are you using Rhino 6 for your test?

Hi @chris,
Unfortunately it is still not working with the extra empty line:


I use R7.

What i suspect is that the fix didn’t came through in the github. I see the last fix is the one above:

fix(epw): Improve error message in the event of parsing failure

but not something related to the LB EPW class.
Can be it?

Thanks,
-A.

Hey @AbrahamYezioro ,

The fix clearly made it through since this new line of code should be catching the extra line break and continuing.

It’s just that this fix is somehow working on my machine but not yours. I guess I can try implementing a different fix to see if it will address your situation.

And, to confirm again, are you using Rhino 7 on Windows to test this?

Yes. This is the one.

Weird. Just cheked the ladybug/epw.py and it has the fixed lines.

In the meantime i’ll use the fixed EPW file. I let know the Standards committee about this so they can ask the meteorological service to fix the file themselves .

Thanks @chris
-A.

Glad the the meteorological service will end up with a cleaner EPW.

I just implemented a more generalized solution for this, which might address whatever is going on with your machine:

It will take a couple of hours for the fix to become available with the LB Versioner but it might be worth testing it afterwards.

1 Like

Hi @chris,
It is working fine now!!

Thanks a lot,
-A.

1 Like