PyPSA / pypsa-usa

PyPSA-USA: An Open-Source Energy System Optimization Model for the United States
https://pypsa-usa.readthedocs.io
MIT License
52 stars 20 forks source link

Can open new zip file under the current naming format in `retrieve_caiso_data` #215

Closed casinocullen closed 6 months ago

casinocullen commented 7 months ago

Checklist

The Issue

The issue should come from the colon in the name. After I replaced it with underscore, the error was resolved.

  with open(filename, "wb") as file:
         ^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'PRC_FUEL_20190101T00:00-0000_20190131T00:00-0000.6.zip'

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

No response

Anything else?

No response

ktehranchi commented 7 months ago

Which OS are you running on? This was working for me on Mac.... I'll look into changing this so that it is OS agnostic.

ktehranchi commented 7 months ago

Also we should change this so the fuel prices are only downloaded when interconnect==western

casinocullen commented 7 months ago

I am running on Windows. Now I added following lines to make it work

        startdatetimename = startdatetime.replace(":", "")
        enddatetimename = enddatetime.replace(":", "")
        filename = f"{queryname}_{startdatetimename}_{enddatetimename}.{resultformat}.zip"