Skip to content

calc_surface_orientation returns a 1-element array for surface_azimuth when tracker_theta is scalar (regression in 0.15.1) #2881

Description

@kdebrab

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions