Register weighted-microdata rules: weights aren't values
Maintainer antworten meist innerhalb von 2 Tagen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 18/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 18
- Forks
- 33
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 27
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-api
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
PolicyEngine/policyengine-api#3911 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
PolicyEngine/policyengine-api#3910 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
PolicyEngine/policyengine-api#3946 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
PolicyEngine/policyengine-api#3945 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Remove the unused economy comparison moduleEvtl. vergeben @anth-volk hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 18/100
PolicyEngine/policyengine-api#3935 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in PolicyEngine/policyengine-api
Ähnliche Issues
-
tunneld on Windows: Wi-Fi devices are not discovered because uvicorn runs on a ProactorEventLoopOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
doronz88/pymobiledevice3#2051 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Remove DatacircleOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
collabnix/awesome-mcp-lists#230 ·
Maintainer antworten meist innerhalb von 9 Tagen
-
Groc schedules with out of range values pass config validation and fail later when the scheduler is builtEvtl. vergeben @auraseb hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
autowarefoundation/autoware_carla_scenario#342 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ianktoo/project-monitor#14 ·