Skip to content

Conversation

echedey-ls
Copy link

@echedey-ls echedey-ls commented Aug 13, 2025

Closes #94

For extra control over the source code (and the docstring!), and easing a pure-python reference for translating into other languages. Numba has been stripped off, plus adding some other code stylisation and opinionated best practices.

Feel free to make any and all objections.

@AdamRJensen
Copy link
Member

There are a lot of functions in this PR. Should most of them be made private functions?

@kandersolar How should we give credit / copyright to pvlib/you?

@kandersolar
Copy link
Member

If this code was modified from pvlib's code, we will need to also include pvlib's license, per this clause:

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

@echedey-ls
Copy link
Author

I midly changed my mind about having stand-alone implementations. We aren't going to rewrite others too and, except for that performance PR at pvlib, both algorithm and interface should be pretty stable.

I guess I can instead wrap pvlib's call into a locally-documented public function and stop there. Pretty much like it has been made to other external-dep algorithms. While not cleaner (the code, I mean, with the numba decorators), it shouldn't be difficult to translate to other languages by navigating to the source. So, unless you object, I will change the scope of this PR, keep the fixed typo, link to pvlib's source, and unpin pvlib version from the docs optional dependency set.

@AdamRJensen
Copy link
Member

I midly changed my mind about having stand-alone implementations. We aren't going to rewrite others too and, except for that performance PR at pvlib, both algorithm and interface should be pretty stable.

I guess I can instead wrap pvlib's call into a locally-documented public function and stop there. Pretty much like it has been made to other external-dep algorithms. While not cleaner (the code, I mean, with the numba decorators), it shouldn't be difficult to translate to other languages by navigating to the source. So, unless you object, I will change the scope of this PR, keep the fixed typo, link to pvlib's source, and unpin pvlib version from the docs optional dependency set.

Sounds great to me!

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.

Add own version of pvlib's spa solar position algorithm
3 participants