diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb3b1a0cf8..286aecd9f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,6 +38,8 @@ repos: hooks: - id: no-print-statements files: ^pymc3/ + - id: conda-env-sorter + files: ^conda-envs/environment-dev-py.+\.yml$ - repo: local hooks: - id: check-no-tests-are-ignored @@ -47,13 +49,6 @@ repos: language: python name: Check no tests are ignored pass_filenames: false - - id: conda-env-sort - additional_dependencies: [pyyaml] - entry: python scripts/sort_conda_envs.py - files: ^conda-envs/environment-dev-py37\.yml$ - language: python - name: Sort dependencies in conda envs - types: [yaml] - id: pip-from-conda additional_dependencies: [pyyaml] entry: python scripts/generate_pip_deps_from_conda.py diff --git a/conda-envs/environment-dev-py37.yml b/conda-envs/environment-dev-py37.yml index 20caf9e6d7..39a1d88f5c 100644 --- a/conda-envs/environment-dev-py37.yml +++ b/conda-envs/environment-dev-py37.yml @@ -13,9 +13,9 @@ dependencies: - libblas=*=*mkl - mkl-service - myst-nb -- numpy=1.15 +- numpy>=1.15 - numpydoc>=0.9 -- pandas=0.24 +- pandas>=0.24 - pre-commit>=2.8.0 - pydata-sphinx-theme - pytest-cov>=2.5 @@ -25,7 +25,10 @@ dependencies: - recommonmark>=0.4 - scipy>1.4.1 - sphinx-autobuild>=0.7 +- sphinx-notfound-page - sphinx-panels - sphinx>=1.5 - typing-extensions - watermark +- pip: + - sphinx-design diff --git a/conda-envs/environment-dev-py38.yml b/conda-envs/environment-dev-py38.yml index b7b7e5325f..614b8e11f1 100644 --- a/conda-envs/environment-dev-py38.yml +++ b/conda-envs/environment-dev-py38.yml @@ -13,10 +13,9 @@ dependencies: - libblas=*=*mkl - mkl-service - myst-nb -- nbsphinx>=0.4 - numpy>=1.15.0 - numpydoc>=0.9 -- pandas +- pandas>=0.24.0 - pre-commit>=2.8.0 - pydata-sphinx-theme - pytest-cov>=2.5 @@ -26,7 +25,10 @@ dependencies: - recommonmark>=0.4 - scipy>1.4.1 - sphinx-autobuild>=0.7 +- sphinx-notfound-page - sphinx-panels - sphinx>=1.5 - typing-extensions>=3.7.4 - watermark +- pip: + - sphinx-design diff --git a/conda-envs/environment-dev-py39.yml b/conda-envs/environment-dev-py39.yml index 546c54ed9d..fff17b0c6d 100644 --- a/conda-envs/environment-dev-py39.yml +++ b/conda-envs/environment-dev-py39.yml @@ -13,7 +13,6 @@ dependencies: - libblas=*=*mkl - mkl-service - myst-nb -- nbsphinx>=0.4 - numpy>=1.15.0 - numpydoc>=0.9 - pandas>=0.24.0 @@ -26,7 +25,10 @@ dependencies: - recommonmark>=0.4 - scipy>1.4.1 - sphinx-autobuild>=0.7 +- sphinx-notfound-page - sphinx-panels - sphinx>=1.5 - typing-extensions>=3.7.4 - watermark +- pip: + - sphinx-design diff --git a/conda-envs/windows-environment-dev-py38.yml b/conda-envs/windows-environment-dev-py38.yml index 82affd358a..5259a74b57 100644 --- a/conda-envs/windows-environment-dev-py38.yml +++ b/conda-envs/windows-environment-dev-py38.yml @@ -24,7 +24,6 @@ dependencies: # Extra stuff for dev, testing and docs build - ipython>=7.16 - myst-nb -- nbsphinx>=0.4 - numpydoc>=0.9 - pre-commit>=2.8.0 - pydata-sphinx-theme @@ -32,6 +31,9 @@ dependencies: - pytest>=3.0 - recommonmark>=0.4 - sphinx-autobuild>=0.7 +- sphinx-notfound-page - sphinx-panels - sphinx>=1.5 - watermark +- pip: + - sphinx-design diff --git a/docs/source/404.md b/docs/source/404.md new file mode 100644 index 0000000000..f3b2356207 --- /dev/null +++ b/docs/source/404.md @@ -0,0 +1,44 @@ +--- +orphan: true +--- + +# Page not found + +**Sorry, we could not find this page** + +We are working on the next major release for PyMC, +which will come with faster sampling, more flexible +model building, multiple computational backends... + +::::{grid} 3 +:::{grid-item} +![old banner](https://raw.githubusercontent.com/pymc-devs/pymc/v3/docs/logos/svg/PyMC3_banner.svg) +::: +:::{grid-item} +:class: text-center +{fas}`arrow-alt-circle-right;fa-5x` +::: +:::{grid-item} +![new banner](https://raw.githubusercontent.com/pymc-devs/pymc/main/docs/logos/svg/PyMC_banner.svg) +::: +:::: + +...and much better documentation too! However, to +do so we have moved some files around and we have +modified the base url in order to support multi version docs +(you'll see the version switcher at the bottom right of the page). + +::::{grid} 3 +:::{grid-item} +::: +:::{grid-item} +```{button-link} https://docs.pymc.io/en/stable/ +:color: primary +:expand: + +Back to stable version documentation +``` +::: +:::{grid-item} +::: +:::: diff --git a/docs/source/conf.py b/docs/source/conf.py index 2017f59df5..c899b9a441 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -49,7 +49,9 @@ "sphinx.ext.napoleon", "gallery_generator", "myst_nb", + "sphinx_design", "sphinx_panels", + "notfound.extension", ] # Don't auto-generate summary for class members. @@ -83,9 +85,12 @@ # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# -# The short X.Y version. + version = pymc.__version__ +if os.environ.get("READTHEDOCS", False): + rtd_version = os.environ.get("READTHEDOCS_VERSION", "") + if "." not in rtd_version and rtd_version.lower() != "stable": + version = "dev" # The full version, including alpha/beta/rc tags. release = version @@ -96,6 +101,9 @@ # Usually you set "language" from the command line for these cases. language = None +# configure notfound extension to not add any prefix to the urls +notfound_urls_prefix = "/en/latest/" + # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' diff --git a/requirements-dev.txt b/requirements-dev.txt index a3107a4c73..84935561c3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,7 +9,6 @@ fastprogress>=0.2.0 h5py>=2.7 ipython>=7.16 myst-nb -nbsphinx>=0.4 numpy>=1.15.0 numpydoc>=0.9 pandas>=0.24.0 @@ -20,6 +19,8 @@ pytest>=3.0 recommonmark>=0.4 scipy>1.4.1 sphinx-autobuild>=0.7 +sphinx-design +sphinx-notfound-page sphinx-panels sphinx>=1.5 typing-extensions>=3.7.4 diff --git a/scripts/sort_conda_envs.py b/scripts/sort_conda_envs.py deleted file mode 100644 index 299892858e..0000000000 --- a/scripts/sort_conda_envs.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -Sort dependencies in conda environment files. - -This is intended to be used as a pre-commit hook, see `.pre-commit-config.yaml`. -You can run it manually with `pre-commit run conda-env-sort --all`. -""" - -import argparse - -import yaml - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("files", nargs="*") - args = parser.parse_args() - for file_ in args.files: - with open(file_) as fd: - doc = yaml.safe_load(fd) - doc["dependencies"].sort() - with open(file_, "w") as fd: - yaml.dump(doc, fd, sort_keys=False)