Model version publishes the new UK firm entity as a person

Open Beginner friendly
#764 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@vahid-ahmadi is already working on this.

Since Nov 23, 2026.

  • #765 by @vahid-ahmadi — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Start in src/policyengine/tax_benefit_models/common/model_version.py at _populate_entities, where each root population with no members is currently flagged is_person. Read policyengine-core's person_entity rule to see how it picks the single person entity, then change the publishing step to mark only that entity, comparing by key so cloned systems still match. Verify with tests/test_model_entities.py (it should find exactly one is_person entity for UK, person, not firm); the downstream catalog check in data/v2/catalog/extraction.py is the reason it matters.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
8
Forks
10
Avg merge
1d 22h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/policyengine.py

All issues in PolicyEngine/policyengine.py

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.