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

MNW cleanup May 2020 #698

Merged
merged 10 commits into from
May 28, 2020
Merged

MNW cleanup May 2020 #698

merged 10 commits into from
May 28, 2020

Conversation

mnwhite
Copy link
Contributor

@mnwhite mnwhite commented May 26, 2020

Various small comment and functionality fixes for ConsAggShockModel examples and FashionVictim.

This example model was out of date with current HARK format; now fixed.  Also tweaked a few comments.
Update the aggregate shocks example so that it uses the new distribution style.   Also adjust some comments in various files (and improve commented-out plots in ConsAggShock).
Fix small issues with FashionVictimModel
#plt.xlabel('log(MaggNow)')
#plt.ylabel('log(AaggNow)')
#plt.plot(logMagg[plot_start:],logAagg[plot_start:],'.k')
#plt.show()
Copy link
Contributor

Choose a reason for hiding this comment

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

If your goal is to 'clean up" this code, I'd suggest that removing commented code blocks would make the code 'cleaner'.

# plt.plot(logMagg[these],logAagg[these],'.')
if verbose:
#plt.plot(logMagg[these],logAagg[these],'.')
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why our core library code should have a condition that does nothingl

[np.array([0.96, 0.04]), np.array([1.0, 1.0]), np.array([1.0 / 0.96, 0.0])],
[np.array([0.90, 0.10]), np.array([1.0, 1.0]), np.array([1.0 / 0.90, 0.0])],
DiscreteDistribution(np.array([0.96, 0.04]), [np.array([1.0, 1.0]), np.array([1.0 / 0.96, 0.0])]),
DiscreteDistribution(np.array([0.90, 0.10]), [np.array([1.0, 1.0]), np.array([1.0 / 0.90, 0.0])]),
Copy link
Contributor

Choose a reason for hiding this comment

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

i love this.

@mnwhite
Copy link
Contributor Author

mnwhite commented May 27, 2020 via email

@mnwhite
Copy link
Contributor Author

mnwhite commented May 27, 2020 via email

@sbenthall
Copy link
Contributor

Just a positive vibe.

I'm not sure why Travis failed a build on this.
It might have been an internal networking error.
I think there should be a way to kick it to rerun the tests, but I don't a see a button for it.
But it should rerun them if you push a commit fixing the commented code issue.

I would rather merge this, then #702, as that's better PR hygiene.

"Progress plots" of M vs A plots in the aggregate shocks model now only display if the economy has a 'plot_verbose' attribute set.
if verbose:
#plt.plot(logMagg[these],logAagg[these],'.')
pass
if hasattr(self, 'plot_verbose'):
Copy link
Contributor

Choose a reason for hiding this comment

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

now the PR inconsistently uses 'plot_verbose' or 'verbose_plot' for this feature.

I'm thumbs down on:

But if this is necessary functionality, then maybe we can wire it through the "view" code in a way that's clean.

@mnwhite
Copy link
Contributor Author

mnwhite commented May 28, 2020 via email

Tests for models in ConsAggShockModel.py have been revised and expanded.  There are now tests for "micro" and "macro" versions of both the regular and Markov versions.

Options have been set so that it "fake solves", with a small number of agents, short history, and simply quitting on solving after 3 loops.
Really sure I googled for this exact method, but failed.  Thanks, Shauna!
@sbenthall sbenthall merged commit 2ca45b7 into master May 28, 2020
@mnwhite mnwhite deleted the MNWcleanupMay2020 branch June 5, 2020 13:27
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.

2 participants