Register weighted-microdata rules: weights aren't values
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 18/100
Direzione di ricerca
The work is registering four rules in rules/registry.toml plus AST guards for the shapes they describe. Read the issue's list of rule IDs and the cited Simulation API line first, then check whether linked pull request #3938 already covers them, since it is still open. Done means the three guarded rules are enforced with no findings on the current code, and the doc-only rule is registered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
A weighted MicroSeries or MicroDataFrame weights every .sum(), .mean() and .count(). Aggregating a weight column through one weights it by itself, and returns the sum of squared weights.
That happened in the Simulation API (PolicyEngine/policyengine-sim-api#766, fixed by PolicyEngine/policyengine-sim-api#767). budget.households was about 10^4 times too high on every run, and its test missed it because it used plain pd.DataFrames.
Once the unused economy comparison module is removed, nothing in the Public API handles microdata. Nothing stops new code from making the same mistake, though.
Proposal
Phase 1 step 1.9. Register the rule that weights aren't values, plus AST guards for the shapes a source check can recognise, in rules/registry.toml:
api.microdata.weights-not-values(doc-only): weights, values, labels and counts each allow different operations.api.microdata.weights-not-aggregated-as-values: a weight is never the value of a weightedMicroSeries, the variable of a weighted aggregator, orframe[<weight>]followed by a weighted reduction.api.microdata.weight-stripping-confined: raw values (np.array,.values,.to_numpy()and so on) are read from weighted microdata only in a designated module. None is designated yet.api.microdata.unweighted-series-are-labels: aMicroSeriesbuilt withoutweights=is only a grouping or filter key.
The aggregation rule's proof is the real pre-#767 Simulation API line. With no current code in scope, all three guarded rules start enforced, with no findings.
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 33
- Merge medio
- 1g 20h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-api
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
PolicyEngine/policyengine-api#3911 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
PolicyEngine/policyengine-api#3910 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
PolicyEngine/policyengine-api#3946 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
PolicyEngine/policyengine-api#3945 ·
I maintainer di solito rispondono entro 2 giorni
-
Remove the unused economy comparison moduleForse già presa @anth-volk l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 18/100
PolicyEngine/policyengine-api#3935 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di PolicyEngine/policyengine-api
Issue simili
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsApertaarea: tools documentation good first issue ready for a contributor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
eyalgolan/statecraft-israel#873 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add cover art to song rowsApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno