8000 updated imports in the solarposition.py file and applied ruff linter+formatter to the whole directory tree by PhilBrk8 · Pull Request #2338 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

updated imports in the solarposition.py file and applied ruff linter+formatter to the whole directory tree #2338

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
moved ephem imports to the top of the file
  • Loading branch information
PhilBrk8 committed Dec 22, 2024
commit 75c114aa373cc1d464365e310c50517cbfa12773
16 changes: 3 additions & 13 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import warnings
from importlib import reload

import ephem
import numpy as np
import pandas as pd
import scipy.optimize as so
Expand Down Expand Up @@ -484,7 +485,7 @@ def _ephem_to_timezone(date, tzinfo):

def _ephem_setup(latitude, longitude, altitude, pressure, temperature,
horizon):
import ephem


# initialize a PyEphem observer
obs = ephem.Observer()
Expand Down Expand Up @@ -542,11 +543,6 @@ def sun_rise_set_transit_ephem(times, latitude, longitude,
pyephem
"""

try:
import ephem
except ImportError:
raise ImportError('PyEphem must be installed')

# times must be localized
if times.tz:
tzinfo = times.tz
Expand Down Expand Up @@ -627,12 +623,6 @@ def pyephem(time, latitude, longitude, altitude=0., pressure=101325.,
spa_python, spa_c, ephemeris
"""

# Written by Will Holmgren (@wholmgren), University of Arizona, 2014
try:
import ephem
except ImportError:
raise ImportError('PyEphem must be installed')

time_utc = tools._pandas_to_utc(time)

sun_coords = pd.DataFrame(index=time)
Expand Down Expand Up @@ -933,7 +923,7 @@ def pyephem_earthsun_distance(time):
pd.Series. Earth-sun distance in AU.
"""

import ephem


sun = ephem.Sun()
earthsun = []
Expand Down
0