Skip to content

Commit b20ca53

Browse files
author
Daniel Lassahn
committed
Linter optimisation
1 parent bf88e3c commit b20ca53

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pvlib/solarposition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,8 @@ def spencer_mc(times, latitude, longitude):
15231523
ha = np.radians(tlt * 15)
15241524

15251525
# Calculate sun elevation.
1526-
sin_sun_elevation = (np.sin(declination) * np.sin(lat) +
1527-
np.cos(declination) * np.cos(lat) * np.cos(ha))
1526+
sin_sun_elevation = np.sin(declination) * np.sin(lat)
1527+
sin_sun_elevation += np.cos(declination) * np.cos(lat) * np.cos(ha)
15281528

15291529
# Compute the sun's elevation and zenith angle.
15301530
elevation = np.arcsin(sin_sun_elevation)

pvlib/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def datetime_to_julian(times):
447447
"""
448448

449449
delta = times - DT_2000
450+
delta_julians = (delta.seconds + delta.microseconds / 1e6)
450451
return (
451-
JULIAN_2000 + delta.days +
452-
(delta.seconds + delta.microseconds / 1e6) / DAY_SECONDS
452+
JULIAN_2000 + delta.days + delta_julians / DAY_SECONDS
453453
)

0 commit comments

Comments
 (0)