Replies: 1 comment 5 replies
-
One downside is that the scipy functions seem to be slower than ours. Of course whether the slowdown is meaningful is another question. In [1]: from scipy.special import sindg, cosdg, tandg
...: from pvlib.tools import sind, cosd, tand
...: import numpy as np
...:
...: x = np.linspace(-1, 1, 10_000)
In [2]: %timeit _ = sind(x)
43 µs ± 898 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
In [3]: %timeit _ = sindg(x)
399 µs ± 4.47 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
In [4]: %timeit _ = cosd(x)
42.4 µs ± 698 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
In [5]: %timeit _ = cosdg(x)
435 µs ± 6.68 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
In [6]: %timeit _ = tand(x)
49.5 µs ± 1.11 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
In [7]: %timeit _ = tandg(x)
103 µs ± 2.35 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
In [8]: import scipy; scipy.__version__
Out[8]: '1.8.1' |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just came across this in scipy:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.cosdg.html#scipy.special.cosdg
Any objections to using them in pvlib?
Beta Was this translation helpful? Give feedback.
All reactions