Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERCOT Historical RT SPP Parse error (get_rtm_spp) #227

Open
iamanonym0us opened this issue May 23, 2023 · 4 comments
Open

ERCOT Historical RT SPP Parse error (get_rtm_spp) #227

iamanonym0us opened this issue May 23, 2023 · 4 comments

Comments

@iamanonym0us
Copy link

ERCOT historical RT SPP not working. It throws an error saying "Cannot convert from timedelta64[ns] to timedelta64[h]. Supported resolutions are 's', 'ms', 'us', 'ns'" in line 1081, in Parse_doc + doc["HourBeginning"].astype("timedelta64[h]").

To Replicate:
import gridstatus
iso = gridstatus.Ercot()
iso.get_rtm_spp(2023)

@kmax12
Copy link
Collaborator

kmax12 commented May 24, 2023

thanks for reporting. the following works for me.

Python 3.10.8 (main, Nov 24 2022, 08:09:04) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gridstatus
>>> iso = gridstatus.Ercot()
>>> iso.get_rtm_spp(2023)

                          Time            Interval Start              Interval End   Location Location Type            Market    SPP
0    2023-01-01 00:00:00-06:00 2023-01-01 00:00:00-06:00 2023-01-01 00:15:00-06:00  HB_BUSAVG   Trading Hub  REAL_TIME_15_MIN  -2.56
1    2023-01-01 00:00:00-06:00 2023-01-01 00:00:00-06:00 2023-01-01 00:15:00-06:00   HB_SOUTH   Trading Hub  REAL_TIME_15_MIN  -2.56
2    2023-01-01 00:00:00-06:00 2023-01-01 00:00:00-06:00 2023-01-01 00:15:00-06:00     LZ_AEN     Load Zone  REAL_TIME_15_MIN  -2.56
3    2023-01-01 00:00:00-06:00 2023-01-01 00:00:00-06:00 2023-01-01 00:15:00-06:00     LZ_CPS     Load Zone  REAL_TIME_15_MIN  -2.56
4    2023-01-01 00:00:00-06:00 2023-01-01 00:00:00-06:00 2023-01-01 00:15:00-06:00     HB_PAN   Trading Hub  REAL_TIME_15_MIN  -2.56
...                        ...                       ...                       ...        ...           ...               ...    ...
8395 2023-05-20 00:45:00-05:00 2023-05-20 00:45:00-05:00 2023-05-20 01:00:00-05:00   HB_SOUTH   Trading Hub  REAL_TIME_15_MIN  17.37
8396 2023-05-20 00:45:00-05:00 2023-05-20 00:45:00-05:00 2023-05-20 01:00:00-05:00     HB_PAN   Trading Hub  REAL_TIME_15_MIN  17.37
8397 2023-05-20 00:45:00-05:00 2023-05-20 00:45:00-05:00 2023-05-20 01:00:00-05:00   HB_NORTH   Trading Hub  REAL_TIME_15_MIN  17.37
8398 2023-05-20 00:45:00-05:00 2023-05-20 00:45:00-05:00 2023-05-20 01:00:00-05:00   LZ_NORTH     Load Zone  REAL_TIME_15_MIN  17.37
8399 2023-05-20 00:45:00-05:00 2023-05-20 00:45:00-05:00 2023-05-20 01:00:00-05:00    LZ_WEST     Load Zone  REAL_TIME_15_MIN  17.37

can you share what versions of pandas and numpy you are using?

@iamanonym0us
Copy link
Author

Pandas is 2.0.1 and Numpy is 1.24.3

I just ran an update. Still doesn't work

@iamanonym0us
Copy link
Author

iamanonym0us commented May 24, 2023

Fixed my adding to_numpy() in parse_doc (line 1069) in ercot.py

doc["Interval Start"] = (
pd.to_datetime(doc["DeliveryDate"])
+ doc["HourBeginning"].to_numpy().astype("timedelta64[h]")
+ ((doc["DeliveryInterval"] - 1) * interval_length)
)

@kmax12
Copy link
Collaborator

kmax12 commented May 24, 2023

thanks, I can reproduce in pandas 2.0.1. i am running pandas==1.5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants