Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#3,986 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@anth-volk がすでに取り組んでいます。

2026年10月20日 から。

  • #3987 @anth-volk による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
fastapi, flask, python
領域
api, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
18
フォーク
33
平均マージ
2日 15時間
マージ済み PR(30日)
35

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine-api のほかの issue

PolicyEngine/policyengine-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。