Skip to content

Commit

Permalink
Add estimagic logo to documentation page (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrosian authored Aug 13, 2023
1 parent fcd95f1 commit 0db0e16
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage:
status:
patch:
default:
target: 70%
target: 30%
project:
default:
target: 90%
Expand All @@ -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
2 changes: 1 addition & 1 deletion docs/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- ipython
- ipython_genutils
- myst-nb
- pydata-sphinx-theme<=0.12.0
- pydata-sphinx-theme
- pybaum
- matplotlib
- seaborn
Expand Down
119 changes: 119 additions & 0 deletions docs/source/_static/images/estimagic_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"petsc4py",
"statsmodels",
"numba",
"tranquilo",
]

extlinks = {
Expand Down Expand Up @@ -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",
Expand Down
9 changes: 8 additions & 1 deletion docs/source/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# estimagic
```{raw} html
<div id="logo" style="text-align:center;">
<img src="_static/images/estimagic_logo.svg" alt="estimagic icon" height="100" />
</div>
```

<br>
<br>

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
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/estimagic/optimization/tranquilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -24,6 +24,6 @@
is_global=False,
)

__all__ = ["tranquilo", "tranquilo_ls"]
__all__ = ["tranquilo_scalar", "tranquilo_ls"]
else:
__all__ = []
1 change: 0 additions & 1 deletion src/estimagic/parameters/parameter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
20 changes: 10 additions & 10 deletions tests/optimization/test_tao_optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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",
)


Expand All @@ -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",
)


Expand All @@ -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",
)


Expand Down

0 comments on commit 0db0e16

Please sign in to comment.