Skip to content

Commit

Permalink
simplify pre-commit and jupytext settings (#483)
Browse files Browse the repository at this point in the history
* modify pre-commit and jupytext

* ignore myst files when building docs
  • Loading branch information
OriolAbril authored Dec 27, 2022
1 parent fafe18f commit dd0b2b8
Show file tree
Hide file tree
Showing 106 changed files with 23 additions and 138 deletions.
7 changes: 2 additions & 5 deletions .jupytext.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
notebook_metadata_filter = "substitutions"

[formats]
"examples/" = "ipynb"
"myst_nbs/" = ".myst.md:myst"
notebook_metadata_filter = "substitutions,-jupytext.text_representation.jupytext_version"
formats = ["ipynb", ".myst.md:myst"]
16 changes: 2 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
repos:
- repo: https://github.com/mwouts/jupytext
rev: v1.13.7
hooks:
- id: jupytext
files: ^examples/.+\.ipynb$
args: ["--sync"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
Expand Down Expand Up @@ -63,7 +57,7 @@ repos:
name: Check no references that should be sphinx cross-references are urls
description: >-
'A quick check to prevent urls pointing to pymc docs or other sphinx built docs like arviz, numpy, scipy...'
files: ^examples/
files: ^examples/.+\.ipynb$
exclude: >
(?x)(index.md|
404.md|
Expand Down Expand Up @@ -108,10 +102,4 @@ repos:
hooks:
- id: jupytext
files: ^examples/.+\.ipynb$
args: ["--sync"]
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
files: myst_nbs/
args: ["--write-changes", "--ignore-words-list", "hist,fpr,fro,lik", "--uri-ignore-words-list", "*"]
args: [--from, ipynb, --to, ".myst.md:myst"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: bayes_toolbox
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc4-dev
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3.8.10 ('pymc-examples-ipRlw-UN')
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python [conda env:pymc_env]
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down Expand Up @@ -573,7 +572,7 @@ import warnings
warnings.simplefilter(
action="ignore", category=FutureWarning
) # suppress emcee autocorr FutureWarning
) # suppress emcee autocorr FutureWarning
matplotlib.rcParams["font.size"] = 18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down Expand Up @@ -644,7 +643,7 @@ class Sparse_CAR(distribution.Continuous):
self.W = theano.sparse.as_sparse_variable(w_sparse)
self.D = tt.as_tensor_variable(D)
# Precision Matrix (inverse of Covariance matrix)
# Precision Matrix (inverse of Covariance matrix)
# d_sparse = scipy.sparse.csr_matrix(np.diag(D))
# self.D = theano.sparse.as_sparse_variable(d_sparse)
# self.Phi = self.tau * (self.D - self.alpha*self.W)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3.10.5 ('pymc-dev')
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc-dev-py39
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3.10.6 ('pymc_env')
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc_env
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc-examples
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc_env
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc_env
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc_env
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc-dev-py39
language: python
Expand Down
9 changes: 5 additions & 4 deletions examples/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"**/.ipynb_checkpoints/*",
"extra_installs.md",
"page_footer.md",
"**/*.myst.md",
]


Expand Down Expand Up @@ -174,7 +175,7 @@ def setup(app: Sphinx):
citation_code = f"""
```bibtex
@incollection{{citekey,
author = "<notebook authors, see above>"
author = "<notebook authors, see above>",
title = "<notebook title>",
editor = "PyMC Team",
booktitle = "PyMC examples",
Expand All @@ -190,7 +191,7 @@ def setup(app: Sphinx):
"extra_install_notes": "",
"citation_code": citation_code,
}
jupyter_execute_notebooks = "off"
nb_execution_mode = "off"

rediraffe_redirects = {
"index.md": "gallery.md",
Expand Down Expand Up @@ -227,13 +228,13 @@ def setup(app: Sphinx):
intersphinx_mapping = {
"aesara": ("https://aesara.readthedocs.io/en/latest/", None),
"arviz": ("https://python.arviz.org/en/latest/", None),
"bambi": ("https://bambinos.github.io/bambi/main", None),
"bambi": ("https://bambinos.github.io/bambi", None),
"einstats": ("https://einstats.python.arviz.org/en/latest/", None),
"mpl": ("https://matplotlib.org/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None),
"pymc": ("https://www.pymc.io/projects/docs/en/stable/", None),
"pmx": ("https://www.pymc.io/projects/experimental/en/latest/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"xarray": ("http://docs.xarray.dev/en/stable/", None),
"xarray": ("https://docs.xarray.dev/en/stable/", None),
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc3
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python [conda env:pymc3]
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: pymc-dev
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3
language: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.13.7
kernelspec:
display_name: Python 3
language: python
Expand Down
Loading

0 comments on commit dd0b2b8

Please sign in to comment.