Skip to content

Return sky diffuse and components as dataframe in irradiance.perez #434

Closed

Description

@cwhanse

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.

Activity

  1. wholmgren commented on Feb 22, 2018

    @wholmgren
    Member

    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

    isotropic returns sky_diffuse, isotropic?
    haydavies returns sky_diffuse, isotropic, circumsolar?
    perez returns sky_diffuse, isotropic, circumsolar, horizon?

  2. cwhanse commented on Feb 22, 2018

    @cwhanse
    MemberAuthor

    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.

  3. wholmgren commented on Feb 22, 2018

    @wholmgren
    Member

    Sure, that sounds like a quick fix then.

    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.

  4. added this to the 0.6.0 milestone on May 11, 2018
  5. wholmgren commented on Sep 6, 2018

    @wholmgren
    Member

    @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.

  6. cwhanse commented on Sep 6, 2018

    @cwhanse
    MemberAuthor

    @wholmgren I agree, irradiance.perez for this PR.

  7. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions