pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

move pvsystem.retrieve_sam to iotools

Open wholmgren opened this issue 5 years ago • 7 comments

What do people think about moving pvsystem.retrieve_sam into the iotools subpackage? First brought up in #436.

wholmgren avatar May 15 '20 17:05 wholmgren

ivtools is another option. I think of iotools as functions to handle i/o of timeseries weather data specifically. Although I suppose retrieve_sam fetches inverter parameters as well, so ivtools isn't a perfect fit either.

kandersolar avatar May 15 '20 18:05 kandersolar

I'm in favor of moving it to iotools. I'd like to consider splitting that function into two, to read module and inverter parameters separately.

cwhanse avatar May 15 '20 19:05 cwhanse

I'm not sure what the practical advantage of splitting the function by module/inverter would be. The API would remain the same in that you'd have to specify a string for the specific module/inverter database. I guess we could have different functions for each database.

https://github.com/pvlib/pvlib-python/blob/f8921bd3879c4bcd9c0242005319729ab04ce7f6/pvlib/pvsystem.py#L1529-L1547

wholmgren avatar May 19 '20 04:05 wholmgren

@cwhanse do you have any further thoughts on how to refactor this function when moving to iotools?

The adrinverter is a bad fit for a function name that contains "SAM", too.

wholmgren avatar Jul 24 '20 15:07 wholmgren

So far we've named iotools functions for the source of the data being read; that patterns suggests read_sam (I've never liked retrieve). I agree if we keep sam in the name it should only read files from sam, so adr would need it's own read function. We could do away with the name argument and return all the library files, just tossing that out.

An alternative, we break the pattern and align read functions to the models, which may be more easily recognized by users, e.g., read_cec_modules, than read_sam.

cwhanse avatar Jul 24 '20 17:07 cwhanse

I like read_cec_modules better than read_sam. I'm indifferent on retrieve vs. read.

This would also be a great opportunity to rename parameters to standardization with pvterms.

toddkarin avatar Jul 27 '20 19:07 toddkarin

I like the consistency of read_ and the discoverability of e.g. _cec_modules. How about module names? Might need a couple of them depending on the name. Ideas: cec.py, adr.py, sandia.py, sam.py, module_inverter_parameters.py

I agree that it makes sense for new functions to return new keys.

wholmgren avatar Jul 28 '20 19:07 wholmgren