Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=100']
Expand All @@ -10,25 +10,25 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: v2.26.0
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.16.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/psf/black
rev: 22.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.20.0
hooks:
- id: blacken-docs
additional_dependencies: [black]
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies: [
Expand All @@ -47,7 +47,7 @@ repos:
Pygments,
]
- repo: https://github.com/PyCQA/doc8
rev: 0.9.0
rev: v2.0.0
hooks:
- id: doc8
# - repo: https://github.com/codespell-project/codespell
Expand Down
1 change: 1 addition & 0 deletions development/testing/regression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Create, run or investigate regression checks."""

import pickle
import socket

Expand Down
1 change: 1 addition & 0 deletions development/testing/testing_pull_request.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run a series of tests that are required for any pull request to be merged."""

import socket

import click
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import sys


# Set variable so that todos are shown in local build
on_rtd = os.environ.get("READTHEDOCS") == "True"

Expand Down
1 change: 1 addition & 0 deletions docs/projects/_numerical_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Auxiliary and plotting functions for the respy tutorial numerical integration."""

import matplotlib.pyplot as plt
from matplotlib import ticker

Expand Down
2 changes: 1 addition & 1 deletion respy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
rp.<func>

"""

import pytest

from respy.config import ROOT_DIR
Expand All @@ -22,7 +23,6 @@
from respy.solve import get_solve_func # noqa: F401
from respy.tests.random_model import add_noise_to_params # noqa: F401


__all__ = [
"get_example_model",
"get_parameter_constraints",
Expand Down
1 change: 1 addition & 0 deletions respy/_numba.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Special functions for using numba."""

import warnings

import numba as nb
Expand Down
1 change: 1 addition & 0 deletions respy/conditional_draws.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to conditional draws for the maximum likelihood estimation."""

import numpy as np
from estimagic.utilities import robust_cholesky
from numba import guvectorize
Expand Down
1 change: 1 addition & 0 deletions respy/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""General configuration for respy."""

from pathlib import Path

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions respy/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module includes code to configure pytest."""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions respy/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to the original data from Keane and Wolpin (1997)."""

import numpy as np
import pandas as pd

Expand Down
1 change: 1 addition & 0 deletions respy/exogenous_processes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utils for the inclusion of exogenous processes."""

import functools

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions respy/interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""General interface functions for respy."""

import warnings

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions respy/interpolate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code for approximate solutions to the DCDP."""

import warnings

import numba as nb
Expand Down
1 change: 1 addition & 0 deletions respy/likelihood.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to the estimation with maximum likelihood."""

import warnings
from functools import partial

Expand Down
1 change: 1 addition & 0 deletions respy/method_of_simulated_moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
of Asset Prices. Econometrica, 61(4), 929-952.

"""

import copy
import functools

Expand Down
1 change: 1 addition & 0 deletions respy/parallelization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the code to control parallel execution."""

import functools

import joblib
Expand Down
1 change: 1 addition & 0 deletions respy/pre_processing/data_checking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test functions to ensure the validity of data."""

import numpy as np

from respy.shared import generate_column_dtype_dict_for_estimation
Expand Down
1 change: 1 addition & 0 deletions respy/pre_processing/model_checking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to validate the model."""

import numba as nb
import numpy as np

Expand Down
7 changes: 4 additions & 3 deletions respy/pre_processing/model_processing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Process model specification files or objects."""

import copy
import itertools
import os
Expand Down Expand Up @@ -802,9 +803,9 @@ def _convert_labels_in_formulas_to_codes(options, optim_paras):

for choice in optim_paras["choices"]:
for i, formula in enumerate(options["negative_choice_set"].get(choice, [])):
options["negative_choice_set"][choice][
i
] = _replace_choices_and_observables_in_formula(formula, optim_paras)
options["negative_choice_set"][choice][i] = (
_replace_choices_and_observables_in_formula(formula, optim_paras)
)

return options

Expand Down
1 change: 1 addition & 0 deletions respy/pre_processing/process_covariates.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module comprises all functions which process the definition of covariates."""

import copy


Expand Down
1 change: 1 addition & 0 deletions respy/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import from respy itself. This is to prevent circular imports.

"""

import shutil

import numba as nb
Expand Down
1 change: 1 addition & 0 deletions respy/simulate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to the simulation of data with structural models."""

import functools
import warnings

Expand Down
1 change: 1 addition & 0 deletions respy/solve.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to the solution of a structural model."""

import functools

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions respy/state_space.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Everything related to the state space of a structural model."""

import itertools

import numba as nb
Expand Down
2 changes: 1 addition & 1 deletion respy/tests/random_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module contains the functions for the generation of random requests."""

import collections
import copy

Expand Down Expand Up @@ -26,7 +27,6 @@
from respy.simulate import _random_choice
from respy.simulate import get_simulate_func


_BASE_COVARIATES = {
"not_any_exp_a": "exp_a == 0",
"not_any_exp_b": "exp_b == 0",
Expand Down
1 change: 1 addition & 0 deletions respy/tests/test_flexible_choices.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains code for testing for flexible choices."""

import pandas as pd
import pytest

Expand Down
1 change: 1 addition & 0 deletions respy/tests/test_method_of_simulated_moments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the msm interface of respy."""

import copy

import numpy as np
Expand Down
9 changes: 3 additions & 6 deletions respy/tests/test_model_processing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test model generation."""

import io
import textwrap

Expand Down Expand Up @@ -144,17 +145,13 @@ def test_convert_labels_in_covariates_to_codes():
@pytest.mark.precise
def test_parse_observables():
params = pd.read_csv(
io.StringIO(
textwrap.dedent(
"""
io.StringIO(textwrap.dedent("""
category,name,value
observable_fishing_grounds_rich_grounds,probability,0.5
observable_fishing_grounds_poor_grounds,probability,0.5
observable_ability_low_middle,probability,0.5
observable_ability_high,probability,0.5
"""
)
),
""")),
index_col=["category", "name"],
)["value"]
optim_paras = _parse_exogenous_processes({}, params)
Expand Down
8 changes: 2 additions & 6 deletions respy/tests/test_process_covariates.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
@pytest.mark.precise
def test_identify_relevant_covariates():
params = pd.read_csv(
io.StringIO(
dedent(
"""
io.StringIO(dedent("""
category,name,value
wage_a,constant,1
nonpec_b,upper_upper,1
wage_c,upper_upper_with_spacing_problem,1
"""
)
),
""")),
index_col=["category", "name"],
)

Expand Down
1 change: 1 addition & 0 deletions respy/tests/test_randomness.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module includes test to specifically test that randomness is held constant."""

import numpy as np
import pytest

Expand Down
1 change: 1 addition & 0 deletions respy/tests/test_regression.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Run a few regression tests."""

import pickle

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion respy/tests/test_replication_kw_94.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
181.

"""

import numpy as np
import pandas as pd
import pytest

import respy as rp
from respy.config import TEST_RESOURCES_DIR


pytestmark = pytest.mark.slow


Expand Down
1 change: 1 addition & 0 deletions respy/tests/test_simulate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test the simulation routine."""

import numpy as np
import pandas as pd
import pytest
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""The general package information for respy."""

from pathlib import Path

from setuptools import find_packages
from setuptools import setup


DESCRIPTION = (
"respy is a Python package for the simulation and estimation of a prototypical "
"finite-horizon dynamic discrete choice model."
Expand Down
Loading