Toggle-cycle validation rejects a correctly declared cycle that disagrees with its own inference

Aperta
#202 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

The check lives in facts.py, where the inferred cycle (median gap between starts of on-runs) is compared with the declared Upgrade.toggle_cycle and raises the 'disagrees with the toggle timing' error. Read how that inference is computed and how the runs are derived from the frame before touching it. Done would mean a declared cycle is accepted when it is self-consistent with the on/off runs, and a mismatch becomes a warning, with tests covering a multi-slot controller.

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

Descrizione

v1

Upgrade.toggle_cycle, given explicitly, is checked against a cycle inferred from the frame (the median gap between the starts of on-runs) and raises if they disagree: upgrade {name!r}: toggle_cycle {X} disagrees with the toggle timing, whose cycle is {Y} (facts.py). That inference assumes every on/off run is a whole cycle; a controller with more than one on/off slot per cycle (e.g. two unequal-length slots in random order within each cycle) produces runs shorter than, and a median on-to-on gap larger than, its true cycle — the inferred value is then a multiple of the real one, and the check rejects the correct declared cycle outright. The only workaround today is bypassing validation with object.__setattr__.

Suggestion: let a declared toggle_cycle win, and check it for self-consistency with the frame instead (every on and off run is a whole number of half-cycles, run starts land on the declared grid), downgrading a mismatch to a warning

Lingua principale
Python
Stelle
29
Fork
13
Merge medio
1g 6h
PR unite (30g)
33

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 resgroup/wind-up

Tutte le issue di resgroup/wind-up

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.