diff --git a/.gitignore b/.gitignore index 6f877137b..3c9d24c11 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,8 @@ docs/_build/ docs/build/ docs/source/_build/ docs/source/getting_started/*.db +docs/source/getting_started/*.db-shm +docs/source/getting_started/*.db-wal docs/source/refs.bib.bak # PyBuilder diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 94e9863b2..b639395a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: check-useless-excludes # - id: identity # Prints all files passed to pre-commits. Debugging. - repo: https://github.com/lyz-code/yamlfix - rev: 1.10.0 + rev: 1.13.0 hooks: - id: yamlfix exclude: tests/optimization/fixtures @@ -57,17 +57,17 @@ repos: - id: yamllint exclude: tests/optimization/fixtures - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black language_version: python3.10 - repo: https://github.com/asottile/blacken-docs - rev: 1.13.0 + rev: 1.15.0 hooks: - id: blacken-docs exclude: docs/source/how_to_guides/optimization/how_to_specify_constraints.md - repo: https://github.com/PyCQA/docformatter - rev: v1.7.1 + rev: v1.7.5 hooks: - id: docformatter args: @@ -78,8 +78,8 @@ repos: - '88' - --blank exclude: src/estimagic/optimization/algo_options.py - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.270 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.282 hooks: - id: ruff - repo: https://github.com/nbQA-dev/nbQA @@ -110,7 +110,7 @@ repos: - '88' files: (docs/.) - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.3.0 + rev: v2.4.0 hooks: - id: setup-cfg-fmt - repo: https://github.com/mgedmin/check-manifest diff --git a/codecov.yml b/codecov.yml index 60f4e5f65..e8f2c20b2 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,7 +9,7 @@ coverage: status: patch: default: - target: 70% + target: 30% project: default: target: 90% @@ -25,3 +25,4 @@ ignore: - src/estimagic/optimization/subsolvers/_steihaug_toint_fast.py - src/estimagic/optimization/subsolvers/gqtpar_fast.py - src/estimagic/optimization/tranquilo/clustering.py + - tests/optimization/test_tao_optimizers.py diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 68eed648b..77c38ebed 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -16,7 +16,7 @@ dependencies: - ipython - ipython_genutils - myst-nb - - pydata-sphinx-theme<=0.12.0 + - pydata-sphinx-theme - pybaum - matplotlib - seaborn diff --git a/docs/source/_static/images/estimagic_logo.svg b/docs/source/_static/images/estimagic_logo.svg new file mode 100644 index 000000000..76a896124 --- /dev/null +++ b/docs/source/_static/images/estimagic_logo.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index ba12b8dfb..8d7a6a3c8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -77,7 +77,6 @@ "petsc4py", "statsmodels", "numba", - "tranquilo", ] extlinks = { @@ -163,7 +162,7 @@ # a list of builtin themes. html_theme = "pydata_sphinx_theme" -html_logo = "_static/images/logo.svg" +html_logo = "_static/images/estimagic_logo.svg" html_theme_options = { "github_url": "https://github.com/OpenSourceEconomics/estimagic", diff --git a/docs/source/index.md b/docs/source/index.md index 0268a3ac3..fd31a67b7 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -1,4 +1,11 @@ -# estimagic +```{raw} html + +``` + +
+
estimagic is a Python package for nonlinear optimization with or without constraints. It is particularly suited to solve difficult nonlinear estimation problems. On top, it diff --git a/pyproject.toml b/pyproject.toml index 5a4c08015..5a0d5721f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,6 @@ filterwarnings = [ "ignore:In a future version, the Index constructor will not infer numeric dtypes when passed object-dtype sequences", "ignore:distutils Version classes are deprecated. Use packaging.version instead", "ignore:Standard matrix inversion failed due to LinAlgError", - "ignore:Tranquilo is extremely experimental", "ignore:delta_grad == 0.0", "ignore:Widget._active_widgets is deprecated", "ignore:Widget._widget_types is deprecated", diff --git a/src/estimagic/optimization/tranquilo.py b/src/estimagic/optimization/tranquilo.py index 6574d936c..4c989fb66 100644 --- a/src/estimagic/optimization/tranquilo.py +++ b/src/estimagic/optimization/tranquilo.py @@ -6,7 +6,7 @@ from functools import partial from estimagic.decorators import mark_minimizer - tranquilo = mark_minimizer( + tranquilo_scalar = mark_minimizer( func=partial(_tranquilo, functype="scalar"), name="tranquilo", primary_criterion_entry="value", @@ -24,6 +24,6 @@ is_global=False, ) - __all__ = ["tranquilo", "tranquilo_ls"] + __all__ = ["tranquilo_scalar", "tranquilo_ls"] else: __all__ = [] diff --git a/src/estimagic/parameters/parameter_groups.py b/src/estimagic/parameters/parameter_groups.py index 1cf06c80b..cba3cb536 100644 --- a/src/estimagic/parameters/parameter_groups.py +++ b/src/estimagic/parameters/parameter_groups.py @@ -38,7 +38,6 @@ def get_params_groups_and_short_names(params, free_mask, max_group_size=8): if len(pd.unique(groups)) == len(groups): groups = ["Parameters"] * len(groups) - groups = groups counts = pd.value_counts(groups) to_be_split = counts[counts > max_group_size] for group_name, n_occurrences in to_be_split.items(): diff --git a/tests/optimization/test_tao_optimizers.py b/tests/optimization/test_tao_optimizers.py index c6169d956..984bdc350 100644 --- a/tests/optimization/test_tao_optimizers.py +++ b/tests/optimization/test_tao_optimizers.py @@ -78,7 +78,7 @@ def test_max_iters(): algo_options={"stopping.max_iterations": 25}, ) - assert result.message == "user defined" or result.message == "step size small" + assert result.message in ("user defined", "step size small") def test_grtol(): @@ -99,9 +99,9 @@ def test_grtol(): }, ) - assert ( - result.message == "relative_gradient_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "relative_gradient_tolerance below critical value", + "step size small", ) @@ -123,9 +123,9 @@ def test_gatol(): }, ) - assert ( - result.message == "absolute_gradient_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "absolute_gradient_tolerance below critical value", + "step size small", ) @@ -147,9 +147,9 @@ def test_gttol(): }, ) - assert ( - result.message == "gradient_total_tolerance below critical value" - or result.message == "step size small" + assert result.message in ( + "gradient_total_tolerance below critical value", + "step size small", )