Include each variable's quantity type (stock or flow) in the country metadata
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 30/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 18
- Forks
- 33
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 32
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/policyengine-api
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
PolicyEngine/policyengine-api#3911 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
PolicyEngine/policyengine-api#3910 ·
Los mantenedores suelen responder en 3 días
-
Report each day's production telemetry error groups as GitHub issuesPosiblemente ocupada @anth-volk la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
PolicyEngine/policyengine-api#3989 ·
Los mantenedores suelen responder en 3 días
-
Enforce SQLAlchemy-only database connections and Alembic-only schema changesPosiblemente ocupada @anth-volk la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
PolicyEngine/policyengine-api#3978 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
PolicyEngine/policyengine-api#3956 ·
Los mantenedores suelen responder en 3 días
Todos los issues de PolicyEngine/policyengine-api
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pgvector/pgvector-python#169 ·
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitPosiblemente ocupada @MohabMohie la tomó hoy. Abiertoagentic
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
huggingface/smolagents#3045 ·
Los mantenedores suelen responder en 1 día