Repository navigation
Description
Is your feature request related to a problem? Please describe.
Many iotools.get_... functions clarify the output index/timestamp convention in the docstring, but several do not:
get_nsrdb_psm4_...get_pvgis_...get_cams(table in notes says "Beginning/end of time period" while input paramlabelcan be'left'or'right', maybe this could be made consistent and it would be nice to clarify in the "Returns" part of the docstring)get_solargis(timestamp_typeis an input parameter, but it would be nice to clarify this in the "Returns" part of the docstring)get_bsrnget_surfradget_solradget_midc
Describe the solution you'd like
Clarify that NSRDB data are returned with a center of interval index/timestamp, and whatever is correct for the other datasets.
Similarly, some descriptions are inconsistent. Some say "interval" and some say "period", and "middle" vs "midpoint" vs "center"
Additional context
Examples:
get_solaranywhere:
pvlib-python/pvlib/iotools/solaranywhere.py
Lines 102 to 106 in ba161f9
| Returns | |
| ------- | |
| data: pandas.DataFrame | |
| Timeseries data from SolarAnywhere. The index is the observation time | |
| (middle of period). |
get_nasa_power:
pvlib-python/pvlib/iotools/nasa_power.py
Lines 99 to 103 in ba161f9
| Returns | |
| ------- | |
| data : pd.DataFrame | |
| Time series data. The index corresponds to the start (left) of the | |
| interval. |
get_solcat_historic:
pvlib-python/pvlib/iotools/solcast.py
Lines 177 to 181 in ba161f9
| Returns | |
| ------- | |
| data : pandas.DataFrame | |
| containing the values for the parameters requested. The times | |
| in the DataFrame index indicate the midpoint of each interval. |
Also note descriptions in the following, which say "center" and "center-labeled":
Activity
RDaxini commentedon Nov 25, 2026
Good observation @williamhobbs. If you want to open a PR for this, I'll review it at the start of next week. I can also open one if not, unless if someone wants to handle this sooner. I won't have my laptop over the next few days.
Making this statement of work assignment now in the hope we can resolve this without the need for involving or attracting the attention of six million bots:)
kandersolar commentedon Nov 25, 2026
I believe @AdamRJensen has mentioned previously going one step further: adding a parameter to all functions (like
map_variables) to control the labeling convention.williamhobbs commentedon Nov 25, 2026
I won't get to it this week. Probably not next week, either.
I like this. My opinion is that the default for iotools.get functions should be to return center of interval timestamps, because that's what is needed for solar position calculations. Maybe the new parameter could be something like
use_native_timestampwith a default ofFalse. Not sure how that would work with solargis and cams, which already have parameters that partially control timestamps.Either way, documenting the "native" convention would be useful. Our documentation on ERA5 timestamps seems to be one of the few places on the internet that clearly documents it :)