You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Return sky diffuse and components as dataframe in irradiance.perez #434
irradiance.perez can return isotropic, circumsolar and horizon components of sky diffuse irradiance if return_components = True. Currently, if return_components then results are returned as a tuple (sky_diffuse, diffuse_components) with the elements being a pandas.Series and pandas.Dataframe, respectively.
I propose that we always return a Dataframe with column sky_diffuse and optionally columns for isotropic, circumsolar, horizon. This avoids having the output of the perez model of a different type (tuple instead of pandas object) and having to unpack the tuple when diffuse_components are requested.
This is an interesting idea. I'm concerned about maintaining API compatibility across all of the transposition models. I think the default behavior of all of the models should be the same, if possible. So, I'm reluctant to default to returning a one-column DataFrame from perez while the others return Series.
We could make similar changes to all of the models. I don't know if that would be useful or busy work. What would the keys look like for each function? For example
Good point about compatibility. We could return a Series if return_components = False rather than a one column data frame. The hiccup for me is dealing with the tuple instead of a pandas object.
We could propagate the component capability into the other sky diffuse models, although perez is likely to be the most frequently used for this purpose.
For reference, the return_components feature was added in #259. It does not appear that we discussed the idea of returning a single DataFrame with the total and the components.
@cwhanse I suggest that we limit the scope of this particular issue to irradiance.perez and create new issues if want to expand this feature to other transposition models. I'm not sold on the API over all which is why I'm reluctant to put it into more models unless it's really necessary.
changed the title [-]Return sky diffuse irradiance components in sky diffuse dataframe[/-][+]Return sky diffuse and components as dataframe in irradiance.perez[/+]on Sep 6, 2018
Activity
wholmgren commentedon Feb 22, 2018
This is an interesting idea. I'm concerned about maintaining API compatibility across all of the transposition models. I think the default behavior of all of the models should be the same, if possible. So, I'm reluctant to default to returning a one-column DataFrame from
perezwhile the others return Series.We could make similar changes to all of the models. I don't know if that would be useful or busy work. What would the keys look like for each function? For example
isotropicreturnssky_diffuse, isotropic?haydaviesreturnssky_diffuse, isotropic, circumsolar?perezreturnssky_diffuse, isotropic, circumsolar, horizon?cwhanse commentedon Feb 22, 2018
Good point about compatibility. We could return a Series if
return_components = Falserather than a one column data frame. The hiccup for me is dealing with the tuple instead of a pandas object.We could propagate the component capability into the other sky diffuse models, although perez is likely to be the most frequently used for this purpose.
wholmgren commentedon Feb 22, 2018
Sure, that sounds like a quick fix then.
For reference, the
return_componentsfeature was added in #259. It does not appear that we discussed the idea of returning a single DataFrame with the total and the components.wholmgren commentedon Sep 6, 2018
@cwhanse I suggest that we limit the scope of this particular issue to
irradiance.perezand create new issues if want to expand this feature to other transposition models. I'm not sold on the API over all which is why I'm reluctant to put it into more models unless it's really necessary.cwhanse commentedon Sep 6, 2018
@wholmgren I agree,
irradiance.perezfor this PR.[-]Return sky diffuse irradiance components in sky diffuse dataframe[/-][+]Return sky diffuse and components as dataframe in irradiance.perez[/+]