Skip to content

Commit 09a7d29

Browse files
authored
Merge pull request #61 from OpenSourceEconomics/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents e339ee1 + acb221c commit 09a7d29

File tree

13 files changed

+75
-41
lines changed

13 files changed

+75
-41
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
18-
python-version: ['3.6', '3.7', '3.8']
18+
python-version: ['3.9']
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: conda-incubator/setup-miniconda@v2
2222
with:
23+
environment-file: environment.yml
2324
activate-environment: ruspy
2425
auto-update-conda: true
25-
environment-file: environment.yml
26-
python-version: ${{ matrix.python-version }}
26+
python-version: ${{ matrix.python-version}}
2727

2828
- name: Run pytest.
2929
shell: bash -l {0}

.pre-commit-config.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
exclude: ^\.
33
repos:
44
- repo: https://github.com/asottile/reorder_python_imports
5-
rev: v2.6.0
5+
rev: v3.8.3
66
hooks:
77
- id: reorder-python-imports
88
files: '(\.pyi?|wscript)$'
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.0.1
10+
rev: v4.3.0
1111
hooks:
1212
- id: check-yaml
1313
exclude: 'meta\.yaml'
@@ -21,39 +21,38 @@ repos:
2121
args: [--autofix, --no-sort-keys]
2222
- id: trailing-whitespace
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v2.23.3
24+
rev: v3.0.0
2525
hooks:
2626
- id: pyupgrade
2727
args: [
2828
--py36-plus
2929
]
3030
- repo: https://github.com/asottile/blacken-docs
31-
rev: v1.10.0
31+
rev: v1.12.1
3232
hooks:
3333
- id: blacken-docs
3434
additional_dependencies: [black==19.3b0]
3535
files: '(\.md|\.rst)$'
3636
- repo: https://github.com/psf/black
37-
rev: 21.7b0
37+
rev: 22.10.0
3838
hooks:
3939
- id: black
4040
files: '(\.pyi?|wscript)$'
4141
language_version: python
4242
- repo: https://github.com/PyCQA/doc8
43-
rev: 0.9.0
43+
rev: v1.0.0
4444
hooks:
4545
- id: doc8
4646
args: [--max-line-length, "88"]
4747
- repo: https://github.com/PyCQA/flake8
48-
rev: 3.9.2
48+
rev: 5.0.4
4949
hooks:
5050
- id: flake8
51-
files: '(\.py|wscript)$'
51+
types: [python]
5252
additional_dependencies: [
53-
flake8-bugbear, flake8-builtins, flake8-comprehensions,
54-
flake8-deprecated, flake8-docstrings, flake8-eradicate, flake8-print,
55-
flake8-rst-docstrings, flake8-todo, flake8-type-annotations,
56-
pep8-naming, pydocstyle
53+
flake8-alfred, flake8-bugbear, flake8-builtins, flake8-comprehensions,
54+
flake8-docstrings, flake8-eradicate, flake8-print,
55+
flake8-todo, pep8-naming, pydocstyle,
5756
]
5857
# Harmonizing flake8 and black
5958
args: [

.readthedocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build:
44
image: latest
55

66
python:
7-
version: 3.7
7+
version: 3.8
88

99
conda:
10-
environment: environment.yml
10+
environment: docs/rtd_environment.yml
1111

docs/rtd_environment.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: rtd_ruspy
2+
3+
channels:
4+
- conda-forge
5+
- nodefaults
6+
7+
dependencies:
8+
- python=3.8
9+
- pip
10+
- sphinx
11+
12+
- ipython
13+
- nbsphinx
14+
- numpydoc
15+
- sphinx-autobuild
16+
- sphinx-autoapi
17+
- numba
18+
- numpy
19+
- nlopt
20+
- pytest
21+
- estimagic
22+
23+
- pip:
24+
- sphinx_rtd_theme

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#
7878
# This is also used if you do content translation via gettext catalogs.
7979
# Usually you set "language" from the command line for these cases.
80-
language = None
80+
language = "en"
8181

8282
# List of patterns, relative to source directory, that match files and
8383
# directories to ignore when looking for source files.

environment.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,21 @@ channels:
33
- opensourceeconomics
44
- conda-forge
55
dependencies:
6-
- python>=3.6
6+
- python=3.9
77
- numpy
8-
- sphinx
98
- pandas
10-
- statsmodels
119
- pre-commit
12-
- pytest>=6.2.1
10+
- pytest
1311
- pytest-xdist
1412
- pytest-cov
1513
- scipy
16-
- matplotlib
17-
- numpydoc
1814
- jupyter
1915
- numba
2016
- pip
2117
- estimagic
18+
- black
19+
- flake8
20+
- pdbpp
2221
- nlopt
2322
- pip:
24-
- flake8
25-
- black
26-
- jupyter_contrib_nbextensions
27-
- sphinx_rtd_theme
23+
- jupyter_contrib_nbextensions

ruspy/estimation/mpec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def function_wrapper(mpec_params, grad):
427427
def wrap_nlopt_constraint(function, args):
428428
def function_wrapper(mpec_params):
429429
result = function(
430-
result=np.array([]), mpec_params=mpec_params, *args, grad=np.array([])
430+
*args, result=np.array([]), mpec_params=mpec_params, grad=np.array([])
431431
)
432432
return result
433433

ruspy/model_code/cost_functions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def cubic_costs(num_states, params, scale):
102102
states = np.arange(num_states)
103103
costs = (
104104
params[0] * scale * states
105-
+ params[1] * scale * (states ** 2)
106-
+ params[2] * scale * (states ** 3)
105+
+ params[1] * scale * (states**2)
106+
+ params[2] * scale * (states**3)
107107
)
108108
return costs
109109

@@ -127,7 +127,7 @@ def cubic_costs_dev(num_states, scale):
127127
128128
"""
129129
states = np.arange(num_states)
130-
dev = np.array([states * scale, scale * (states ** 2), scale * (states ** 3)]).T
130+
dev = np.array([states * scale, scale * (states**2), scale * (states**3)]).T
131131
return dev
132132

133133

@@ -153,7 +153,7 @@ def quadratic_costs(num_states, params, scale):
153153
154154
"""
155155
states = np.arange(num_states)
156-
costs = params[0] * scale * states + params[1] * scale * (states ** 2)
156+
costs = params[0] * scale * states + params[1] * scale * (states**2)
157157
return costs
158158

159159

@@ -177,7 +177,7 @@ def quadratic_costs_dev(num_states, scale):
177177
178178
"""
179179
states = np.arange(num_states)
180-
dev = np.array([scale * states, scale * (states ** 2)]).T
180+
dev = np.array([scale * states, scale * (states**2)]).T
181181
return dev
182182

183183

ruspy/simulation/simulation_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def simulate_strategy_reduced_data_disc_utility(
216216
)
217217

218218
state_increase = draw_increment(intermediate_state, trans_mat)
219-
disc_utility += disc_fac ** period * utility
219+
disc_utility += disc_fac**period * utility
220220

221221
new_state = intermediate_state + state_increase
222222
if new_state > num_states:

ruspy/test/ranodm_init.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
def random_init(constr=None):
99
"""
1010
The module provides a random dictionary generating process for test purposes.
11+
1112
"""
12-
# Check for pre specified constraints
1313
if constr is not None:
1414
pass
1515
else:
@@ -69,7 +69,8 @@ def random_init(constr=None):
6969

7070
def print_dict(init_dict, file_name="test"):
7171
"""
72-
This function prints the initialization dict to a *.yml file.
72+
This function prints the initialization dict to a yaml file.
73+
7374
"""
7475
ordered_dict = collections.OrderedDict()
7576
order = ["simulation", "estimation"]

0 commit comments

Comments
 (0)