Skip to content

Port housing market accounting fixes - #41

Merged
agurgone merged 1 commit into
mainfrom
bug/port-pr93-housing-market-accounting
May 22, 2026
Merged

Port housing market accounting fixes#41
agurgone merged 1 commit into
mainfrom
bug/port-pr93-housing-market-accounting

Conversation

@agurgone

@agurgone agurgone commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Ports the remaining housing-market accounting fixes from Fix housing market accounting combined main macro-main#93.
  • Applies the first reviewer recommendations by naming the private-renter and vacancy sentinels, keeping sale filtering index-based until final assignment, and adding focused regression coverage.
  • Fixes the rent-value regression orientation so runtime observed rent coefficients are estimated as rent on property value, matching new-rental offer pricing.

Details

  • Private renters now participate in housing demand via tenure status 3 instead of status 0.
  • Moving-owner sale listings now use household IDs, only list vacant or owner-occupied homes, and include -1/NaN vacancies in rental listings.
  • Sold properties are removed from the rental pool before rental matching.
  • Empty automatic matching returns an empty transaction frame instead of failing.
  • Housing clearing now drops infeasible financed/occupied sales before processing and avoids clearing a previous residence that has already received a new occupant.
  • Observed housing ratios are recorded after housing-market clearing, and object-typed transaction values are coerced before histogram/regression calculations.

Verification

  • /Users/andone/Documents/python_projects/INET-consumption/.venv/bin/ruff check macromodel/agents/households/func/property.py macromodel/agents/households/households.py macromodel/markets/housing_market/housing_market.py macromodel/markets/housing_market/func/clearing.py macromodel/country/country.py tests/test_macromodel/unit/test_agents/test_households/func/test_property_probability.py tests/test_macromodel/unit/test_agents/test_households/func/test_property_performance.py tests/test_macromodel/unit/test_country/test_country.py tests/test_macromodel/unit/test_markets/test_housing_market/test_housing_market.py
  • /Users/andone/Documents/python_projects/INET-consumption/.venv/bin/python -m pytest tests/test_macromodel/unit/test_agents/test_households/func/test_property_probability.py tests/test_macromodel/unit/test_agents/test_households/func/test_property_performance.py tests/test_macromodel/unit/test_agents/test_households/test_households.py tests/test_macromodel/unit/test_country/test_country.py tests/test_macromodel/unit/test_markets/test_housing_market/test_housing_market.py
  • /Users/andone/Documents/python_projects/INET-consumption/.venv/bin/python -m pytest tests/test_macrocalib/unit/test_sampler.py

@agurgone
agurgone force-pushed the bug/port-pr93-housing-market-accounting branch from 9904506 to 06cab5a Compare May 22, 2026 19:10
@agurgone
agurgone merged commit 4badc82 into main May 22, 2026
4 checks passed
@agurgone
agurgone deleted the bug/port-pr93-housing-market-accounting branch May 22, 2026 20:02
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.

1 participant