Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: PVSystem attributes as iterables #1068

Closed
wants to merge 8 commits into from
Closed

Conversation

cwhanse
Copy link
Member

@cwhanse cwhanse commented Sep 25, 2020

  • Closes Multiple arrays in a PV system #1067
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

Notes:

  • changes the signature of PVSystem.sapm_effective_irradiance to accept Dataframe instead of two Series. Up for discussion.
  • need to back out the commits for the Ross temperature model.

To do:

  • PVSystem methods to allow surface_tilt and surface_azimuth to be iterable, representing more than one array.
  • PVSystem methods to allow modules_per_string and strings_per_inverter to be iterable.
  • Changes to PVSystem to allow for multiple inverters
  • Tests representing fixed-tilt systems with multiple arrays
  • Changes to SingleAxisTracker to implement multiple arrays.

@wholmgren
Copy link
Member

wholmgren commented Sep 25, 2020

changes the signature of PVSystem.get_irradiance to accept Dataframe instead of two Series. Up for discussion.

What's the idea here? The different arrays have different illumination?

It's hard to tell if you're planning to continue to the current implementation with loops/list comprehensions or if it's still experimentation. If you are planning to continue to this pattern, let's discuss before you spend too much more time on it. I'd like to think there are better options along the lines of @mikofski's #1067 (comment)

@cwhanse
Copy link
Member Author

cwhanse commented Sep 25, 2020

Ack. Mistake in my comment: the change to Dataframe is in PVSystem.sapm_effective_irradiance not in PVSystem.get_irradiance.

Two arrays at different orientation have different plane-of-array irradiance. The upstream method PVSystem.get_irradiance calculates plane-of-array components by calling pvlib.irradiance.get_total_irradiance which returns a Dataframe. So in this code's pattern, PVSystem.get_irradiance returns a list of Dataframes.

The downstream method PVSystem.sapm_effective_irradiance currently requests 'poa_direct' and 'poa_diffuse' as separate Series. Rather than unpack the list of Dataframes to create two lists of Series (could be done), I thought putting 'poa_direct' and 'poa_diffuse' together in a Dataframe was simpler.

I'm not committed to this pattern, putting some code that runs out for discussion. And I think this code is duck-ish. The try - except TypeError pattern handles the case where the attribute is iterable (try) or not (except TypeError). One place where that doesn't work is PVSystem.calcparams_desoto, where for a single array effective_irradiance will be a Series.

@cwhanse
Copy link
Member Author

cwhanse commented Oct 16, 2020

Closed in favor of #1076

@cwhanse cwhanse closed this Oct 16, 2020
@cwhanse cwhanse deleted the iterables branch December 11, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple arrays in a PV system
2 participants