From c9ee12f06c2ce03944dd627d46d149638ec37830 Mon Sep 17 00:00:00 2001 From: baharcos Date: Tue, 17 Jan 2023 16:43:39 +0100 Subject: [PATCH 01/23] Adjustments for myst-nb. --- docs/rtd_environment.yml | 10 +++++++++- docs/source/conf.py | 19 +++++++------------ docs/source/explanations/inference/index.md | 2 +- .../getting_started/estimation/index.md | 4 ++-- docs/source/getting_started/index.md | 4 ++-- .../how_to_guides/differentiation/index.md | 6 +++--- docs/source/how_to_guides/inference/index.md | 6 +++--- .../how_to_guides/miscellaneous/index.md | 6 +++--- .../how_to_guides/optimization/index.md | 12 ++++++------ docs/source/index.md | 6 +++--- 10 files changed, 39 insertions(+), 36 deletions(-) diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 312ccb5d9..50fe10fd9 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -17,11 +17,19 @@ dependencies: - sphinx-panels - ipython - ipython_genutils - - nbsphinx + - myst-nb - pydata-sphinx-theme>=0.3.0 - numba - pybaum - myst-parser + - matplotlib + - seaborn + - numpy + - pandas + - scipy + - patsy + - joblib + - .[ci] - pip: - ../ diff --git a/docs/source/conf.py b/docs/source/conf.py index fff7ac05f..e41290f15 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -143,18 +143,13 @@ todo_include_todos = True todo_emit_warnings = True -# -- Options for nbsphinx ---------------------------------------- -# Execute notebooks before conversion: 'always', 'never', 'auto' (default) -nbsphinx_execute = "never" -nbsphinx_prolog = r""" -{% set docname = 'docs/source/' + env.doc2path(env.docname, base=None) %} - -.. only:: html - - .. nbinfo:: - Download the notebook :download:`here - ` # noqa: E501 -""" +# -- Options for myst-nb ---------------------------------------- +nb_execution_mode = "force" +nb_execution_allow_errors = False +nb_merge_streams = True + +# Notebook cell execution timeout; defaults to 30. +nb_execution_timeout = 1000 # -- Options for HTML output ---------------------------------------------- diff --git a/docs/source/explanations/inference/index.md b/docs/source/explanations/inference/index.md index 893f64c91..5ab7a1773 100644 --- a/docs/source/explanations/inference/index.md +++ b/docs/source/explanations/inference/index.md @@ -4,6 +4,6 @@ :maxdepth: 1 bootstrap_ci -bootstrap_montecarlo_comparison.ipynb +bootstrap_montecarlo_comparison cluster_robust_likelihood_inference.md ``` diff --git a/docs/source/getting_started/estimation/index.md b/docs/source/getting_started/estimation/index.md index 263be074d..99fcad6c4 100644 --- a/docs/source/getting_started/estimation/index.md +++ b/docs/source/getting_started/estimation/index.md @@ -8,6 +8,6 @@ publication quality latex or html tables. ```{toctree} :maxdepth: 1 -first_likelihood_estimation_with_estimagic.ipynb -first_msm_estimation_with_estimagic.ipynb +first_likelihood_estimation_with_estimagic +first_msm_estimation_with_estimagic ``` diff --git a/docs/source/getting_started/index.md b/docs/source/getting_started/index.md index 34656b72e..0e8e9fedf 100644 --- a/docs/source/getting_started/index.md +++ b/docs/source/getting_started/index.md @@ -76,7 +76,7 @@ as a reference for more experienced users. :maxdepth: 1 installation -first_optimization_with_estimagic.ipynb +first_optimization_with_estimagic estimation/index -first_derivative_with_estimagic.ipynb +first_derivative_with_estimagic ``` diff --git a/docs/source/how_to_guides/differentiation/index.md b/docs/source/how_to_guides/differentiation/index.md index dd8ff6d00..0ca6ed694 100644 --- a/docs/source/how_to_guides/differentiation/index.md +++ b/docs/source/how_to_guides/differentiation/index.md @@ -3,7 +3,7 @@ ```{toctree} :maxdepth: 1 -how_to_calculate_first_derivatives.ipynb -how_to_calculate_second_derivatives.ipynb -how_to_plot_derivatives.ipynb +how_to_calculate_first_derivatives +how_to_calculate_second_derivatives +how_to_plot_derivatives ``` diff --git a/docs/source/how_to_guides/inference/index.md b/docs/source/how_to_guides/inference/index.md index ed08250c0..61fffdc63 100644 --- a/docs/source/how_to_guides/inference/index.md +++ b/docs/source/how_to_guides/inference/index.md @@ -3,7 +3,7 @@ ```{toctree} :maxdepth: 1 -how_to_calculate_likelihood_standard_errors.ipynb -how_to_calculate_msm_standard_errors.ipynb -how_to_do_bootstrap_inference.ipynb +how_to_calculate_likelihood_standard_errors +how_to_calculate_msm_standard_errors +how_to_do_bootstrap_inferences ``` diff --git a/docs/source/how_to_guides/miscellaneous/index.md b/docs/source/how_to_guides/miscellaneous/index.md index 6dabc4c48..ae079f42e 100644 --- a/docs/source/how_to_guides/miscellaneous/index.md +++ b/docs/source/how_to_guides/miscellaneous/index.md @@ -3,8 +3,8 @@ ```{toctree} :maxdepth: 1 -how_to_generate_publication_quality_tables.ipynb -how_to_use_batch_evaluators.ipynb -how_to_visualize_and_interpret_sensitivity_measures.ipynb +how_to_generate_publication_quality_tables +how_to_use_batch_evaluators +how_to_visualize_and_interpret_sensitivity_measures faq ``` diff --git a/docs/source/how_to_guides/optimization/index.md b/docs/source/how_to_guides/optimization/index.md index 78bb68298..669584ea9 100644 --- a/docs/source/how_to_guides/optimization/index.md +++ b/docs/source/how_to_guides/optimization/index.md @@ -11,11 +11,11 @@ how_to_specify_bounds how_to_specify_constraints how_to_use_logging how_to_use_the_dashboard -how_to_handle_errors_during_optimization.ipynb +how_to_handle_errors_during_optimization how_to_scale_optimization_problems -how_to_do_multistart_optimizations.ipynb -how_to_benchmark_optimization_algorithms.ipynb -how_to_visualize_histories.ipynb -how_to_visualize_an_optimization_problem.ipynb -how_to_pick_an_optimizer.ipynb +how_to_do_multistart_optimizations +how_to_benchmark_optimization_algorithms +how_to_visualize_histories +how_to_visualize_an_optimization_problem +how_to_pick_an_optimizer ``` diff --git a/docs/source/index.md b/docs/source/index.md index aa8bf8fc7..f3c5713d5 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -160,6 +160,6 @@ development/index algorithms ``` -[how to do multistart]: how_to_guides/optimization/how_to_do_multistart_optimizations.ipynb -[how to use logging]: how_to_guides/optimization/how_to_use_logging.ipynb -[msm tutorial]: getting_started/estimation/first_msm_estimation_with_estimagic.ipynb +[how to do multistart]: how_to_guides/optimization/how_to_do_multistart_optimizations +[how to use logging]: how_to_guides/optimization/how_to_use_logging +[msm tutorial]: getting_started/estimation/first_msm_estimation_with_estimagic From e6e6ee9029f41915ea9ce8e1d58b124b0e89d851 Mon Sep 17 00:00:00 2001 From: baharcos Date: Wed, 18 Jan 2023 12:15:53 +0100 Subject: [PATCH 02/23] Exclude notebook with patsy. --- docs/source/conf.py | 9 +++++++++ environment.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e41290f15..e3aac7b35 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -151,6 +151,15 @@ # Notebook cell execution timeout; defaults to 30. nb_execution_timeout = 1000 +# List of notebooks that will not be executed. +nb_execution_excludepatterns = [ + # Includes patsy that is not found in the doc build + # Even though it was added to the rtd_environment + 'getting_started/estimation/first_likelihood_estimation_with_estimagic', + # Slow notebook: long time to load tf.ds + 'notebooks/neural_network_with_tfds_data.*', +] + # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/environment.yml b/environment.yml index fee259a56..c509b8671 100644 --- a/environment.yml +++ b/environment.yml @@ -35,7 +35,7 @@ dependencies: - pydata-sphinx-theme>=0.3.0 # docs - myst-parser # docs - - nbsphinx # docs + - myst-nb # docs - sphinx # docs - sphinx-copybutton # docs - sphinx-panels # docs From d61dd1433ba3ff858fd56fb0b2bf922b85a418dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 11:17:19 +0000 Subject: [PATCH 03/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .envs/testenv-linkcheck.yml | 2 +- docs/source/conf.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.envs/testenv-linkcheck.yml b/.envs/testenv-linkcheck.yml index c48bc5b5f..184ceff79 100644 --- a/.envs/testenv-linkcheck.yml +++ b/.envs/testenv-linkcheck.yml @@ -12,7 +12,7 @@ dependencies: - pydata-sphinx-theme>=0.3.0 # docs - myst-parser # docs - - nbsphinx # docs + - myst-nb # docs - sphinx # docs - sphinx-copybutton # docs - sphinx-panels # docs diff --git a/docs/source/conf.py b/docs/source/conf.py index e3aac7b35..c5ca7c6fd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -155,9 +155,9 @@ nb_execution_excludepatterns = [ # Includes patsy that is not found in the doc build # Even though it was added to the rtd_environment - 'getting_started/estimation/first_likelihood_estimation_with_estimagic', + "getting_started/estimation/first_likelihood_estimation_with_estimagic", # Slow notebook: long time to load tf.ds - 'notebooks/neural_network_with_tfds_data.*', + "notebooks/neural_network_with_tfds_data.*", ] # -- Options for HTML output ---------------------------------------------- From 8ad464af5e58fb1cc0102fb4cd261f455c1e265e Mon Sep 17 00:00:00 2001 From: baharcos Date: Wed, 18 Jan 2023 12:39:06 +0100 Subject: [PATCH 04/23] Fix configuration? --- docs/source/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c5ca7c6fd..eba843c87 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -156,8 +156,6 @@ # Includes patsy that is not found in the doc build # Even though it was added to the rtd_environment "getting_started/estimation/first_likelihood_estimation_with_estimagic", - # Slow notebook: long time to load tf.ds - "notebooks/neural_network_with_tfds_data.*", ] # -- Options for HTML output ---------------------------------------------- From d167947f7b634beffcbf83cd0d108e142c84a716 Mon Sep 17 00:00:00 2001 From: baharcos Date: Wed, 18 Jan 2023 12:42:14 +0100 Subject: [PATCH 05/23] Add myst-nb to conf. --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index eba843c87..330b3c312 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,7 +45,7 @@ "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx_copybutton", - "nbsphinx", + "myst-nb", "sphinxcontrib.bibtex", "sphinx_panels", "sphinx_copybutton", From dbe3b8179f4cd13170d7ea0549d79e4b1697b771 Mon Sep 17 00:00:00 2001 From: baharcos Date: Wed, 18 Jan 2023 12:48:51 +0100 Subject: [PATCH 06/23] Fix bug --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 330b3c312..c7c32067a 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,7 +45,7 @@ "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx_copybutton", - "myst-nb", + "myst_nb", "sphinxcontrib.bibtex", "sphinx_panels", "sphinx_copybutton", From 70e210464c6a2ab69d2ba57d5a70a1713931b413 Mon Sep 17 00:00:00 2001 From: baharcos Date: Wed, 18 Jan 2023 12:58:36 +0100 Subject: [PATCH 07/23] Re-adjust the environment. --- docs/rtd_environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 50fe10fd9..373c71c78 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -29,7 +29,6 @@ dependencies: - scipy - patsy - joblib - - .[ci] - pip: - ../ From f243a8e6d437bda7d5f4abd96f437e1f5bcec698 Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 17:38:16 +0100 Subject: [PATCH 08/23] Add .ipynb for excluded notebooks to source suffix. --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c7c32067a..c6c03a069 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -104,7 +104,7 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -source_suffix = [".rst", ".md"] +source_suffix = [".rst", ".md", ".ipynb"] # The master toctree document. master_doc = "index" From 1fefbd33b4345b3a048b626b3afe1d252c57fecf Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 17:39:23 +0100 Subject: [PATCH 09/23] ipynb before md --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index c6c03a069..e56b6b1ee 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -104,7 +104,7 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -source_suffix = [".rst", ".md", ".ipynb"] +source_suffix = [".rst", ".ipynb", ".md"] # The master toctree document. master_doc = "index" From f78487bebfa30bef4b05a0611ddfcb60f5142088 Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 17:54:47 +0100 Subject: [PATCH 10/23] Remove myst-parser --- .envs/testenv-linkcheck.yml | 1 - environment.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.envs/testenv-linkcheck.yml b/.envs/testenv-linkcheck.yml index 184ceff79..568f60f65 100644 --- a/.envs/testenv-linkcheck.yml +++ b/.envs/testenv-linkcheck.yml @@ -11,7 +11,6 @@ dependencies: - pydata-sphinx-theme>=0.3.0 # docs - - myst-parser # docs - myst-nb # docs - sphinx # docs - sphinx-copybutton # docs diff --git a/environment.yml b/environment.yml index c509b8671..caa010885 100644 --- a/environment.yml +++ b/environment.yml @@ -34,7 +34,6 @@ dependencies: - sqlalchemy>=1.3 # run, tests - pydata-sphinx-theme>=0.3.0 # docs - - myst-parser # docs - myst-nb # docs - sphinx # docs - sphinx-copybutton # docs From 3b6bf297406cc416201b69e6be497ce961a3f649 Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 18:04:00 +0100 Subject: [PATCH 11/23] Fix? --- docs/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e56b6b1ee..78773efd3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -49,7 +49,6 @@ "sphinxcontrib.bibtex", "sphinx_panels", "sphinx_copybutton", - "myst_parser", ] myst_enable_extensions = [ From f83cde36cb31ba7b3b24f70ab82e8b0601ad533e Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 18:47:38 +0100 Subject: [PATCH 12/23] Fix cell errors? --- docs/rtd_environment.yml | 5 ++++- docs/source/conf.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 373c71c78..6c53b601c 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -21,7 +21,6 @@ dependencies: - pydata-sphinx-theme>=0.3.0 - numba - pybaum - - myst-parser - matplotlib - seaborn - numpy @@ -29,6 +28,10 @@ dependencies: - scipy - patsy - joblib + - plotly + - kaleido + - Py-BOBYQA + - DFO-LS - pip: - ../ diff --git a/docs/source/conf.py b/docs/source/conf.py index 78773efd3..b9c1f8206 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,6 +18,8 @@ import datetime as dt import os from importlib.metadata import version +from IPython.core.display import HTML +from IPython.display import IFrame, Latex year = dt.datetime.now().year From 9391d9c3075797a52f84d0b8543bca37977ffdcf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 17:48:21 +0000 Subject: [PATCH 13/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b9c1f8206..25bc9c41b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,8 +18,7 @@ import datetime as dt import os from importlib.metadata import version -from IPython.core.display import HTML -from IPython.display import IFrame, Latex + year = dt.datetime.now().year From 0fc121423b1d62c6de15cc9c1e406d7b39e43d68 Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 18:53:34 +0100 Subject: [PATCH 14/23] pip install three packages --- docs/rtd_environment.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 6c53b601c..170a81d67 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -29,9 +29,9 @@ dependencies: - patsy - joblib - plotly - - kaleido - - Py-BOBYQA - - DFO-LS - pip: - ../ + - kaleido + - Py-BOBYQA + - DFO-LS From dc88b0e1fa44f01f6a85d7b9c8e09b749c3878df Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 17:55:33 +0000 Subject: [PATCH 15/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 25bc9c41b..78773efd3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,7 +20,6 @@ from importlib.metadata import version - year = dt.datetime.now().year author = "Janos Gabler" From e9f9a17febd1464c503129dcd900e5fa6f711640 Mon Sep 17 00:00:00 2001 From: baharcos Date: Mon, 23 Jan 2023 21:24:36 +0100 Subject: [PATCH 16/23] add ipython to rtd_environment --- docs/rtd_environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml index 170a81d67..f9d5c3e8c 100644 --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -29,6 +29,7 @@ dependencies: - patsy - joblib - plotly + - ipython - pip: - ../ From fda3d69c4f2ba0678fa89f7ce0f360df73de549e Mon Sep 17 00:00:00 2001 From: baharcos Date: Tue, 24 Jan 2023 13:43:20 +0100 Subject: [PATCH 17/23] Execute all notebooks. --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 78773efd3..6c7263be6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -154,7 +154,7 @@ nb_execution_excludepatterns = [ # Includes patsy that is not found in the doc build # Even though it was added to the rtd_environment - "getting_started/estimation/first_likelihood_estimation_with_estimagic", + #"getting_started/estimation/first_likelihood_estimation_with_estimagic", ] # -- Options for HTML output ---------------------------------------------- From 4695127c49b0d81a208f53997de9e9f0c2e72ca2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 12:45:53 +0000 Subject: [PATCH 18/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6c7263be6..e21eb13b4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -154,7 +154,7 @@ nb_execution_excludepatterns = [ # Includes patsy that is not found in the doc build # Even though it was added to the rtd_environment - #"getting_started/estimation/first_likelihood_estimation_with_estimagic", + # "getting_started/estimation/first_likelihood_estimation_with_estimagic", ] # -- Options for HTML output ---------------------------------------------- From f3f939e9585f15eb7853e1c6bb6a8dae97ac1fb5 Mon Sep 17 00:00:00 2001 From: baharcos Date: Tue, 24 Jan 2023 15:05:08 +0100 Subject: [PATCH 19/23] Polish algorithm documentation --- docs/source/algorithms.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/algorithms.md b/docs/source/algorithms.md index 093b98b72..4ff85495b 100644 --- a/docs/source/algorithms.md +++ b/docs/source/algorithms.md @@ -144,7 +144,7 @@ you install estimagic. The criterion function need not be differentiable. - Powell's method is a conjugate direction method, minimising the function by a + Powell's method is a conjugate direction method, minimizing the function by a bi-directional search in each parameter's dimension. The argument ``direc``, which is the initial set of direction vectors and which @@ -188,7 +188,7 @@ you install estimagic. - **stopping.max_iterations** (int): If the maximum number of iterations is reached, the optimization stops, but we do not count this as convergence. - **norm** (float): Order of the vector norm that is used to calculate the gradient's "score" that - is compared to the gradient tolerance to determine convergence. Defaut is infinite which means that + is compared to the gradient tolerance to determine convergence. Default is infinite which means that the largest entry of the gradient vector is compared to the gradient tolerance. ``` @@ -286,7 +286,7 @@ you install estimagic. Minimize a scalar function of one or more variables using the COBYLA algorithm. COBYLA stands for Constrained Optimization By Linear Approximation. - It is deriviative-free and supports nonlinear inequality and equality constraints. + It is derivative-free and supports nonlinear inequality and equality constraints. .. note:: Cobyla's general nonlinear constraints is not supported yet by estimagic. @@ -398,12 +398,12 @@ you install estimagic. .. note:: Its general nonlinear constraints' handling is not supported yet by estimagic. - It swiches between two implementations depending on the problem definition. + It switches between two implementations depending on the problem definition. It is the most versatile constrained minimization algorithm implemented in SciPy and the most appropriate for large-scale problems. For equality constrained problems it is an implementation of Byrd-Omojokun Trust-Region SQP method described in :cite:`Lalee1998` and in :cite:`Conn2000`, - p. 549. When inequality constraints are imposed as well, it swiches to the + p. 549. When inequality constraints are imposed as well, it switches to the trust-region interior point method described in :cite:`Byrd1999`. This interior point algorithm in turn, solves inequality constraints by introducing slack variables and solving a sequence of equality-constrained @@ -744,7 +744,7 @@ you install estimagic. - **local_algo_options**: (dict) Additional keyword arguments for the local minimizer. Check the documentation of the local scipy algorithms for details on what is supported. - - **initial_temperature** (float): The temparature algorithm starts with. The higer values lead to a wider search space. The range is (0.01, 5.e4] and defalt is 5230.0. + - **initial_temperature** (float): The temparature algorithm starts with. The higher values lead to a wider search space. The range is (0.01, 5.e4] and default is 5230.0. - **restart_temperature_ratio** (float): Reanneling starts when the algorithm is decreased to initial_temperature * restart_temperature_ratio. Default is 2e-05. - **visit** (float): Specify the thickness of visiting distribution's tails. Range is (1, 3] and default is scipy's default, 2.62. - **accept** (float): Controls the probability of acceptance. Range is (-1e4, -5] and default is scipy's default, -5.0. Smaller values lead to lower acceptance probability. From 6762f4e6e3b66dc1dc01047e5658a798955e0fb4 Mon Sep 17 00:00:00 2001 From: baharcos Date: Tue, 24 Jan 2023 17:03:21 +0100 Subject: [PATCH 20/23] Wrap up --- docs/source/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e21eb13b4..372ac46ed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -152,9 +152,8 @@ # List of notebooks that will not be executed. nb_execution_excludepatterns = [ - # Includes patsy that is not found in the doc build - # Even though it was added to the rtd_environment - # "getting_started/estimation/first_likelihood_estimation_with_estimagic", + # Problem with latex rendering + "/how_to_guides/miscellaneous/how_to_generate_publication_quality_tables", ] # -- Options for HTML output ---------------------------------------------- From 13e44cea82d9932971b5719808b8ace47c2a94f9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:36:33 +0000 Subject: [PATCH 21/23] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../inference/bootstrap_montecarlo_comparison.ipynb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/source/explanations/inference/bootstrap_montecarlo_comparison.ipynb b/docs/source/explanations/inference/bootstrap_montecarlo_comparison.ipynb index 60656e8bc..889fb09fa 100644 --- a/docs/source/explanations/inference/bootstrap_montecarlo_comparison.ipynb +++ b/docs/source/explanations/inference/bootstrap_montecarlo_comparison.ipynb @@ -81,9 +81,7 @@ " cluster = []\n", "\n", " for g in range(nclusters):\n", - "\n", " for i in range(nobs_per_cluster):\n", - "\n", " key = (i + 1) * (g + 1) - 1\n", "\n", " arg = (\n", @@ -136,7 +134,6 @@ " \"\"\"\n", "\n", " def logit_wrap(df):\n", - "\n", " y = df[\"y\"]\n", " x = df[\"x\"]\n", "\n", @@ -145,12 +142,10 @@ " return pd.Series(result, index=[\"constant\", \"x\"])\n", "\n", " if cluster is False:\n", - "\n", " result = em.bootstrap(data=data, outcome=logit_wrap, n_draws=sample_size)\n", " estimates = pd.DataFrame(result.outcomes)[\"x\"]\n", "\n", " else:\n", - "\n", " result = em.bootstrap(\n", " data=data,\n", " outcome=logit_wrap,\n", @@ -189,7 +184,6 @@ " np.zeros(nsim)\n", "\n", " def loop():\n", - "\n", " df = create_clustered_data(nclusters, nobs_per_cluster, true_beta)\n", "\n", " return [get_t_values(df), get_t_values(df, cluster=True)]\n", @@ -231,7 +225,6 @@ "results_list = []\n", "\n", "for g, k in [[20, 50], [100, 10], [500, 2]]:\n", - "\n", " results_list.append(monte_carlo(nsim=100, nclusters=g, nobs_per_cluster=k))" ] }, From fcfb039c65cc737fe77bdc73bfd3a75d1cc05ebd Mon Sep 17 00:00:00 2001 From: Janos Gabler Date: Tue, 7 Feb 2023 10:13:28 +0100 Subject: [PATCH 22/23] Remove link-check action. --- .github/workflows/main.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf01731e0..bc5946186 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,25 +77,6 @@ jobs: micromamba activate estimagic pytest -m "not slow and not jax" - check-links-in-documentation: - name: Check links in documentation. - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: create build environment - uses: mamba-org/provision-with-micromamba@main - with: - environment-file: ./.envs/testenv-linkcheck.yml - environment-name: estimagic - cache-env: true - extra-specs: python=3.10 - - name: run sphinx - shell: bash -l {0} - run: | - micromamba activate estimagic - cd docs/source - sphinx-build -T -b linkcheck -d doctrees . linkcheck - code-in-docs: name: Run code snippets in documentation runs-on: ubuntu-latest From 78ae2f0c4f1c9ece904471021205d4dd6e043f21 Mon Sep 17 00:00:00 2001 From: Janos Gabler Date: Tue, 7 Feb 2023 11:21:03 +0100 Subject: [PATCH 23/23] Exclude monte carlo notebook because it is too slow. --- docs/source/algorithms.md | 2 +- docs/source/conf.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/algorithms.md b/docs/source/algorithms.md index 4b861fb8e..939aa1890 100644 --- a/docs/source/algorithms.md +++ b/docs/source/algorithms.md @@ -586,7 +586,7 @@ install estimagic. The algorithm supports the following options: - **local_algorithm** (str/callable): Any scipy local minimizer: valid options are. - "Nelder-Mead". "Powell". "CG". "BFGS". "Newton-CG". "L-BFGS-B". "TNC". "COBYLA". + "Nelder-Mead". "Powell". "CG". "BFGS". "Newton-CG". "L-BFGS-B". "TNC". "COBYLA". "SLSQP". "trust-constr". "dogleg". "trust-ncg". "trust-exact". "trust-krylov". or a custom function for local minimization, default is "L-BFGS-B". - **n_local_optimizations**: (int) The number local optimizations. Default is 100 as in scipy's default. diff --git a/docs/source/conf.py b/docs/source/conf.py index ea162d5de..fb8f336a9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -152,7 +152,9 @@ # List of notebooks that will not be executed. nb_execution_excludepatterns = [ # Problem with latex rendering - "/how_to_guides/miscellaneous/how_to_generate_publication_quality_tables", + "how_to_generate_publication_quality_tables.ipynb", + # too long runtime + "bootstrap_montecarlo_comparison.ipynb", ] # -- Options for HTML output ----------------------------------------------