Skip to content

Conversation

@andersonfrailey
Copy link
Collaborator

This PR implements the suggestion in issue #386. It's still a work in progress, but here's a high level summary.

I created hashes for all of the stage 2 scripts and datasets and saved them in datahashes.json. The stage 2 scripts then compare these hashes, the targets, and the factors before running the LP model. If all of these are equal for a given year, the solver is skipped and the weights we already have are used again. I believe that these checks will be sufficient to catch any changes that would effect the final weights. All of the initial hash values are created by inithash.py. If the input files are changed, they'll need to be updated after creating the new weights.

For some reason, the PUF weights are being changed right now even after skipping the solver. I need to get to the bottom of that bug before this PR is ready to merge. I also think it should be merged after we switch solvers and after #387.

@andersonfrailey andersonfrailey added enhancement in progress CPS PUF extrapolation Issues/PRs related to our extrapolation techniques labels May 25, 2021
@martinholmer
Copy link
Contributor

@andersonfrailey, What does this PR add that cannot be done with the Makefile?

@andersonfrailey
Copy link
Collaborator Author

@martinholmer, this allows us to skip individual years in the stage two process. To the best of my knowledge, a makefile only allows us to either run stage 2 or skip it entirely. With this PR, we won't create new weights for years in which the CBO projections or SOI estimates do not change.

For example, if we only update the CBO projections or SOI estimates, the 2013 weights will not change (assuming no other aspect of the file creation process has changed) since the targets for that year are no longer being updated. But right now we still run the full solver to find the 2013 weights anyway. With this PR, we would just default to using the weights that have already been calculated.

If any of the other files related to creating the PUF/CPS or the stage two logic change, then the solver will still run for every year.

@martinholmer
Copy link
Contributor

@andersonfrailey, Thanks for clarifying the rationale for pull request #390.

@andersonfrailey
Copy link
Collaborator Author

Latest commit re-runs everything so that the weights and PUF ratios are no longer being changed. This PR is good to go! I'll leave it open for another couple of days for any review and in case I find anything else that needs updating.

@andersonfrailey andersonfrailey merged commit c949e40 into PSLmodels:master Oct 27, 2021
@andersonfrailey andersonfrailey deleted the skipyears branch October 27, 2021 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CPS enhancement extrapolation Issues/PRs related to our extrapolation techniques PUF ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants