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

Update from original (#1) #558

Closed
wants to merge 1 commit into from

Conversation

daniel-schaefer
Copy link

  • Added basic inequality mesasures: lorenz curve and gini

Tests added, passed nosetests

  • Add jitted newton methods for root finding

Based on Scipy's newton methods, we add two variants of newton root
finding - Newton Raphson and secant method. All methods are jitted
through Numba with nopython mode. Relevant information (apart from the
root) is also returned in the result as python namedtuple since Numba
supports it.

  • Add test cases for newton methods

  • Add newton halley method and modify returning

The third and last newton method for root finding is now added with its
test cases. Each newton method is modified to include only a single
return statement.

  • EHN: Add qhull_options to game_theory.vertex_enumeration

  • Add bisection and brent's method for root finding

I added two jitted robust root finding methods: Bisection and Brentq
which are based on Scipy's version which is written in C. They both
follow the previous jitted root finding procedures by returning a
namedtuple with relevant information.

I also added a basic test for each method.

  • Fix import to list items

  • Add default args in docstring and Format code

I have included optional default arguments in the docstring of all
functions.

All trailing whitespaces are now fixed conforming to PEP8. The check is
done via pycodestyle and http://pep8online.com/.

  • initial commit of dle code from Sebastian Graves

  • adjustments for package

  • update to new rtd requirements spec

  • add reference to environment spec

  • test use of pip requirements file instead of conda

  • remove old yml config for rtd-environment, consolidate on pip-requirements for now

  • DOC: Add doc entry for root_finding

  • increment version to 0.4.0

  • updating auto-generated CHANGELOG

  • add v0.4.0 summary to README

  • fix badge link for RTD

  • update code with docstrings

  • remove pylab imports

  • move from pylab Matrix to np.matrix

  • update to use nullspace from quantecon

  • correct algebra for use of quantecon nullspace method

  • Add LGTM.com code quality badges

  • add test for transformation of problem to LQ type problem using known solutions verified by matlab programs

  • reduce line lengths in docstrings

  • revert use of quantecon nullspace as representations are not exactly the same ... need to investigate

  • migrate to using quantecon nullspace method

  • fix test for steadystate

  • add atol for comparing small values

  • add test for canonical

  • add dle to documentation

  • DOC: Fix the doc of root_finding.py to display nicely

  • Release of version 0.4.1

  • Add AS algorithm.

  • FIX: Force tuple elements to have the same dtype

Fix #434

  • Remove from future import ...

  • Add method option in robustlq.py

  • Modify variable names.

  • Modify intersection and find_C.

  • Incorporate with RepeatedGame class.

  • Compare vertex values in the test.

  • Changed gini from class to function to simplify the use of numba

  • fix docstring of x_hat in Kalman class

  • Add docstrings.

  • Fix issue#367

  • revise 'Fix issue#367'

  • Revise 'Fix kalman.py: Add method option #367' again

  • Revise 'Fix issue#367' again

  • Change docs to reflect changes from object to function

  • fix brent_max docstring

  • FEAT: Add Nelder-Mead algorithm

  • Jitting is commented out for generating coverage report
  • Uncomment @njit

  • FIX: Disallow 0 actions

  • FIX: is_dominated: Return False if num_actions == 1

  • Add Player.delete_action

  • Add NormalFormGame.delete_action

  • FIX: solve the bug of cached keyword u.

  • Minor fixes

  • Modify docstrings.

  • FIX: change keyword 'u' to 'u_init' in test.

  • FIX: minor modifications.

  • Use equilibrium_payoffs interface.

  • FIX: minor modification of docstrings.

  • Minor modifications of docstrings.

  • Modification of _best_dev_gains.

  • Release version 0.4.2

  • update CHANGELOG for 0.4.2 release

  • FIX: test method keyword of RepeatedGame.equilibrium_payoffs().

  • Add Shorrock inequality index

  • add mobility to description

  • add docs

  • Travis: Add macOS to the build matrix

  • Travis: Add miniconda cache

  • TestTicTacToc: Skip test_loop and test_timer for darwin

  • Add error for invalid inputs

  • Fix warning in test_pure_nash

  • README: Update coveralls badge to use svg

  • update documentation

  • update RST in nelder mead docstring

  • tests/util: Remove old merge resolution

  • fix docstring in inequality

  • update to use inline math

  • fix typo

  • restore to initial displaymath

  • Travis: Move dependency installs with wheels available to pip

  • Travis: Remove miniconda cache

  • Travis: Move statsmodels to pip

  • Travis: Move pytables to pip since it requires numpy

  • discrete_rv: Remove unused import

  • Isolate rtd-specific requirements to doc-requirements.txt

  • fix inequality docs

  • add raw flag

  • quad: Import sympy only when necessary

  • util.notebooks: Import requests only when necessary

  • pip-requirements: Remove unused statsmodels import

  • Travis: Disable performance tests

They should be run only from time to time, e.g. between releases, or
when the commit specifically states the perf modification of the
relevant code.

  • random.utilities: Cache guvectorize

  • quantecon.arma: Import scipy.signal functions only when necessary

  • fix for lorenz documentation

  • add matplotlib import

  • remove matplotlib

  • Release for version 0.4.3

  • Update generated CHANGELOG for 0.4.3

  • quantecon/tests: Fix F401 unused imports

  • quantecon/util: Fix F401 unused imports

  • quantecon/markov: Fix F401 unused imports

  • quantecon.arma: Fix F401 unused imports

  • quantecon/optimize: Fix F401 unused imports

  • quantecon/game_theory: Fix F401 unused imports

  • Disable flake8 on init.py files

  • Travis: Do F401 check before running the tests

  • TEST: Fix the names of tests for brent_max

  • DOC: Update example for nelder_mead

  • Apply autopep8 -ir --select E501 quantecon/util

  • Fix all E231 errors

  • Travis: Add E231 check

  • Apply autopep8 -ir --select E501 quantecon

  • Fix all F405 error and check on Travis

  • Fix some of F841 errors

  • lss: Fix formatting of a ValueError

  • add matplotlib to environment

  • specify matplotlib lts release

  • fix syntax

  • Delete the unnecessary assignment in quantecon/estepec.py

  • Delete the unnecessary assignment in quantecon/compute_fp.py

  • Delete the unnecessary assignment in quantecon/repeated_game.py

  • FIX: Raise correct error when A is not square in LinearStateSpace

  • Add random_pure_actions and random_mixed_actions and related tests.

  • Fix sample_without_replacement using guvectorize

  • FIX: Import scipy.sparse.linalg

Fix #481

  • Add drift term keyword to markov.tauchen.

  • Release of version 0.4.4

  • FIX: DOC: Remove matplotlib.sphinxext.only_directives

  • FIX: DOC: Fix Examples section in brent_max

  • TRAVIS: Set coverage branch.

  • increase tol in rouwenhorst test.

  • Add LQMarkov.

  • update version number

  • update major changes in README

  • add newline for PEP8

  • Release of version 0.4.5

  • update travis to python=3.7

  • update distribution to xenial

  • FIX: bug of computing state values in the last period of LQMarkov model

  • FIX: avoid solving stationary values for multiple times

  • FIX: random.draw: Replace random_sample with random

Fix #502

  • FIX: Player.is_dominated: Fix warnings

Fix #501

  • EHN: Player.is_dominated: Add 'revised simplex' method

For SciPy >= 1.3.0

  • FIX: Fix RuntimeWarning in lq_control.py

  • FIX: Fix RuntimeWarning in ivp.py

  • FIX: Fix Pandas related FutureWarnings in test_quad.py.

  • Raise value error if C != 0 and beta >= 1.

  • Tweak assignment of beta in test_robustlq.py to prevent test failiures.

  • Fix PEP8 Indent Error.

  • Edit assignment of beta in test_robustlq.py.

* Added basic inequality mesasures: lorenz curve and gini

Tests added, passed nosetests

* Add jitted newton methods for root finding

Based on Scipy's newton methods, we add two variants of newton root
finding - Newton Raphson and secant method. All methods are jitted
through Numba with nopython mode. Relevant information (apart from the
root) is also returned in the result as python namedtuple since Numba
supports it.

* Add test cases for newton methods

* Add newton halley method and modify returning

The third and last newton method for root finding is now added with its
test cases. Each newton method is modified to include only a single
return statement.

* EHN: Add `qhull_options` to `game_theory.vertex_enumeration`

* Add bisection and brent's method for root finding

I added two jitted robust root finding methods: Bisection and Brentq
which are based on Scipy's version which is written in C. They both
follow the previous jitted root finding procedures by returning a
namedtuple with relevant information.

I also added a basic test for each method.

* Fix import to list items

* Add default args in docstring and Format code

I have included optional default arguments in the docstring of all
functions.

All trailing whitespaces are now fixed conforming to PEP8. The check is
done via pycodestyle and http://pep8online.com/.

* initial commit of dle code from Sebastian Graves

* adjustments for package

* update to new rtd requirements spec

* add reference to environment spec

* test use of pip requirements file instead of conda

* remove old yml config for rtd-environment, consolidate on pip-requirements for now

* DOC: Add doc entry for root_finding

* increment version to 0.4.0

* updating auto-generated CHANGELOG

* add v0.4.0 summary to README

* fix badge link for RTD

* update code with docstrings

* remove pylab imports

* move from pylab Matrix to np.matrix

* update to use nullspace from quantecon

* correct algebra for use of quantecon nullspace method

* Add LGTM.com code quality badges

* add test for transformation of problem to LQ type problem using known solutions verified by matlab programs

* reduce line lengths in docstrings

* revert use of quantecon nullspace as representations are not exactly the same ... need to investigate

* migrate to using quantecon nullspace method

* fix test for steadystate

* add atol for comparing small values

* add test for canonical

* add dle to documentation

* DOC: Fix the doc of `root_finding.py` to display nicely

* Release of version 0.4.1

* Add AS algorithm.

* FIX: Force tuple elements to have the same dtype

Fix QuantEcon#434

* Remove `from future import ...`

*  Add method option in robustlq.py

* Modify variable names.

* Modify `intersection` and `find_C`.

* Incorporate with `RepeatedGame` class.

* Compare vertex values in the test.

* Changed gini from class to function to simplify the use of numba

* fix docstring of x_hat in Kalman class

* Add docstrings.

* Fix issue#367

* revise 'Fix issue#367'

* Revise 'Fix QuantEcon#367' again

* Revise 'Fix issue#367' again

* Change docs to reflect changes from object to function

* fix brent_max docstring

* FEAT: Add Nelder-Mead algorithm

- Jitting is commented out for generating coverage report

* Uncomment `@njit`

* FIX: Disallow 0 actions

* FIX: is_dominated: Return False if num_actions == 1

* Add Player.delete_action

* Add NormalFormGame.delete_action

* FIX: solve the bug of cached keyword `u`.

* Minor fixes

* Modify docstrings.

* FIX: change keyword 'u' to 'u_init' in test.

* FIX: minor modifications.

* Use `equilibrium_payoffs` interface.

* FIX: minor modification of docstrings.

* Minor modifications of docstrings.

* Modification of `_best_dev_gains`.

* Release version 0.4.2

* update CHANGELOG for 0.4.2 release

* FIX: test `method` keyword of `RepeatedGame.equilibrium_payoffs()`.

* Add Shorrock inequality index

* add mobility to description

* add docs

* Travis: Add macOS to the build matrix

* Travis: Add miniconda cache

* TestTicTacToc: Skip test_loop and test_timer for darwin

* Add error for invalid inputs

* Fix warning in test_pure_nash

* README: Update coveralls badge to use svg

* update documentation

* update RST in nelder mead docstring

* tests/util: Remove old merge resolution

* fix docstring in inequality

* update to use inline math

* fix typo

* restore to initial displaymath

* Travis: Move dependency installs with wheels available to pip

* Travis: Remove miniconda cache

* Travis: Move statsmodels to pip

* Travis: Move pytables to pip since it requires numpy

* discrete_rv: Remove unused import

* Isolate rtd-specific requirements to doc-requirements.txt

* fix inequality docs

* add raw flag

* quad: Import sympy only when necessary

* util.notebooks: Import requests only when necessary

* pip-requirements: Remove unused statsmodels import

* Travis: Disable performance tests

They should be run only from time to time, e.g. between releases, or
when the commit specifically states the perf modification of the
relevant code.

* random.utilities: Cache guvectorize

* quantecon.arma: Import scipy.signal functions only when necessary

* fix for lorenz documentation

* add matplotlib import

* remove matplotlib

* Release for version 0.4.3

* Update generated CHANGELOG for 0.4.3

* quantecon/tests: Fix F401 unused imports

* quantecon/util: Fix F401 unused imports

* quantecon/markov: Fix F401 unused imports

* quantecon.arma: Fix F401 unused imports

* quantecon/optimize: Fix F401 unused imports

* quantecon/game_theory: Fix F401 unused imports

* Disable flake8 on __init__.py files

* Travis: Do F401 check before running the tests

* TEST: Fix the names of tests for `brent_max`

* DOC: Update example for `nelder_mead`

* Apply `autopep8 -ir --select E501 quantecon/util`

* Fix all E231 errors

* Travis: Add E231 check

* Apply `autopep8 -ir --select E501 quantecon`

* Fix all F405 error and check on Travis

* Fix some of F841 errors

* lss: Fix formatting of a ValueError

* add matplotlib to environment

* specify matplotlib lts release

* fix syntax

* Delete the unnecessary assignment in quantecon/estepec.py

* Delete the unnecessary assignment in quantecon/compute_fp.py

* Delete the unnecessary assignment in quantecon/repeated_game.py

* FIX: Raise correct error when `A` is not square in `LinearStateSpace`

* Add random_pure_actions and random_mixed_actions and related tests.

* Fix `sample_without_replacement` using guvectorize

* FIX: Import scipy.sparse.linalg

Fix QuantEcon#481

* Add drift term keyword to `markov.tauchen`.

* Release of version 0.4.4

* FIX: DOC: Remove `matplotlib.sphinxext.only_directives`

* FIX: DOC: Fix Examples section in `brent_max`

* TRAVIS: Set coverage branch.

* increase `tol` in `rouwenhorst` test.

* Add LQMarkov.

* update version number

* update major changes in README

* add newline for PEP8

* Release of version 0.4.5

* update travis to python=3.7

* update distribution to xenial

* FIX: bug of computing state values in the last period of `LQMarkov` model

* FIX: avoid solving stationary values for multiple times

* FIX: random.draw: Replace `random_sample` with `random`

Fix QuantEcon#502

* FIX: Player.is_dominated: Fix warnings

Fix QuantEcon#501

* EHN: Player.is_dominated: Add `'revised simplex'` method

For SciPy >= 1.3.0

* FIX: Fix RuntimeWarning in lq_control.py

* FIX: Fix RuntimeWarning in ivp.py

* FIX: Fix Pandas related FutureWarnings in test_quad.py.

* Raise value error if C != 0 and beta >= 1.

* Tweak assignment of beta in test_robustlq.py to prevent test failiures.

* Fix PEP8 Indent Error.

* Edit assignment of beta in test_robustlq.py.
@pep8speaks
Copy link

Hello @daniel-schaefer! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 9:1: W191 indentation contains tabs
Line 10:1: W191 indentation contains tabs
Line 10:80: E501 line too long (124 > 79 characters)
Line 39:1: E265 block comment should start with '# '
Line 40:80: E501 line too long (111 > 79 characters)
Line 41:1: E265 block comment should start with '# '

Line 2:74: W291 trailing whitespace
Line 11:1: E302 expected 2 blank lines, found 1
Line 13:80: E501 line too long (96 > 79 characters)
Line 14:80: E501 line too long (96 > 79 characters)
Line 16:80: E501 line too long (92 > 79 characters)
Line 25:8: W291 trailing whitespace
Line 29:22: W291 trailing whitespace
Line 33:76: W291 trailing whitespace
Line 34:18: W291 trailing whitespace
Line 38:80: E501 line too long (82 > 79 characters)
Line 38:83: W291 trailing whitespace
Line 41:80: E501 line too long (84 > 79 characters)
Line 41:85: W291 trailing whitespace
Line 44:80: E501 line too long (82 > 79 characters)
Line 44:83: W291 trailing whitespace
Line 45:80: E501 line too long (86 > 79 characters)
Line 45:87: W291 trailing whitespace
Line 51:80: E501 line too long (80 > 79 characters)
Line 53:80: E501 line too long (85 > 79 characters)
Line 53:86: W291 trailing whitespace
Line 56:80: E501 line too long (83 > 79 characters)
Line 56:84: W291 trailing whitespace
Line 63:80: E501 line too long (90 > 79 characters)
Line 65:80: E501 line too long (90 > 79 characters)
Line 66:80: E501 line too long (81 > 79 characters)
Line 68:80: E501 line too long (85 > 79 characters)
Line 86:80: E501 line too long (87 > 79 characters)
Line 93:80: E501 line too long (87 > 79 characters)
Line 98:80: E501 line too long (87 > 79 characters)
Line 104:80: E501 line too long (100 > 79 characters)
Line 105:80: E501 line too long (96 > 79 characters)
Line 107:80: E501 line too long (87 > 79 characters)
Line 124:80: E501 line too long (98 > 79 characters)
Line 149:80: E501 line too long (97 > 79 characters)
Line 151:80: E501 line too long (86 > 79 characters)
Line 152:80: E501 line too long (89 > 79 characters)
Line 155:80: E501 line too long (89 > 79 characters)
Line 216:80: E501 line too long (89 > 79 characters)
Line 219:80: E501 line too long (97 > 79 characters)
Line 221:80: E501 line too long (97 > 79 characters)
Line 234:40: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 248:80: E501 line too long (105 > 79 characters)
Line 300:12: W291 trailing whitespace
Line 302:80: E501 line too long (87 > 79 characters)
Line 303:80: E501 line too long (96 > 79 characters)
Line 326:80: E501 line too long (102 > 79 characters)

Line 33:34: E203 whitespace before ','
Line 33:40: E202 whitespace before ']'
Line 34:40: E202 whitespace before ']'
Line 35:34: E203 whitespace before ','
Line 35:40: E202 whitespace before ']'
Line 36:34: E203 whitespace before ','
Line 51:1: E305 expected 2 blank lines after class or function definition, found 1

Line 13:80: E501 line too long (89 > 79 characters)
Line 16:80: E501 line too long (96 > 79 characters)
Line 21:80: E501 line too long (81 > 79 characters)
Line 63:80: E501 line too long (80 > 79 characters)
Line 99:1: W293 blank line contains whitespace
Line 106:80: E501 line too long (85 > 79 characters)

Line 150:21: E128 continuation line under-indented for visual indent

Line 101:80: E501 line too long (85 > 79 characters)

Line 303:29: E127 continuation line over-indented for visual indent
Line 304:29: E127 continuation line over-indented for visual indent

Line 60:70: W291 trailing whitespace
Line 66:1: W293 blank line contains whitespace
Line 70:70: W291 trailing whitespace
Line 86:1: W293 blank line contains whitespace

Line 173:1: W293 blank line contains whitespace

Line 13:1: E302 expected 2 blank lines, found 1
Line 41:59: W291 trailing whitespace
Line 90:18: E203 whitespace before ':'
Line 91:18: E203 whitespace before ':'
Line 92:18: E203 whitespace before ':'
Line 93:18: E203 whitespace before ':'
Line 94:18: E203 whitespace before ':'
Line 95:18: E203 whitespace before ':'
Line 96:18: E203 whitespace before ':'

Line 21:51: E222 multiple spaces after operator

Line 67:32: E261 at least two spaces before inline comment
Line 101:32: E261 at least two spaces before inline comment
Line 155:25: E203 whitespace before ','

Line 90:1: W391 blank line at end of file

Line 49:33: E127 continuation line over-indented for visual indent

Line 13:29: E128 continuation line under-indented for visual indent

Line 28:1: E265 block comment should start with '# '
Line 92:31: E701 multiple statements on one line (colon)
Line 93:80: E501 line too long (112 > 79 characters)

Line 35:77: E262 inline comment should start with '# '
Line 35:80: E501 line too long (95 > 79 characters)
Line 37:77: E262 inline comment should start with '# '
Line 37:80: E501 line too long (95 > 79 characters)

@mmcky
Copy link
Contributor

mmcky commented Sep 23, 2020

hey @daniel-schaefer thanks for this PR! There are some great changes in here.

Given the large number of proposed changes it will take some time to review it. Usually it is best to break changes into smaller chunks that address a single issue -- and setup multiple PRs. That way review for some items doesn't hold up others and we can merge the easy ones straight away.

I will update a CONTRIBUTE.md file to document this.

It's late here -- so I will take a closer look tomorrow.

@mmcky
Copy link
Contributor

mmcky commented Sep 23, 2020

@daniel-schaefer would you be able to fetch the latest upstream/master for your fork? That should fix the merge conflicts.

@jstac
Copy link
Contributor

jstac commented Sep 24, 2020

Wow @daniel-schaefer , this is huge! Thank you!!

I noticed you are in Linz. It looks beautiful. And your research on wage inequality looks interesting.

With these kinds of contributions, the best method is to open a whole lot of PRs, one for each separate topic. This is partly because a big contribution is hard to review in a timely way --- in which case merge conflicts and other issues will arise --- and partly because it's small changes requested in some parts will delay merging good code.

I hate to ask this of you, given all this great work, but I also want to conform to best practice and make sure we do the best work possible, so might you be willing to close this PR and then start to open small PRs, usually involving only one topic / one or two files, so we can merge progressively?

With each PR, it's really helpful if you can provide a bit of background in the discussion on the PR.

@daniel-schaefer
Copy link
Author

Hello @jstac thanks, Linz is really beautiful. Hopefully you can come and visit some day once the travel restrictions are lifted.

Sure, I'll close the PR - should have put more thought into it.

Best wishes,
Daniel

@jstac
Copy link
Contributor

jstac commented Sep 25, 2020

Thanks @daniel-schaefer , I'll definitely be looking forward to seeing your new PRs.

@mmcky
Copy link
Contributor

mmcky commented Sep 25, 2020

thanks @daniel-schaefer -- looking forward to the new PRs also. There are some great changes in there.

@mmcky
Copy link
Contributor

mmcky commented Dec 8, 2020

@daniel-schaefer would love some of these changes brought in via PR if you have time to set them up (based on features, improvements etc.). Let me know if I can assist with this in any way. There were some great improvements in that change set.

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