Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
echedey-ls committed Jan 25, 2024
1 parent 337f7f1 commit 0923109
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pvlib/shading.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def sky_diffuse_passias(masking_angle):
return 1 - cosd(masking_angle/2)**2


def projected_solar_zenith_angle(axis_tilt, axis_azimuth, solar_zenith, solar_azimuth):
def projected_solar_zenith_angle(axis_tilt, axis_azimuth,
solar_zenith, solar_azimuth):
r"""
Calculate projected solar zenith angle in degrees.
This is the solar zenith angle projected onto the tracker rotation plane or
Expand Down
12 changes: 9 additions & 3 deletions pvlib/tests/test_shading.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def singleaxis_psz_implementation_port_data():


def test_projected_solar_zenith_angle_numeric(
true_tracking_angle_and_inputs_NREL, singleaxis_psz_implementation_port_data
true_tracking_angle_and_inputs_NREL,
singleaxis_psz_implementation_port_data
):
psz_func = shading.projected_solar_zenith_angle
axis_tilt, axis_azimuth, timedata = true_tracking_angle_and_inputs_NREL
Expand All @@ -218,15 +219,20 @@ def test_projected_solar_zenith_angle_numeric(
assert_allclose(psz, -timedata["True-Tracking"], atol=1e-3)

# test implementation port from tracking.singleaxis
axis_tilt, axis_azimuth, singleaxis = singleaxis_psz_implementation_port_data
axis_tilt, axis_azimuth, singleaxis = \
singleaxis_psz_implementation_port_data
psz = pvlib.tracking.singleaxis(
singleaxis["Apparent Zenith"],
singleaxis["Solar Azimuth"],
axis_tilt,
axis_azimuth,
backtrack=False,
)
assert_allclose(psz["tracker_theta"], singleaxis["tracker_theta"], atol=1e-6)
assert_allclose(
psz["tracker_theta"],
singleaxis["tracker_theta"],
atol=1e-6
)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 0923109

Please sign in to comment.