Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

Summary

Sets the household_weight variable's default value to 1 instead of 0.

In Python 3.13, microdf errors when running household simulations that don't provide weights because the default value of 0 causes division issues. Setting the default to 1 represents a single household and allows simulations to work without explicitly setting weights.

Closes #6400

Test plan

  • Added unit test verifying default value is 1
  • All existing tests pass

🤖 Generated with Claude Code

In Python 3.13, microdf errors when running household simulations that
don't provide weights because the default value of 0 causes division
issues. This sets the default to 1, which represents a single household
and allows simulations to work without explicitly setting weights.

Closes PolicyEngine#6400

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6c8cb6a) to head (a88e581).
⚠️ Report is 93 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##           master     #6864       +/-   ##
============================================
+ Coverage   72.92%   100.00%   +27.07%     
============================================
  Files        3252         1     -3251     
  Lines       46840         8    -46832     
  Branches      243         0      -243     
============================================
- Hits        34159         8    -34151     
+ Misses      12667         0    -12667     
+ Partials       14         0       -14     
Flag Coverage Δ
unittests 100.00% <100.00%> (+27.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set household weight to default to 1

1 participant