Model version publishes the new UK firm entity as a person

未关闭 适合新手
#764 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@vahid-ahmadi 已经在做这个了。

开始于 2026年11月23日。

  • #765 来自 @vahid-ahmadi —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

从 src/policyengine/tax_benefit_models/common/model_version.py 中的 _populate_entities 开始,目前每个没有成员的根 population 都被标记为 is_person。阅读 policyengine-core 的 person_entity 规则,了解它如何选择单个 person 实体,然后更改发布步骤,只标记该实体,并按 key 进行比较,以便克隆系统仍然匹配。用 tests/test_model_entities.py 验证(它应该为 UK 找到恰好一个 is_person 实体,是 person,而不是 firm);data/v2/catalog/extraction.py 中的下游目录检查正是这件事重要的原因。

由索引模型根据 Issue 内容生成。

描述

policyengine-core flags any root population with no members as is_person. policyengine-uk's new firm entity (PolicyEngine/policyengine-uk#2940) is one, so _populate_entities in src/policyengine/tax_benefit_models/common/model_version.py would publish two person entities for UK: person and firm.

Effects once a policyengine-uk release with firm is certified against this package:

  • tests/test_model_entities.py fails, which blocks UK release certification.
  • The policyengine-api v2 catalog check for "exactly one person entity" (data/v2/catalog/extraction.py) fails.
  • app-v2 would offer firm inputs as person variables.

Proposed fix: publish is_person only for the system's person entity (the first core entity flagged is_person, matching core's person_entity rule), compared by key so cloned systems still work.

🤖 Generated with Claude Code

主要语言
Python
星标
8
派生
10
平均合并
1 天 22 小时
30 天内合并 PR
17

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine.py 的其他 Issue

查看 PolicyEngine/policyengine.py 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。