Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,986 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@anth-volk ci sta già lavorando.

Dal 20/10/2026.

  • #3987 di @anth-volk — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
fastapi, flask, python
Ambito
api, backend

Direzione di ricerca

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.

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

Descrizione

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.
Lingua principale
Python
Stelle
18
Fork
33
Merge medio
2g 18h
PR unite (30g)
36

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

Tutte le issue di PolicyEngine/policyengine-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.