8000 Update irradiance.aoi to use more reliable formula by kandersolar · Pull Request #1191 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Update irradiance.aoi to use more reliable formula #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't set name; break after first Series
  • Loading branch information
kandersolar committed Mar 17, 2021
commit 671cf1649ae8a123e2c640fa2cddbae728b3a482
2 changes: 1 addition & 1 deletion pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth):
for arg in [surface_tilt, surface_azimuth, solar_zenith, solar_azimuth]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's OK to assume that these Series have a common index, and stop the loop when one index if found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the new implementation preserve Series in --> Series out without this code?

I'm fine with dropping the name assignment and letting users deal with that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the new implementation preserve Series in --> Series out without this code?

Unfortunately it does not; the _spherical_to_cartesian function turns Series into 2-D numpy arrays. I don't immediately see a way around it that's cleaner than the "fix types at the end" idiom.

if hasattr(arg, 'index'):
aoi_value = pd.Series(aoi_value, index=arg.index)
aoi_value.name = 'aoi'
break

return aoi_value

Expand Down
0