From d2525a74e290e6b109dcd419fc84580dff005329 Mon Sep 17 00:00:00 2001 From: Aaron Meyer Date: Tue, 8 Sep 2026 19:48:30 -0700 Subject: [PATCH 1/2] fix: Declare tlviz as a core dependency for scrise.plotting.stability scrise/plotting/__init__.py unconditionally imports stability.py, which imports tlviz.factor_tools. tlviz was only listed in the "analysis" dependency group, not in the package's core dependencies, so a plain `pip install scRISE` followed by `import scrise.plotting` raised ModuleNotFoundError. Add tlviz to core dependencies, matching the existing precedent of matplotlib/seaborn/hdf5plugin being both core deps and members of the analysis group, and regenerate uv.lock. Fixes #541 Co-Authored-By: Claude Sonnet 5 --- pyproject.toml | 1 + uv.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9319c253..2087d738 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ dependencies = [ "hdf5plugin>=7.0.0", "matplotlib>=3.8", "seaborn>=0.13.2", + "tlviz>=0.1.1", ] readme = "README.md" diff --git a/uv.lock b/uv.lock index f0f98e6c..32cc3b0c 100644 --- a/uv.lock +++ b/uv.lock @@ -2108,6 +2108,7 @@ dependencies = [ { name = "scipy" }, { name = "seaborn" }, { name = "tensorly" }, + { name = "tlviz" }, { name = "tqdm" }, { name = "vsparse" }, ] @@ -2174,6 +2175,7 @@ requires-dist = [ { name = "scipy", specifier = ">=1.16" }, { name = "seaborn", specifier = ">=0.13.2" }, { name = "tensorly", specifier = ">=0.9.0" }, + { name = "tlviz", specifier = ">=0.1.1" }, { name = "tqdm", specifier = ">=4.66.1" }, { name = "vsparse", specifier = ">=0.2.0" }, ] From 0fa514a5b796c03c651a9e08bb131bc20d1abbd9 Mon Sep 17 00:00:00 2001 From: Aaron Meyer Date: Tue, 8 Sep 2026 19:49:37 -0700 Subject: [PATCH 2/2] fix: Re-typeset MathJax equations after instant navigation The theme enables navigation.instant, which swaps page content via client-side fetch instead of a full page load. MathJax's default startup only typesets once on initial load, so pymdownx.arithmatex equations on any page reached via instant navigation stayed as raw LaTeX source instead of rendering. Add docs/javascripts/mathjax.js, which configures MathJax's tex delimiters/options to match arithmatex's generic mode and subscribes to document$ (mkdocs-material's instant-navigation event) to clear and re-typeset MathJax on every page swap, per mkdocs-material's documented MathJax + instant navigation setup. Load it before the polyfill/MathJax CDN scripts in extra_javascript. Co-Authored-By: Claude Sonnet 5 --- docs/javascripts/mathjax.js | 19 +++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 20 insertions(+) create mode 100644 docs/javascripts/mathjax.js diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js new file mode 100644 index 00000000..daf3bc42 --- /dev/null +++ b/docs/javascripts/mathjax.js @@ -0,0 +1,19 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; + +document$.subscribe(() => { + MathJax.startup.output.clearCache(); + MathJax.typesetClear(); + MathJax.texReset(); + MathJax.typesetPromise(); +}); diff --git a/mkdocs.yml b/mkdocs.yml index 2d8e168c..80168724 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -72,5 +72,6 @@ markdown_extensions: - md_in_html extra_javascript: + - javascripts/mathjax.js - https://polyfill.io/v3/polyfill.min.js?features=es6 - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js