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

Variableに衝突しない命名を使用する #180

Open
Syuparn opened this issue Nov 19, 2023 · 2 comments
Open

Variableに衝突しない命名を使用する #180

Syuparn opened this issue Nov 19, 2023 · 2 comments
Labels
バックエンド OpenFIsca Python API

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Nov 19, 2023

バックエンド、各 Variable の名前が衝突しないように命名規則を整理します。名前が衝突した/しそうなVariableに接頭辞を付けます。

参考:OpenFisca公式が推奨する命名規則
https://openfisca.org/doc/contribute/variables-naming.html#scopes-and-prefixes

アイデア

  • 衝突した際に接頭辞を付け区別
    • 例: 配偶者控除 -> 所得税_配偶者控除住民税_配偶者控除
  • 機械的に決められるように、ディレクトリ構成と命名を合わせる
    • Pythonのimportと同じ命名規則にする
    • 例: openfisca_japan/variables/東京都/福祉/受験生チャレンジ支援貸付.py受験生チャレンジ支援貸付可能
      • 仮に直接importする場合 from openfisca_japan.variables.東京都.福祉.受験生チャレンジ支援貸付 import 受験生チャレンジ支援貸付可能
      • 変数名 東京都_福祉_受験生チャレンジ支援貸付_受験生チャレンジ支援貸付
@Syuparn
Copy link
Contributor Author

Syuparn commented Nov 19, 2023

ある程度制度の理解が深まり、依存関係やディレクトリ構成が固まってから着手したほうが良さそう

@Syuparn
Copy link
Contributor Author

Syuparn commented Dec 9, 2023

📝 最大値、最小値のsuffixは命名の階層構造と区別できるよう __min, __max にする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
バックエンド OpenFIsca Python API
Projects
Status: No status
Development

No branches or pull requests

1 participant