Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Consider updating pvlib.tracking.singleaxis() to return zeros (or similar) for nighttime instead of NaNs

Offen
#2,539 14 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
22/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
backend

Rechercherichtung

The NaN output comes from the night-time branch of singleaxis in pvlib/tracking.py, around the line the issue links. Read the function and the tests in pvlib/tests/test_tracking.py to see which outputs are NaN after sunset. Done means the maintainers have agreed on zero versus NaN for each output, or an opt-in parameter, with tests and docs updated. The design choice is still open, so settle it in the thread before coding.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Is your feature request related to a problem? Please describe.
pvlib.tracking.singleaxis returns NaNs for intervals where the sun is below the horizon. This can result in NaNs propogating to lots of other pvlib outputs and can cause confusion, other issues, etc. See https://groups.google.com/g/pvlib-python/c/ZeVmTC7eddY as an example.

It appears to happen here:

https://github.com/pvlib/pvlib-python/blob/6dfeaf8ee97db6a7a8f3c8109eed8b5d285c4e41/pvlib/tracking.py#L155

Describe the solution you'd like
Perhaps change the default to be zero for surface_tilt and tracker_theta (and whatever is most appropriate for aoi and surface_azimuth). Or have an optional input for pvlib.tracking.singleaxis to specify whether it returns NaNs or numbers at night.

Describe alternatives you've considered
Applying .fillna(0) (or similar) to the output of pvlib.tracking.singleaxis is what I typically do.

Additional context
It looks like this zero vs nan situation was briefly discussed in https://github.com/pvlib/pvlib-python/issues/569. It seems it would be worth further discussion. Is there a significant reason that NaN is the output at night?

fillna(0) is used in the gallery here and here, but not here.

Tagging @cwhanse.

Vorherrschende Sprache
Python
Sterne
1.7k
Forks
1.2k
Ø Merge
3 T. 18 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus pvlib/pvlib-python

Alle Issues in pvlib/pvlib-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.