Describe the bug
Since 0.15.1, pvlib.tracking.calc_surface_orientation returns surface_azimuth as a shape-(1,) array when tracker_theta is a scalar, while surface_tilt is still a scalar. In 0.15.0 both were scalars.
This looks related to #2747, which was also a shape regression in this function from #2702. #2749 fixed the 2-D case in 0.15.2, but the scalar case is still present in 0.16.1.
To Reproduce
import pvlib
pvlib.tracking.calc_surface_orientation(-30, 0, 180)
pvlib 0.15.0:
{'surface_tilt': np.float64(29.999999999999993), 'surface_azimuth': np.float64(90.0)}
pvlib 0.15.1 through 0.16.1:
{'surface_tilt': np.float64(29.999999999999993), 'surface_azimuth': array([90.])}
Expected behavior
For a scalar tracker_theta, surface_azimuth is a scalar, consistent with surface_tilt and with 0.15.0.
Versions:
pvlib.__version__: 0.16.1
pandas.__version__: 3.0.6
numpy.__version__: 2.5.3
- python: 3.12
Describe the bug
Since 0.15.1,
pvlib.tracking.calc_surface_orientationreturnssurface_azimuthas a shape-(1,)array whentracker_thetais a scalar, whilesurface_tiltis still a scalar. In 0.15.0 both were scalars.This looks related to #2747, which was also a shape regression in this function from #2702. #2749 fixed the 2-D case in 0.15.2, but the scalar case is still present in 0.16.1.
To Reproduce
pvlib 0.15.0:
{'surface_tilt': np.float64(29.999999999999993), 'surface_azimuth': np.float64(90.0)}pvlib 0.15.1 through 0.16.1:
{'surface_tilt': np.float64(29.999999999999993), 'surface_azimuth': array([90.])}Expected behavior
For a scalar
tracker_theta,surface_azimuthis a scalar, consistent withsurface_tiltand with 0.15.0.Versions:
pvlib.__version__: 0.16.1pandas.__version__: 3.0.6numpy.__version__: 2.5.3