-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Function ghi_from_poa_driesse_2023
cannot have None default value for dni_extra
optional parameter
#2279
Comments
I found a solution looking to another documentation example where it creates the required variable: https://pvlib-python.readthedocs.io/en/stable/gallery/irradiance-transposition/plot_rtranpose_year.html So the issue can be solved modifying the final code in the following way to add
Still an issue Note: This example has random |
Confirmed. Every test of The private function |
My bad! I am currently inclined to provide fewer defaults to make people think more about what they're doing. So another option would be to remove the default value here. |
I too fret about default values! One thought I’ve had is to make such
parameters Optional[float] (so a float or None is expected), but do NOT
give it a default value. In this way, the user must explicitly choose and
pass None to “opt in” to using the default value. A downside here is that
the (arguably) breaking change of changing the default value is more hidden
because it no longer appears right in the function signature.
Mark Campanelli
LinkedIn <https://www.linkedin.com/in/markcampanelli/>
Intelligent Measurement Systems LLC
<https://intelligentmeasurementsystems.com>
Try PVfit <https://pvfit.app> today!
…On Wed, Oct 30, 2024 at 04:45 Anton Driesse ***@***.***> wrote:
My bad! I am currently included to provide fewer defaults to make people
think more about what they're doing. So another option would be to remove
the default value here.
—
Reply to this email directly, view it on GitHub
<#2279 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAISX42JYATUVPLRXQHHM2TZ6C2DZAVCNFSM6AAAAABQ2IYO7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBWGUZTCMRSG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Requiring |
My preference is for no default value to be consistent with |
Describe the bug
The function
ghi_from_poa_driesse_2023
defines the parameterdni_extra
as optional and default to "None", but that causes a runtime error.dni_extra
refers to "Extraterrestrial direct normal irradiance"Function: https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.irradiance.ghi_from_poa_driesse_2023.html
To Reproduce
Output of previous code
Expected behavior
No need to define "dni_extra", or do not define it as optional
Versions:
pvlib.__version__
: 0.11.1pandas.__version__
: 1.5.2The text was updated successfully, but these errors were encountered: