Skip to content

Commit dd0b2b8

Browse files
authored
simplify pre-commit and jupytext settings (#483)
* modify pre-commit and jupytext * ignore myst files when building docs
1 parent fafe18f commit dd0b2b8

File tree

106 files changed

+23
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+23
-138
lines changed

.jupytext.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
notebook_metadata_filter = "substitutions"
2-
3-
[formats]
4-
"examples/" = "ipynb"
5-
"myst_nbs/" = ".myst.md:myst"
1+
notebook_metadata_filter = "substitutions,-jupytext.text_representation.jupytext_version"
2+
formats = ["ipynb", ".myst.md:myst"]

.pre-commit-config.yaml

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
repos:
2-
- repo: https://github.com/mwouts/jupytext
3-
rev: v1.13.7
4-
hooks:
5-
- id: jupytext
6-
files: ^examples/.+\.ipynb$
7-
args: ["--sync"]
82
- repo: https://github.com/psf/black
93
rev: 22.3.0
104
hooks:
@@ -63,7 +57,7 @@ repos:
6357
name: Check no references that should be sphinx cross-references are urls
6458
description: >-
6559
'A quick check to prevent urls pointing to pymc docs or other sphinx built docs like arviz, numpy, scipy...'
66-
files: ^examples/
60+
files: ^examples/.+\.ipynb$
6761
exclude: >
6862
(?x)(index.md|
6963
404.md|
@@ -108,10 +102,4 @@ repos:
108102
hooks:
109103
- id: jupytext
110104
files: ^examples/.+\.ipynb$
111-
args: ["--sync"]
112-
- repo: https://github.com/codespell-project/codespell
113-
rev: v2.1.0
114-
hooks:
115-
- id: codespell
116-
files: myst_nbs/
117-
args: ["--write-changes", "--ignore-words-list", "hist,fpr,fro,lik", "--uri-ignore-words-list", "*"]
105+
args: [--from, ipynb, --to, ".myst.md:myst"]

myst_nbs/case_studies/BART_introduction.myst.md renamed to examples/case_studies/BART_introduction.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/BEST.myst.md renamed to examples/case_studies/BEST.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: bayes_toolbox
109
language: python

myst_nbs/case_studies/GEV.myst.md renamed to examples/case_studies/GEV.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc4-dev
109
language: python

myst_nbs/case_studies/LKJ.myst.md renamed to examples/case_studies/LKJ.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/bayesian_ab_testing_introduction.myst.md renamed to examples/case_studies/bayesian_ab_testing_introduction.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3.8.10 ('pymc-examples-ipRlw-UN')
109
language: python

myst_nbs/case_studies/binning.myst.md renamed to examples/case_studies/binning.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python [conda env:pymc_env]
109
language: python

myst_nbs/case_studies/blackbox_external_likelihood.myst.md renamed to examples/case_studies/blackbox_external_likelihood.myst.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python
@@ -573,7 +572,7 @@ import warnings
573572
574573
warnings.simplefilter(
575574
action="ignore", category=FutureWarning
576-
) # suppress emcee autocorr FutureWarning
575+
) # suppress emcee autocorr FutureWarning
577576
578577
matplotlib.rcParams["font.size"] = 18
579578

myst_nbs/case_studies/blackbox_external_likelihood_numpy.myst.md renamed to examples/case_studies/blackbox_external_likelihood_numpy.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/conditional-autoregressive-model.myst.md renamed to examples/case_studies/conditional-autoregressive-model.myst.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python
@@ -644,7 +643,7 @@ class Sparse_CAR(distribution.Continuous):
644643
self.W = theano.sparse.as_sparse_variable(w_sparse)
645644
self.D = tt.as_tensor_variable(D)
646645
647-
# Precision Matrix (inverse of Covariance matrix)
646+
# Precision Matrix (inverse of Covariance matrix)
648647
# d_sparse = scipy.sparse.csr_matrix(np.diag(D))
649648
# self.D = theano.sparse.as_sparse_variable(d_sparse)
650649
# self.Phi = self.tau * (self.D - self.alpha*self.W)

myst_nbs/case_studies/factor_analysis.myst.md renamed to examples/case_studies/factor_analysis.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jupytext:
55
extension: .md
66
format_name: myst
77
format_version: 0.13
8-
jupytext_version: 1.13.7
98
kernelspec:
109
display_name: Python 3 (ipykernel)
1110
language: python

myst_nbs/case_studies/hierarchical_partial_pooling.myst.md renamed to examples/case_studies/hierarchical_partial_pooling.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3.10.5 ('pymc-dev')
109
language: python

myst_nbs/case_studies/item_response_nba.myst.md renamed to examples/case_studies/item_response_nba.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/mediation_analysis.myst.md renamed to examples/case_studies/mediation_analysis.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/moderation_analysis.myst.md renamed to examples/case_studies/moderation_analysis.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc-dev-py39
109
language: python

myst_nbs/case_studies/multilevel_modeling.myst.md renamed to examples/case_studies/multilevel_modeling.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/probabilistic_matrix_factorization.myst.md renamed to examples/case_studies/probabilistic_matrix_factorization.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/putting_workflow.myst.md renamed to examples/case_studies/putting_workflow.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3.10.6 ('pymc_env')
109
language: python

myst_nbs/case_studies/reinforcement_learning.myst.md renamed to examples/case_studies/reinforcement_learning.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/rugby_analytics.myst.md renamed to examples/case_studies/rugby_analytics.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/spline.myst.md renamed to examples/case_studies/spline.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/case_studies/stochastic_volatility.myst.md renamed to examples/case_studies/stochastic_volatility.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc_env
109
language: python

myst_nbs/case_studies/wrapping_jax_function.myst.md renamed to examples/case_studies/wrapping_jax_function.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc-examples
109
language: python

myst_nbs/causal_inference/difference_in_differences.myst.md renamed to examples/causal_inference/difference_in_differences.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc_env
109
language: python

myst_nbs/causal_inference/excess_deaths.myst.md renamed to examples/causal_inference/excess_deaths.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc_env
109
language: python

myst_nbs/causal_inference/interrupted_time_series.myst.md renamed to examples/causal_inference/interrupted_time_series.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc_env
109
language: python

myst_nbs/causal_inference/regression_discontinuity.myst.md renamed to examples/causal_inference/regression_discontinuity.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jupytext:
55
extension: .md
66
format_name: myst
77
format_version: 0.13
8-
jupytext_version: 1.13.7
98
kernelspec:
109
display_name: pymc-dev-py39
1110
language: python

examples/conf.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"**/.ipynb_checkpoints/*",
4343
"extra_installs.md",
4444
"page_footer.md",
45+
"**/*.myst.md",
4546
]
4647

4748

@@ -174,7 +175,7 @@ def setup(app: Sphinx):
174175
citation_code = f"""
175176
```bibtex
176177
@incollection{{citekey,
177-
author = "<notebook authors, see above>"
178+
author = "<notebook authors, see above>",
178179
title = "<notebook title>",
179180
editor = "PyMC Team",
180181
booktitle = "PyMC examples",
@@ -190,7 +191,7 @@ def setup(app: Sphinx):
190191
"extra_install_notes": "",
191192
"citation_code": citation_code,
192193
}
193-
jupyter_execute_notebooks = "off"
194+
nb_execution_mode = "off"
194195

195196
rediraffe_redirects = {
196197
"index.md": "gallery.md",
@@ -227,13 +228,13 @@ def setup(app: Sphinx):
227228
intersphinx_mapping = {
228229
"aesara": ("https://aesara.readthedocs.io/en/latest/", None),
229230
"arviz": ("https://python.arviz.org/en/latest/", None),
230-
"bambi": ("https://bambinos.github.io/bambi/main", None),
231+
"bambi": ("https://bambinos.github.io/bambi", None),
231232
"einstats": ("https://einstats.python.arviz.org/en/latest/", None),
232233
"mpl": ("https://matplotlib.org/", None),
233234
"numpy": ("https://numpy.org/doc/stable/", None),
234235
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
235236
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
236237
"pmx": ("https://www.pymc.io/projects/experimental/en/latest/", None),
237238
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
238-
"xarray": ("http://docs.xarray.dev/en/stable/", None),
239+
"xarray": ("https://docs.xarray.dev/en/stable/", None),
239240
}

myst_nbs/diagnostics_and_criticism/Bayes_factor.myst.md renamed to examples/diagnostics_and_criticism/Bayes_factor.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3
109
language: python

myst_nbs/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.myst.md renamed to examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/diagnostics_and_criticism/model_averaging.myst.md renamed to examples/diagnostics_and_criticism/model_averaging.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/diagnostics_and_criticism/sampler-stats.myst.md renamed to examples/diagnostics_and_criticism/sampler-stats.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jupytext:
55
extension: .md
66
format_name: myst
77
format_version: 0.13
8-
jupytext_version: 1.13.7
98
kernelspec:
109
display_name: Python 3 (ipykernel)
1110
language: python

myst_nbs/gaussian_processes/GP-Circular.myst.md renamed to examples/gaussian_processes/GP-Circular.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc3
109
language: python

myst_nbs/gaussian_processes/GP-Heteroskedastic.myst.md renamed to examples/gaussian_processes/GP-Heteroskedastic.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python [conda env:pymc3]
109
language: python

myst_nbs/gaussian_processes/GP-Kron.myst.md renamed to examples/gaussian_processes/GP-Kron.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3 (ipykernel)
109
language: python

myst_nbs/gaussian_processes/GP-Latent.myst.md renamed to examples/gaussian_processes/GP-Latent.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: pymc-dev
109
language: python

myst_nbs/gaussian_processes/GP-Marginal.myst.md renamed to examples/gaussian_processes/GP-Marginal.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3
109
language: python

myst_nbs/gaussian_processes/GP-MaunaLoa.myst.md renamed to examples/gaussian_processes/GP-MaunaLoa.myst.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ jupytext:
44
extension: .md
55
format_name: myst
66
format_version: 0.13
7-
jupytext_version: 1.13.7
87
kernelspec:
98
display_name: Python 3
109
language: python

0 commit comments

Comments
 (0)