Ideas for future development of pvlib iotools #1528
Replies: 3 comments 6 replies
-
Design spec (DRAFT)This is a draft for an iotools design specification (this is already partly covered in https://doi.org/10.1016/j.solener.2023.112092) Function patternShould return a tuple of two elements (data, metadata). The data object is often a pandas DataFrame and the metadata object is a dictionary. If the function does not parse any metadata, an empty dictionary should be returned to follow the standard format. Function namingThe main iotools functions should follow the naming patterns LocationFor measurement data, the location should be specified using the TimeThe timeframe of the requested data should be specified using the
CredentialsThe parameters used to specify credentials depend on the specific service. A suitable combination of the following parameters are recommended Variable mappingFunctions should by default map variable names to the standard pvlib names listed in the variable and Symbols list. The parameter determining whether variables are mapped should be named OtherOther things to consider: |
Beta Was this translation helpful? Give feedback.
-
Can we also distinguish between a “TMY” style file with 8760 hours of data versus other periods? And I’d also like to see one issue I have with PVGIS is that it’s always UTC which means that it almost always starts 5 to 8 hours before midnight, so another feature I’d like to see is to rotate the data so it starts at midnight in the local timeline |
Beta Was this translation helpful? Give feedback.
-
There are two general direction iotools could go:
I suppose the final product will be somewhere in between, but it may be helpful to keep those extremes in mind and to consider where iotools' aspirations lie in relation to them. |
Beta Was this translation helpful? Give feedback.
-
I've attempted to provide a bit of an overview of the possible development of the iotools and gather some notes on the inconsistencies in how the functions are implemented. The items are primarily based on the existing open pull requests and issues with the
io
tag, which can be found here.General
Reanalysis data
See also What to do about ERA5 and MERRA2? #1484
Commercial data
See #1310 for a general discussion.
iotools
#1875Other data sources
read_bsrn
to also parse LR1000 etc.Enhancements / inconsistencies
read_tmy2
read_epw
coerce_year
parameter toget_pvgis_tmy
get_srml
that is similar toread_srml_month_from_solardat
but acceptsstart
/end
Add get_srml iotools function; deprecate read_srml_month_from_solardat #1779Latitude.from_meta()
function (similar tofrom_epw
andfrom_tmy
)server
tourl
inpvlib.iotools.get_cams
get
functions, removetimeout
and replace by kwargs that pass torequests.get
start
/end
to be string by wrapping inpd.to_datetime(start)
, see this commentread_srml_month_from_solardat
withget_srml
Add get_srml iotools function; deprecate read_srml_month_from_solardat #1779pvlib.iotools.read_midc_raw_data_from_nrel
get_surfrad
functionget_solrad
function Createpvlib.iotools.get_solrad
#1967Returned parameters
Another inconsistency is whether the iotools functions return a single data object or a tuple of (data, meta). A single data object is returned when the metadata is not being parsed or the file does not contain any metadata. It is likely that several of these functions might be improved in the future to also parse metadata; however, returning a tuple of (data, meta) would result in a breaking change which is undesirable. Therefore, I suggest that all new functions return a tuple of (data, meta); and in the case that the metadata is not parsed or nonexistent the meta object is simply an empty dictionary. Given the large number of existing functions, I do not suggest that we change the existing functions. The following functions only return a single DataFrame:
read_midc
read_midc_raw_data_from_nrel
read_crn
read_srml
read_srml_month_from_solardat
Add get_srml iotools function; deprecate read_srml_month_from_solardat #1779read_solrad
Have pvlib.iotools.read_solrad return metadata #1968Note the PVGIS functions return three or four objects.
Beta Was this translation helpful? Give feedback.
All reactions