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
changed ImportError to ModuleNotFoundError for spa_calc
  • Loading branch information
PhilBrk8 committed Dec 22, 2024
commit 8f64ce98f326c5a892f51db2bb1448aae85ee159
8 changes: 5 additions & 3 deletions pvlib/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@

try:
from pvlib.spa_c_files.spa_py import spa_calc
except ImportError:
raise ImportError('Could not import built-in SPA calculator. ' +
'You may need to recompile the SPA code.')
except ModuleNotFoundError as e:
raise ModuleNotFoundError(

Check warning on line 194 in pvlib/solarposition.py

View check run for this annotation

Codecov / codecov/patch

pvlib/solarposition.py#L193-L194

Added lines #L193 - L194 were not covered by tests
"Could not import built-in SPA calculator. "
"You may need to recompile the SPA code."
) from e

time_utc = tools._pandas_to_utc(time)

Expand Down Expand Up @@ -485,9 +487,9 @@

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

Check failure on line 490 in pvlib/solarposition.py

View workflow job for this annotation

GitHub Actions / flake8-linter

W293 blank line contains whitespace

# initialize a PyEphem observer

Check failure on line 492 in pvlib/solarposition.py

View workflow job for this annotation

GitHub Actions / flake8-linter

E303 too many blank lines (2)
obs = ephem.Observer()
obs.lat = str(latitude)
obs.lon = str(longitude)
Expand Down Expand Up @@ -923,9 +925,9 @@
pd.Series. Earth-sun distance in AU.
"""


Check failure on line 928 in pvlib/solarposition.py

View workflow job for this annotation

GitHub Actions / flake8-linter

W293 blank line contains whitespace

sun = ephem.Sun()

Check failure on line 930 in pvlib/solarposition.py

View workflow job for this annotation

GitHub Actions / flake8-linter

E303 too many blank lines (3)
earthsun = []
for thetime in tools._pandas_to_utc(time):
# older versions of pyephem ignore timezone when converting to its
Expand Down
Loading
0