Handle flake8 issues in part of the codebase.#2643
Conversation
|
Two flake8 issues are raised here which were already in the original code:
I suggest adding a # noqa: E271 in these cases, since I imagine they simply mimic the original equations |
| # a better way to do it. | ||
| if isinstance(datetime_or_doy, pd.DatetimeIndex): | ||
| to_doy = tools._pandas_to_doy # won't be evaluated unless necessary | ||
| def to_datetimeindex(x): return x # noqa: E306 |
There was a problem hiding this comment.
E704 multiple statements on one line (def)
| import pandas as pd | ||
| from scipy.integrate import trapezoid | ||
|
|
||
| from warnings import warn |
There was a problem hiding this comment.
F401 'warnings.warn' imported but unused
| import numpy as np | ||
| import pandas as pd | ||
| from pvlib.tools import sind | ||
| from pvlib._deprecation import warn_deprecated |
There was a problem hiding this comment.
F401 'warnings.warn' imported but unused
|
|
||
| # Explicit solutions where Gsh=0 | ||
| if np.any(idx_z): | ||
| V[idx_z] = a[idx_z] * np.log1p((IL[idx_z] - I[idx_z]) / I0[idx_z]) - \ |
There was a problem hiding this comment.
F401 'warnings.warn' imported but unused
|
The preserved check annotation shows the current flake8 failure is: The earlier comment also points to Minimal patch: diff --git a/pvlib/spa.py b/pvlib/spa.py
@@
- l = np.rad2deg(l_rad)
+ l = np.rad2deg(l_rad) # noqa: E741
return l % 360
diff --git a/pvlib/singlediode.py b/pvlib/singlediode.py
@@
- I = I[idx_p]
+ I = I[idx_p] # noqa: E741These look like formula variables, so suppressing |
docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.Note: will update the whatsnew in the 2nd PR (IDing the two of them)