Skip to content

Conversation

@ramaroesilva
Copy link
Contributor

@ramaroesilva ramaroesilva commented Dec 24, 2025

  • Contributes to pvlib codebase not compliant with flake8 #2642 (requires a 2nd PR that handles the rest of non-compliant files)
  • I am familiar with the contributing guidelines
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for 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`).
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including 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)

@ramaroesilva
Copy link
Contributor Author

Two flake8 issues are raised here which were already in the original code:

  • .\pvlib\singlediode.py:792:9: E741 ambiguous variable name 'I'
  • .\pvlib\spa.py:475:5: E741 ambiguous variable name 'l'

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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

E704 multiple statements on one line (def)

import pandas as pd
from scipy.integrate import trapezoid

from warnings import warn
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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]) - \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

F401 'warnings.warn' imported but unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant