Include each variable's quantity type (stock or flow) in the country metadata
Les mainteneurs répondent en général sous 3 jours
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 30/100
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 ashousehold_vehicles_valueorhousehold_rental_property_valuein the US model, ormortgage_debtin the UK model;"flow": an amount over a period, such asemployment_incomeorrent.
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
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/policyengine-api
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
PolicyEngine/policyengine-api#3911 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
PolicyEngine/policyengine-api#3910 ·
Les mainteneurs répondent en général sous 3 jours
-
Report each day's production telemetry error groups as GitHub issuesPeut-être pris @anth-volk l’a pris aujourd’hui. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
PolicyEngine/policyengine-api#3989 ·
Les mainteneurs répondent en général sous 3 jours
-
Enforce SQLAlchemy-only database connections and Alembic-only schema changesPeut-être pris @anth-volk l’a pris il y a 1 jour. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
PolicyEngine/policyengine-api#3978 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
PolicyEngine/policyengine-api#3956 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de PolicyEngine/policyengine-api
Issues similaires
-
Uninstall guide omits the CloudWatch log groups AWS CodeBuild creates for useCodeBuild pipelinesOuvertebug documentation
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
awslabs/visual-asset-management-system#552 ·
Les mainteneurs répondent en général sous 1 jour
-
netbox status: needs triage type: documentation
Difficulté 1/5 Moins d'une heure Accessibilité débutants 76/100
netbox-community/netbox#23460 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
awslabs/threat-composer#362 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ansys/pyansys-common-mcp#213 ·
Les mainteneurs répondent en général sous 3 jours