Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IncShkDstn constructor for ConsMarkov #1484

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mnwhite
Copy link
Contributor

@mnwhite mnwhite commented Aug 16, 2024

DWC pointed out that MarkovConsumerType doesn't work "off the shelf". This PR fixes that with a new custom income process constructor. Tests run correctly, but example notebooks might break, let's find out!

Please ensure your pull request adheres to the following guidelines:

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

DWC pointed out that MarkovConsumerType doesn't work "off the shelf". This PR fixes that with a new custom income process constructor. Tests run correctly, but example notebooks might break, let's find out!
@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 16, 2024

This addresses #1478

Adjustments for new constructor.
Turn off default Markov constructor in test.
One test is failing on Ubuntu, Py 3.10. It runs fine on other OS and versions of Python. This is going to be a tedious process to fix.
@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 16, 2024

This has one failing test, but only on Ubuntu. It runs fine on Windows and Mac. Any suggestions on how to test this locally?

@DominicWC
Copy link
Collaborator

You can use pytest, assuming you have a linux system. Check the contributor guide.

@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 17, 2024 via email

@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 19, 2024

Following @alanlujan91 's advice, I set up WSL on one of my computers, got Miniconda set up, installed HARK locally, and ran the failing test... and it didn't fail. Now what?

@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 19, 2024

Ok, super fascinating result: I re-ran the Ubuntu Py 3.11 tests remotely... and it succeeded. And then I ran all consumption tests locally (rather than just the failing one)... and it failed. Something is going on with the order of tests on Linux, where test A is affecting test B.

@DominicWC
Copy link
Collaborator

Have you fixed the test that runs in Compare_TBS_and_Markov? Maybe PermShkStd and TranShkStd's shape haven't been updated.

@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 19, 2024 via email

A dictionary might be changed in an unexpected way.
@mnwhite
Copy link
Contributor Author

mnwhite commented Aug 20, 2024

I managed to fix this without fully understanding why. I switched one dictionary line in an init method from copy to deepcopy, and the error went away.

Copy link
Collaborator

@DominicWC DominicWC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It fixes the problem, passes checks, and it's inputs are consistent with the rest of the ConsMarkovModel. I couldn't find any issues.

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

Successfully merging this pull request may close these issues.

2 participants