significance.py emits RuntimeWarning: Mean of empty slice during the benchmark tests

Aperta Adatta ai principianti
#1,303 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
numpy, python

Direzione di ricerca

Inizia dalle quattro righe segnalate in faircode/significance.py e dai casi di benchmark in tests/test_benchmark.py; esegui il comando pytest dell’issue per riprodurre gli avvisi. Individua quali input creano un gruppo vuoto, poi verifica come i test di significatività gestiscono il valore mancante esplicito e la nota. Il lavoro è completato quando è coperto un test per un gruppo vuoto e l’esecuzione completa non emette alcun RuntimeWarning da significance.py.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug testing

Where: faircode/significance.py (lines 48, 57, 72, 86), tests/test_benchmark.py.

Current gap: The full test run reports 245 warnings; among them are RuntimeWarning: Mean of empty slice from four lines of significance.py and invalid value encountered in divide, 15 of them in tests/test_benchmark.py, which means a group with no rows reaches numpy.mean and the result is NaN without the code saying so.

Repro:

python3 -m pytest tests/test_benchmark.py -q -W error::RuntimeWarning

Suggested approach: Find which inputs produce an empty slice, return an explicit missing value (and a note) instead of calling mean on nothing, and turn these RuntimeWarnings into errors in the significance tests.

Done when: the full run emits no RuntimeWarning from significance.py and a test covers the empty-group input.

Lingua principale
HTML
Stelle
47
Fork
45
Merge medio
2h 47m
PR unite (30g)
92

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di yakew7/Fair-Code

Tutte le issue di yakew7/Fair-Code

Issue simili

Altre issue su Machine Learning

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.