-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add parsing for non 1-minute data to UO SRML parser #711
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
Conversation
pvlib/iotools/srml.py
Outdated
with pandas' default labeling behavior. | ||
The time index is shifted back by one interval to account for the | ||
daily endtime of 2400, and to avoid time parsing errors on leap | ||
years. The returned data values should be understood to occur |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are labeled by the left endpoint of interval, and should be understood...
pvlib/iotools/srml.py
Outdated
# subracting the length of one interval and then correcting the times | ||
# at each former hour. interval_length is determined by taking the | ||
# difference of the first two rows of the time column. | ||
interval_length = int(df[df.columns[1]][:2].diff()[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line would be easier to read as, e.g., interval_length = df[df.columns[0]][1] - df[df.columns[0]][0]
fifty_nines = df_time % 100 == 99 | ||
times = df_time.where(~fifty_nines, df_time - 40) | ||
|
||
# subracting the length of one interval and then correcting the times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment like "e.g. the first two rows of hourly data are 100, 200, so interval length = 100"
pvlib/iotools/srml.py
Outdated
# Hourly files do not require fixing the former hour timestamps. | ||
times = df_time | ||
else: | ||
old_hours = df_time % 100 == (100 - interval_length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a few comments
I updated the logic for fixing the hour times. I didn't think of checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
pvlib python pull request guidelines
Thank you for your contribution to pvlib python! You may delete all of these instructions except for the list below.
You may submit a pull request with your code at any stage of completion.
The following items must be addressed before the code can be merged. Please don't hesitate to ask for help if you're unsure of how to accomplish any of the items below:
docs/sphinx/source/api.rst
for API changes.docs/sphinx/source/whatsnew
file for all changes.