Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#3,986 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

@anth-volk y travaille déjà.

Depuis le 20/10/2026.

  • #3987 par @anth-volk — ouverte

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
30/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
fastapi, flask, python
Domaine
api, backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
Python
Étoiles
18
Forks
33
Merge moyen
2 j 6 h
PR mergées (30 j)
32

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PolicyEngine/policyengine-api

Toutes les issues de PolicyEngine/policyengine-api

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.