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

Throw an Exception if model has not been solved prior to simulate'ing #315

Merged
merged 3 commits into from
Jun 17, 2019

Conversation

pkofod
Copy link
Contributor

@pkofod pkofod commented Jun 16, 2019

So, I'm just PRing some minor things I'm finding on my way to matching a portfolio share. I've actually thought about this before (last fall!) but you quickly forget these things/learn to live with them.

Essentially, before this PR, if you tried to simulate(), but you hadn't solve()ed, you would just get a message stating that

AttributeError: 'IndShockConsumerType' object has no attribute 'solution'.

I'm not sure that all new users, and maybe new python users, would immediately know why this is. We probably know what went wrong though! They didn't solve.

Added a simple test to verify that this is actually thrown by initializing an IndShockConsumerType, setting it up, running simulate, but without having solved it.

Test simulate behavior when solve has not been called.
Remove conflicts for real. Use assertRaises.
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.

3 participants