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

Include each variable's quantity type (stock or flow) in the country metadata

Offen
#3,986 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@anth-volk arbeitet bereits daran.

Seit 20.10.2026.

  • #3987 von @anth-volk — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
30/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
fastapi, flask, python
Bereich
api, backend

Rechercherichtung

Start with PolicyEngineCountry.build_variables in policyengine_api/country.py and check how each variable exposes its quantity type. Add the requested quantityType field with the stock or flow value, then verify the shared metadata document includes it for variables such as household_rental_property_value. A linked pull request is already open, so this work is underway.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

What

Add each variable's quantity type to the variable descriptions that GET /{country_id}/metadata returns, as quantityType, with the value "stock" or "flow".

"household_rental_property_value": {
  "definitionPeriod": "year",
  "quantityType": "stock",
  "unit": "currency-USD",
  ...
}

Why

PolicyEngine core gives every variable a quantity_type:

  • "stock": a balance or value at one point in time, such as household_vehicles_value or household_rental_property_value in the US model, or mortgage_debt in the UK model;
  • "flow": an amount over a period, such as employment_income or rent.

A model sets it explicitly, or core picks a default: "stock" for yes-or-no, whole-number, list, text and date variables and for rates (unit /1), and "flow" for every other number.

The Public API's metadata leaves it out, so clients can't tell a balance from an amount per year. PolicyEngine/policyengine-app-v2#1360 shows "Annually" under each money input in the household builder, and leaves it off for stocks, but it can only do that once the metadata says which variables are stocks. Until then, money stocks such as "Rental property value" are labelled "Annually".

Scope

  • One new field per variable in PolicyEngineCountry.build_variables (policyengine_api/country.py). Both the Flask route and the native FastAPI route serve this same document, so both get the field.
  • Existing fields are unchanged. The field adds one short string per variable to a document that is already about 70MB for the US.
  • No database, route, or deployment change.
Vorherrschende Sprache
Python
Sterne
18
Forks
33
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
56

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 PolicyEngine/policyengine-api

Alle Issues in PolicyEngine/policyengine-api

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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