Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make testで全テストの確認ができるようにする #24

Open
Syuparn opened this issue Feb 14, 2023 · 0 comments
Open

make testで全テストの確認ができるようにする #24

Syuparn opened this issue Feb 14, 2023 · 0 comments
Labels
バックエンド(Python API) バックエンドとなるOpenFiscaのPython APIです。入力されたユーザーの情報を下に、各種手当の計算を行います。

Comments

@Syuparn
Copy link

Syuparn commented Feb 14, 2023

現在、make test を実行すると、可処分所得に関連する以下のテストが失敗してしまいます。

  • openfisca_japan/tests/ベーシックインカム.yaml
  • openfisca_japan/tests/住宅手当.yaml
  • openfisca_japan/tests/可処分所得.yaml

解消のためには、テストまたは実装の修正が必要です。

詳細

  • エラー1: periodの形式エラー
    上記3ファイルすべて、periodの単位の不整合で失敗しました。

  • テストファイル: 月(month)指定

  • 実装(variables classの definition_period 属性): 日(day)指定

ValueError: Unable to set a value for variable "年齢" for month-long period "2015-11".

ValueError: Unable to set a value for variable "家賃" for month-long period "2016-01".

openfisca_core.errors.period_mismatch_error.PeriodMismatchError: Unable to set a value for variable "所得" for month-long period "2015-01".
  • エラー2: 可処分所得の結果がテストと異なる

期待する値と実装が返す値が食い違っていました。算出方法を把握できていないのですが、テスト/実装どちらかに合わせる必要があると思います。

https://github.com/project-inclusive/OpenFisca-Shibuya/blob/main/openfisca_japan/tests/%E5%8F%AF%E5%87%A6%E5%88%86%E6%89%80%E5%BE%97.yaml#L53

/app/openfisca_japan/tests/可処分所得.yaml:
  Test '人物 earning 2500 in Jan 2017':
    可処分所得@2017-01-01: [100150.] differs from 100200.0 with an absolute margin [50.] > 0

備考

上記テスト及び関連実装は、渋谷区の子育て支援制度の計算には不要です。

@SnoozingJellyfish SnoozingJellyfish added the バックエンド(Python API) バックエンドとなるOpenFiscaのPython APIです。入力されたユーザーの情報を下に、各種手当の計算を行います。 label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
バックエンド(Python API) バックエンドとなるOpenFiscaのPython APIです。入力されたユーザーの情報を下に、各種手当の計算を行います。
Projects
None yet
Development

No branches or pull requests

2 participants