Skip to content

Report aggregate hours worked (N) in addition to effective labor (L) - #1228

Merged
jdebacker merged 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:report-hours-worked
Sep 26, 2026
Merged

jdebacker merged 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:report-hours-worked

Conversation

@arihantlodha-cmd

Copy link
Copy Markdown
Contributor

What this does

Closes #709. Aggregate labor L weights each household's hours by its effective-labor-units profile e, so it does not directly map to hours worked when productivity varies across households. This adds an aggregate hours measure N that sums hours without the e weighting:

60528N_t = \sum_s \sum_j \omega_{s,t}\lambda_j n_{j,s,t}60528

Changes

Testing

Adds test_get_N (SS and TPI) checking the result against an explicit index-by-index loop, mirroring test_get_L. A baseline SS run stores N next to L: with the default normalized e profile they coincide (L = 0.3330, N = 0.3333); they diverge once e is not mean-one, which is the case this separate measure is for. ruff check/format clean.

Closes PSLmodels#709. Aggregate labor L weights each household's hours by its
effective-labor-units profile e, so it does not directly map to hours
worked when productivity varies across households. This adds an aggregate
hours measure N that sums hours without the e weighting:

    N_t = sum_s sum_j omega_{s,t} lambda_j n_{j,s,t}

- aggregates.py: add get_N, mirroring get_L but without the e factor.
- SS.py and TPI.py: compute N and add it to the steady-state and
  transition output dictionaries (both, so the two keep the same keys).

Adds test_get_N (SS and TPI) checking the result against an explicit
index-by-index loop. With the default normalized e profile N and L
coincide at baseline (L = 0.3330, N = 0.3333); they diverge once e is not
mean-one, which is the case the separate measure is for.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.20%. Comparing base (9baa4b2) to head (492a58a).

Files with missing lines Patch % Lines
ogcore/TPI.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1228      +/-   ##
==========================================
+ Coverage   75.17%   75.20%   +0.02%     
==========================================
  Files          24       24              
  Lines        6031     6041      +10     
==========================================
+ Hits         4534     4543       +9     
- Misses       1497     1498       +1     
Flag Coverage Δ
unittests 75.20% <90.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
ogcore/SS.py 79.10% <100.00%> (+0.04%) ⬆️
ogcore/aggregates.py 100.00% <100.00%> (ø)
ogcore/TPI.py 52.75% <0.00%> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jdebacker

Copy link
Copy Markdown
Member

@arihantlodha-cmd Thanks for addressing this issue!

@jdebacker
jdebacker merged commit 43268b9 into PSLmodels:master Sep 26, 2026
7 checks passed
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.

Report hours worked?

3 participants