Skip to content

Updates for pvlib 0.9.0#121

Merged
campanelli-sunpower merged 9 commits into
SunPower:masterfrom
kandersolar:pvlib090
Oct 12, 2021
Merged

Updates for pvlib 0.9.0#121
campanelli-sunpower merged 9 commits into
SunPower:masterfrom
kandersolar:pvlib090

Conversation

@kandersolar

Copy link
Copy Markdown
Contributor

Howdy @anomam, pvlib 0.9.0 was released the other day. No changes needed in pvfactors itself, but there is one change needed to the test suite related to a bugfix in the Perez model (pvlib/pvlib-python#1239). I have updated the values here to pass with pvlib 0.9.0, but that means the test fails on older pvlib versions. Is that acceptable? I could make the test values depend on the installed pvlib version if you want the tests to pass with older pvlibs as well. I suspect CircleCI will install the latest pvlib for this PR, but we'll see what actually happens.

I also took the liberty of creating a 1.5.2 whatsnew, although a note about different irradiance values w/ pvlib 0.9.0 may be in order.

Unrelated: may want to add python 3.9 to the test matrix -- 3.10 release candidates are already available on some CIs!

cc @spaneja

@kandersolar

kandersolar commented Sep 14, 2021

Copy link
Copy Markdown
Contributor Author

Pushed a sphinx fix (link) -- sorry for the scope creep, but I wanted to see what it thought of the test suite.

Edit: tests all pass, although I note that the 3.7 job decided to build pandas from source for some reason 🤔

@anomam

anomam commented Sep 15, 2021

Copy link
Copy Markdown
Contributor

Thank you so much for the contribution again @kanderso-nrel !
@pfranz-spwr @srisukhi @loganrozanski I do not have admin rights on the repo anymore and I can't merge this. I would be happy to keep maintaining pvfactors if you can give me elevated rights, or feel free to take over if you prefer. Please let us know what you prefer!

@anomam anomam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kanderso-nrel ! LGTM

======================================

In the "fast mode", ``pvfactors`` assumes that all incident irradiance values for the system are known except for the PV row back surfaces. So since the system to solve is now explicit (no matrix inversion needed), it runs a little bit faster than the full mode, but it is less acurrate.
In the "fast mode", ``pvfactors`` assumes that all incident irradiance values for the system are known except for the PV row back surfaces. So since the system to solve is now explicit (no matrix inversion needed), it runs a little bit faster than the full mode, but it is less accurate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/sphinx/conf.py

def setup(app):
app.add_stylesheet('css/custom.css')
app.add_css_file('css/custom.css')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Contributors
------------
* Marc Anoma (:ghuser:`anomam`)
* Kevin Anderson (:ghuser:`kanderso-nrel`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

# Check expected outputs: before v1.3.0, expected output is
# [20.4971271991293, 21.389095477613356], which shows discontinuity
expected_out = [20.497127, 20.50229]
expected_out = [20.936348, 20.942163]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to preserve the values for pvlib 0.8.0 in a comment, analogous to what was done above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, done

Comment thread requirements.txt Outdated
@@ -1,4 +1,4 @@
pvlib>=0.7.0,<0.9.0
pvlib>=0.7.0,<0.10.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kanderso-nrel The thought popped into my head last night as to if it we should require pvlib 0.9.0 as a minimum, because of the error involved in the earlier versions.

(The error appears minor in the test you fixed here, but maybe that is a false impression and/or shouldn't matter.)

@anomam

anomam commented Oct 3, 2021

Copy link
Copy Markdown
Contributor

@pfranz-spwr @srisukhi @loganrozanski could you please merge this PR if it looks good to you?

@srisukhi

srisukhi commented Oct 3, 2021

Copy link
Copy Markdown

Thanks for the heads up, @anomam.

@campanelli-sunpower can you take a look and merge if the PR looks good?

@kandersolar

Copy link
Copy Markdown
Contributor Author

I do think a note somewhere about different results would be a good idea -- it's only a minor difference, but exact reproducibility is important in some contexts, and it might save some users some pain if they know to expect differences with pvlib 0.9.0+. Whether that note should go in the change log, or maybe a docstring, or maybe just the narrative docs, I'm not sure. Let me know if you want me to add something like that to this PR :)

Also howdy @campanelli-sunpower, nice to see another pvlib name here!

@campanelli-sunpower

Copy link
Copy Markdown
Contributor

@kanderso-nrel (cc @anomam) Thanks for updating the comment for posterity, so that consumers will be aware of the presence of the error with earlier versions of pvlib. What are your thoughts about releasing this with a new lower limit of pvlib 0.9.0?

@kandersolar

Copy link
Copy Markdown
Contributor Author

I don't feel strongly one way or the other. Requiring pvlib>=0.9.0 is a bit strict considering it was only released a month ago and is breaking wrt the 0.8.x series. But getting different results based on which version of pvlib happens to be installed is not desirable either. I would probably lean towards increasing the minimum to 0.9.0 to prioritize correctness over consistency with older results. But I am not a pvfactors user myself so I'll defer to others for that decision.

@campanelli-sunpower

Copy link
Copy Markdown
Contributor

@anomam What are your thoughts on requiring pvlib>=0.9.0, in order to ensure users aren't affected by the known bug in earlier pvlib?

@anomam

anomam commented Oct 10, 2021

Copy link
Copy Markdown
Contributor

hey team @kanderso-nrel @campanelli-sunpower ! My preference would also be to set pvlib>=0.9.0. In my opinion we want pvfactors to be as accurate as possible, so if we know that there is a fix in a model, I think we should enforce its use even if it's inconsistent with previous versions.
Let's just make sure we put a note in the release notes! 🙏

@kandersolar

Copy link
Copy Markdown
Contributor Author

Requirement updated and note added :)

@campanelli-sunpower campanelli-sunpower left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update.

@campanelli-sunpower campanelli-sunpower merged commit 2da9668 into SunPower:master Oct 12, 2021
@kandersolar kandersolar deleted the pvlib090 branch October 12, 2021 21:08
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.

4 participants