From c48f81417ded1bb065b16f9b6a13219c707e5570 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Wed, 14 Aug 2024 10:58:59 +0000 Subject: [PATCH 01/43] BUG: fix JSONC support --- asv/commands/common_args.py | 2 +- asv/config.py | 2 +- asv/main.py | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/asv/commands/common_args.py b/asv/commands/common_args.py index eb88d96a7..94dc8e899 100644 --- a/asv/commands/common_args.py +++ b/asv/commands/common_args.py @@ -26,7 +26,7 @@ def add_global_arguments(parser, suppress_defaults=True): parser.add_argument( "--config", help="Benchmark configuration file", - default=(argparse.SUPPRESS if suppress_defaults else 'asv.conf.json')) + default=(argparse.SUPPRESS if suppress_defaults else None)) parser.add_argument( "--version", action="version", version="%(prog)s " + __version__, diff --git a/asv/config.py b/asv/config.py index 2bf614ec7..8d2f7a5c4 100644 --- a/asv/config.py +++ b/asv/config.py @@ -16,7 +16,7 @@ def _get_config_path(): Return the path of the config file if exactly one is found. """ extensions = ['.json', '.jsonc'] - path = Path('asv.conf') + path = Path('asv.conf.json') num_matches = 0 for e in extensions: diff --git a/asv/main.py b/asv/main.py index 9fd4ffe1a..5060228c1 100644 --- a/asv/main.py +++ b/asv/main.py @@ -18,12 +18,11 @@ def main(): log.enable(args.verbose) - args.config = os.path.abspath(args.config) - # Use the path to the config file as the cwd for the remainder of - # the run - dirname = os.path.dirname(args.config) - os.chdir(dirname) + # the run. + # If using the default path, stay in the same dir. + if args.config: + os.chdir(os.path.dirname(os.path.abspath(args.config))) try: result = args.func(args) From 43da6f89337979765df8722e6d4157cb73c35ca0 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Thu, 15 Aug 2024 20:28:33 +0000 Subject: [PATCH 02/43] MAINT: pin setuptools --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d2e4a8eb..bdf4559f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,9 @@ plugs = [ [build-system] requires = [ "wheel", - "setuptools>=64", + # pin setuptools: + # https://github.com/airspeed-velocity/asv/pull/1426#issuecomment-2290658198 + "setuptools>=64,<72.2.0", "setuptools_scm>=6", ] build-backend = "setuptools.build_meta" From 02bf5a90a68553a213098abfe1b0df04f561d4ad Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:16:21 +0100 Subject: [PATCH 03/43] BUG: fix extraction of conda version --- asv/plugins/conda.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asv/plugins/conda.py b/asv/plugins/conda.py index 2819f4a67..27969dceb 100644 --- a/asv/plugins/conda.py +++ b/asv/plugins/conda.py @@ -147,7 +147,10 @@ def _setup(self): try: env_file_name = self._conda_environment_file or env_file.name - conda_version = self._run_conda(['--version'], env=env) + conda_version = re.search( + r'\d+(\.\d+)+', + self._run_conda(['--version'], env=env) + )[0] log.info(f"conda version: {conda_version}") # https://conda.io/projects/conda/en/latest/release-notes.html#id8 if conda_version >= "24.3.0": From d8c398a7b62ce7cf142cb7e7e67b620f257b418c Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:17:41 +0100 Subject: [PATCH 04/43] ENH: use packaging.version.Version for comparing version strings --- asv/plugins/conda.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asv/plugins/conda.py b/asv/plugins/conda.py index 27969dceb..ad983c64c 100644 --- a/asv/plugins/conda.py +++ b/asv/plugins/conda.py @@ -5,6 +5,8 @@ import contextlib from pathlib import Path +from packaging.version import Version + from .. import environment, util from ..console import log @@ -153,7 +155,7 @@ def _setup(self): )[0] log.info(f"conda version: {conda_version}") # https://conda.io/projects/conda/en/latest/release-notes.html#id8 - if conda_version >= "24.3.0": + if Version(conda_version) >= Version("24.3.0"): self._run_conda(['env', 'create', '-f', env_file_name, '-p', self._path, "--yes"], env=env) From f37b51165b9ab1f7037c3a16f32ecf7cbf7d9d8a Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:39:48 +0100 Subject: [PATCH 05/43] MAINT: pin setuptools --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8d2e4a8eb..bdf4559f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,9 @@ plugs = [ [build-system] requires = [ "wheel", - "setuptools>=64", + # pin setuptools: + # https://github.com/airspeed-velocity/asv/pull/1426#issuecomment-2290658198 + "setuptools>=64,<72.2.0", "setuptools_scm>=6", ] build-backend = "setuptools.build_meta" From ddac01a489bd1df375089b19a7eb5f5917ead1d7 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sun, 25 Aug 2024 21:01:01 +0100 Subject: [PATCH 06/43] DOC: add to author list --- docs/source/credits.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/credits.rst b/docs/source/credits.rst index 3432ab6b6..00e94d5b9 100644 --- a/docs/source/credits.rst +++ b/docs/source/credits.rst @@ -73,6 +73,7 @@ The rest of the contributors are listed in alphabetical order. - Rok Mihevc - Sayed Adel - serge-sans-paille +- Sofía Miñano - Sourcery AI - Thomas Pfaff - Thomas Robitaille From 29aeaf1ca149ed57bc077165c330c498bdf1ed45 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:12:39 +0000 Subject: [PATCH 07/43] MAINT: Remove dev outright Closes gh-1427 --- asv/commands/__init__.py | 1 - asv/commands/dev.py | 32 -------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 asv/commands/dev.py diff --git a/asv/commands/__init__.py b/asv/commands/__init__.py index 0790fc8e7..b61af95e9 100644 --- a/asv/commands/__init__.py +++ b/asv/commands/__init__.py @@ -14,7 +14,6 @@ 'Machine', 'Setup', 'Run', - 'Dev', 'Continuous', 'Find', 'Rm', diff --git a/asv/commands/dev.py b/asv/commands/dev.py deleted file mode 100644 index 1a9375120..000000000 --- a/asv/commands/dev.py +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed under a 3-clause BSD style license - see LICENSE.rst - -from .run import Run - - -class Dev(Run): - @classmethod - def setup_arguments(cls, subparsers): - parser = subparsers.add_parser( - "dev", help="Do a test run of a benchmark suite during development", - description=""" - This runs a benchmark suite in a mode that is useful - during development. It is equivalent to - ``asv run --python=same``""") - - cls._setup_arguments(parser, env_default_same=True) - - parser.set_defaults(func=cls.run_from_args) - - return parser - - @classmethod - def run(cls, conf, **kwargs): - raise RuntimeError( - "`asv dev` has been removed. It was a shortcut of `asv run`, which " - "you can use instead. It was removed because it caused confusion, " - "in particular after changing what it was running in asv 0.5.x\n\n" - "You can be interested in the next `asv run` arguments:\n" - " - `--python=same`: to use the current environment and not create one\n" - " - `--quick`: to run benchmarks just once\n" - " - `--dry-run`: to not save the results\n" - ) From 331ece92d11bc7d6c49ef0957ce12cdc19f311d7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:16:31 +0000 Subject: [PATCH 08/43] BLD: Add a catch-all asv[all] target --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index bdf4559f6..b4460722c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,6 +80,7 @@ hg = [ plugs = [ "asv-bench-memray", ] +all = ["asv[test,doc,dev,virtualenv,hg,plugs]"] [build-system] requires = [ "wheel", From bd7ade0da2720c06c587749b53fd8567f2b8aad9 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:17:22 +0000 Subject: [PATCH 09/43] BLD: Cleanup unnecessary virtualenv group --- pyproject.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b4460722c..d54cb5a6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ dependencies = [ "build", "tabulate", "virtualenv", + "packaging", "tomli; python_version < '3.11'", "colorama; platform_system == 'Windows'", "pyyaml; platform_python_implementation != \"PyPy\"", @@ -52,7 +53,6 @@ test = [ "pytest-timeout", "pytest-rerunfailures>=10.0", "filelock", - "virtualenv", "numpy", "scipy; platform_python_implementation != \"PyPy\"", "feedparser", @@ -70,17 +70,13 @@ dev = [ "ruff", "isort >= 5.11.5", ] -virtualenv = [ - "virtualenv", - "packaging", -] hg = [ "python-hglib", ] plugs = [ "asv-bench-memray", ] -all = ["asv[test,doc,dev,virtualenv,hg,plugs]"] +all = ["asv[test,doc,dev,hg,plugs]"] [build-system] requires = [ "wheel", From 564efda85b20e027a4781d6d081e34ad4986e224 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:18:15 +0000 Subject: [PATCH 10/43] MAINT: Cleanup to not include test dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d54cb5a6c..465ff099a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ hg = [ plugs = [ "asv-bench-memray", ] -all = ["asv[test,doc,dev,hg,plugs]"] +all = ["asv[doc,dev,hg,plugs]"] [build-system] requires = [ "wheel", From e60a3bc6e93f6f76fe1bffaaa91bafeb8ec7a77f Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:22:34 +0000 Subject: [PATCH 11/43] DOC: Remove unused make cruft --- docs/Makefile | 177 ------------------------------------ docs/make.bat | 242 -------------------------------------------------- 2 files changed, 419 deletions(-) delete mode 100644 docs/Makefile delete mode 100644 docs/make.bat diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 24f404332..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/airspeedvelocity.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/airspeedvelocity.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/airspeedvelocity" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/airspeedvelocity" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index aaf3d65f6..000000000 --- a/docs/make.bat +++ /dev/null @@ -1,242 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\airspeedvelocity.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\airspeedvelocity.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end From 4c1445a165f6b889f110c7ecb9063f29d0a6eabe Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:46:35 +0000 Subject: [PATCH 12/43] BLD: Use newer options for setuptools_scm --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 465ff099a..45db745f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,7 +117,7 @@ line_length = 99 only_sections = true [tool.setuptools_scm] -write_to = "asv/_version.py" +version_file = "asv/_version.py" [tool.cibuildwheel.linux] manylinux-x86_64-image = "manylinux2014" From 32aad70624ee47c3fdaee9d524f93364771b2e14 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:55:30 +0000 Subject: [PATCH 13/43] DOC: Use importlib for obtaining version numbers --- docs/source/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6d55f4459..c6bc4355e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import asv +from importlib.metadata import version as get_version try: import sphinx_bootstrap_theme @@ -65,10 +65,10 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = asv.__version__ # The full version, including alpha/beta/rc tags. -release = asv.__version__ +release: str = get_version("asv") +# The short X.Y.Z version. +version: str = ".".join(release.split('.')[:3]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From e28498d9313d79d880bdc5bdc0fa615501d72d1c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 14:58:13 +0000 Subject: [PATCH 14/43] DOC: Use autoapi and stop importing asv Also adds a lot more API detail --- .gitignore | 1 + docs/source/conf.py | 4 +++- docs/source/index.rst | 1 + pyproject.toml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b7b68c77..ae7e9275c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ htmlcov # Mac OSX .DS_Store /docs/html/ +docs/source/apidocs/ diff --git a/docs/source/conf.py b/docs/source/conf.py index c6bc4355e..d1bb2fe4d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,12 +39,14 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', + 'autoapi.extension', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.mathjax' ] +autoapi_dirs = ['../../asv'] + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/source/index.rst b/docs/source/index.rst index 23123c930..cd9922111 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,3 +35,4 @@ Development: https://github.com/airspeed-velocity/asv dev.rst changelog.rst credits.rst + autoapi/index.rst diff --git a/pyproject.toml b/pyproject.toml index 45db745f6..684cc8db1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ test = [ ] doc = [ "sphinx", + "sphinx-autoapi", "sphinx_bootstrap_theme", ] dev = [ From c8e6a08f7d938e0df50b6c8533f9135d4653ebc5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 15:01:50 +0000 Subject: [PATCH 15/43] DOC: Cleanup old/unused comments and options --- docs/source/conf.py | 101 +------------------------------------------- 1 file changed, 1 insertion(+), 100 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index d1bb2fe4d..6c906ad33 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,16 +1,3 @@ -# -# airspeed velocity documentation build configuration file, created by -# sphinx-quickstart on Mon Nov 18 09:12:08 2013. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - from importlib.metadata import version as get_version try: @@ -20,11 +7,6 @@ "sphinx_bootstrap_theme must be installed to build the docs." " Try `pip install sphinx_bootstrap_theme`.") -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('.')) - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -35,9 +17,6 @@ 'asv_runner': ('https://airspeed-velocity.github.io/asv_runner/', None) } -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. extensions = [ 'autoapi.extension', 'sphinx.ext.intersphinx', @@ -54,7 +33,7 @@ source_suffix = '.rst' # The encoding of source files. -# source_encoding = 'utf-8-sig' +source_encoding = 'utf-8-sig' # The root toctree document. root_doc = 'index' @@ -203,81 +182,3 @@ # Output file base name for HTML help builder. htmlhelp_basename = 'airspeedvelocitydoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # 'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'airspeedvelocity.tex', 'airspeed velocity Documentation', - 'Michael Droettboom', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('manindex', 'asv', u'Airspeed Velocity', [u'Michael Droettboom', u'Pauli Virtanen'], '1'), -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'airspeedvelocity', 'airspeed velocity Documentation', - 'Michael Droettboom', 'airspeedvelocity', 'Benchmarking suite for python code.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False From fc7bc43f081893f9908ca3a057d34bd74ca90167 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 16:15:30 +0000 Subject: [PATCH 16/43] DOC: Cleanup gitig and be explicit about conf --- .gitignore | 5 +++-- docs/source/conf.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ae7e9275c..27b93db12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Added +/docs/html/ +docs/source/autoapi/ # Compiled files *.py[cod] *.a @@ -46,5 +49,3 @@ htmlcov # Mac OSX .DS_Store -/docs/html/ -docs/source/apidocs/ diff --git a/docs/source/conf.py b/docs/source/conf.py index 6c906ad33..6fe2e9315 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,13 +18,15 @@ } extensions = [ - 'autoapi.extension', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', - 'sphinx.ext.mathjax' + 'sphinx.ext.mathjax', + 'autoapi.extension', ] autoapi_dirs = ['../../asv'] +autoapi_add_toc_entry = True +autoapi_keep_files = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From 32fb29697fe43596600f43f7bc728798b47f9c2c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 16:15:49 +0000 Subject: [PATCH 17/43] DOC: Reduce warnings and errors from Sphinx --- asv/plugins/_mamba_helpers.py | 12 +++++++++--- asv/step_detect.py | 4 ++-- docs/source/conf.py | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/asv/plugins/_mamba_helpers.py b/asv/plugins/_mamba_helpers.py index bf8518901..3b15d6bf9 100644 --- a/asv/plugins/_mamba_helpers.py +++ b/asv/plugins/_mamba_helpers.py @@ -218,18 +218,24 @@ def replace_channels(self): def solve(self, specs, pkg_cache_path=None): """Solve given a set of specs. + Parameters ---------- + specs : list of str - A list of package specs. You can use `conda.models.match_spec.MatchSpec` - to get them to the right form by calling - `MatchSpec(mypec).conda_build_form()` + A list of package specs. You can use + ``conda.models.match_spec.MatchSpec`` to get them to the right form + by calling ``MatchSpec(mypec).conda_build_form()`` + Returns ------- + transaction : libmambapy.Transaction The mamba transaction. + Raises ------ + RuntimeError : If the solver did not find a solution. """ diff --git a/asv/step_detect.py b/asv/step_detect.py index ea6009dc5..9a9f2e997 100644 --- a/asv/step_detect.py +++ b/asv/step_detect.py @@ -392,7 +392,7 @@ def detect_steps(y, w=None): constant function. Each element contains the left (inclusive) and right (exclusive) bounds of a segment, the average value on the segment, the minimum value in the segment, and the l1 error - estimate, <|Y - avg|>. Missing data points are not necessarily + estimate, :math:`|Y - avg|`. Missing data points are not necessarily contained in any segment; right_pos-1 is the last non-missing data point. @@ -541,7 +541,7 @@ def solve_potts(y, w, gamma, min_size=1, max_size=None, where J(x) is the number of jumps (x_{j+1} != x_j) in x. - The algorithm used is described in Ref. [1]_, it uses dynamic + The algorithm used is described in Ref. [1], it uses dynamic programming to find an exact solution to the problem (within the constraints specified). diff --git a/docs/source/conf.py b/docs/source/conf.py index 6fe2e9315..597970731 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -69,7 +69,7 @@ # The reST default role (used for this markup: `text`) to use for all # documents. -default_role = 'obj' +# default_role = 'obj' # Warn about all references where the target cannot be found. nitpicky = True From d7850978319fecce25c81ef2a9b108e76c57d3a5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 16:30:19 +0000 Subject: [PATCH 18/43] DOC: Rework to resolve references correctly --- asv/commands/rm.py | 3 ++- asv/plugins/mamba.py | 4 +++- docs/source/conf.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/asv/commands/rm.py b/asv/commands/rm.py index 3bf6a1cda..a2aca672d 100644 --- a/asv/commands/rm.py +++ b/asv/commands/rm.py @@ -4,7 +4,8 @@ from asv_runner.console import get_answer_default -from . import Command, util +from asv import util +from . import Command from ..console import log from ..results import iter_results diff --git a/asv/plugins/mamba.py b/asv/plugins/mamba.py index 62ad292e7..64eee75de 100644 --- a/asv/plugins/mamba.py +++ b/asv/plugins/mamba.py @@ -12,7 +12,9 @@ except ImportError: from yaml import Loader -from ._mamba_helpers import libmambapy, MambaSolver + +import libmambapy +from ._mamba_helpers import MambaSolver from .. import environment, util from ..console import log diff --git a/docs/source/conf.py b/docs/source/conf.py index 597970731..4c7e85b2f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -27,6 +27,7 @@ autoapi_dirs = ['../../asv'] autoapi_add_toc_entry = True autoapi_keep_files = True +autoapi_ignore = ["*_version*"] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From 775a0cb3f6eb37b470ca9ee7b9e643c50694c06b Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 18:00:23 +0000 Subject: [PATCH 19/43] DOC: Add a proper bibtex file Generated with betterbibtex in Zotero --- docs/source/asv.bib | 54 +++++++++++++++++++++++++++++++++++++++++++++ docs/source/conf.py | 3 +++ pyproject.toml | 1 + 3 files changed, 58 insertions(+) create mode 100644 docs/source/asv.bib diff --git a/docs/source/asv.bib b/docs/source/asv.bib new file mode 100644 index 000000000..32bcf535a --- /dev/null +++ b/docs/source/asv.bib @@ -0,0 +1,54 @@ +@article{friedrichComplexityPenalizedMEstimation2008, + title = {Complexity {{Penalized M-Estimation}}: {{Fast Computation}}}, + author = {Friedrich, F. and Kempe, A. and Liebscher, V. and Winkler, G.}, + year = {2008}, + journal = {Journal of Computational and Graphical Statistics}, + volume = {17}, + number = {1}, + eprint = {27594299}, + eprinttype = {jstor}, + pages = {201--224}, + doi = {10.1198/106186008X285591}, + langid = {english} +} + +@book{gibbonsNonparametricStatisticalInference2010, + title = {Nonparametric {{Statistical Inference}}}, + author = {Gibbons, Jean Dickinson and Chakraborti, Subhabrata}, + year = {2010}, + month = jul, + edition = {5}, + publisher = {{Chapman and Hall/CRC}}, + address = {New York}, + doi = {10.1201/9781439896129}, + isbn = {978-0-429-11188-4} +} + +@article{mannTestWhetherOne1947, + title = {On a {{Test}} of {{Whether}} One of {{Two Random Variables}} Is {{Stochastically Larger}} than the {{Other}}}, + author = {Mann, H. B. and Whitney, D. R.}, + year = {1947}, + journal = {The Annals of Mathematical Statistics}, + volume = {18}, + number = {1}, + eprint = {2236101}, + eprinttype = {jstor}, + pages = {50--60}, + doi = {10.1214/aoms/1177730491}, + langid = {english} +} + +@article{yaoEstimatingNumberChangepoints1988, + title = {Estimating the Number of Change-Points via {{Schwarz}}' Criterion}, + author = {Yao, Yi-Ching}, + year = {1988}, + month = feb, + journal = {Statistics \& Probability Letters}, + volume = {6}, + number = {3}, + pages = {181--189}, + issn = {01677152}, + doi = {10.1016/0167-7152(88)90118-6}, + urldate = {2022-12-07}, + langid = {english} +} diff --git a/docs/source/conf.py b/docs/source/conf.py index 4c7e85b2f..5c6c52108 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,6 +21,7 @@ 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.mathjax', + 'sphinxcontrib.bibtex', 'autoapi.extension', ] @@ -29,6 +30,8 @@ autoapi_keep_files = True autoapi_ignore = ["*_version*"] +bibtex_bibfiles = ["asv.bib"] + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/pyproject.toml b/pyproject.toml index 684cc8db1..4eda3d5d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ test = [ doc = [ "sphinx", "sphinx-autoapi", + "sphinxcontrib.bibtex", "sphinx_bootstrap_theme", ] dev = [ From 4652a4019cb12b432d373b55b6569d1b011aeec5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 18:15:56 +0000 Subject: [PATCH 20/43] MAINT: Use better version management --- asv/__init__.py | 4 +++- asv/commands/common_args.py | 6 ++++-- asv/commands/publish.py | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/asv/__init__.py b/asv/__init__.py index f0ca73483..6bb92147d 100644 --- a/asv/__init__.py +++ b/asv/__init__.py @@ -1,6 +1,8 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst -from asv._version import version as __version__ +from importlib.metadata import version as get_version from asv import plugin_manager # noqa F401 Needed to load the plugins +__version__ = get_version("asv") + __all__ = '__version__', diff --git a/asv/commands/common_args.py b/asv/commands/common_args.py index 94dc8e899..b0ec3662e 100644 --- a/asv/commands/common_args.py +++ b/asv/commands/common_args.py @@ -5,7 +5,8 @@ import multiprocessing import argparse -from .. import __version__, util +from asv import util +from importlib.metadata import version as get_version def add_global_arguments(parser, suppress_defaults=True): @@ -29,7 +30,8 @@ def add_global_arguments(parser, suppress_defaults=True): default=(argparse.SUPPRESS if suppress_defaults else None)) parser.add_argument( - "--version", action="version", version="%(prog)s " + __version__, + "--version", action="version", + version="%(prog)s " + get_version("asv"), help="Print program version", **suppressor) diff --git a/asv/commands/publish.py b/asv/commands/publish.py index 56ba25c97..4fe986c1f 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -5,15 +5,16 @@ import datetime from collections import defaultdict -from . import Command -from ..benchmarks import Benchmarks -from ..console import log -from ..graph import GraphSet -from ..machine import iter_machine_files -from ..repo import get_repo -from ..results import iter_results -from ..publishing import OutputPublisher -from .. import statistics, util, __version__ +from asv.commands import Command +from asv.benchmarks import Benchmarks +from asv.console import log +from asv.graph import GraphSet +from asv.machine import iter_machine_files +from asv.repo import get_repo +from asv.results import iter_results +from asv.publishing import OutputPublisher +from asv import statistics, util +from importlib.metadata import version as get_version def check_benchmark_params(name, benchmark): @@ -281,7 +282,7 @@ def copy_ignore(src, names): }, compact=True) util.write_json(os.path.join(conf.html_dir, "info.json"), { - 'asv-version': __version__, + 'asv-version': get_version("asv"), 'timestamp': util.datetime_to_js_timestamp( datetime.datetime.now(datetime.timezone.utc) ) From 51295fc2a20e061c1175148c7059f97590c9071f Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 18:18:35 +0000 Subject: [PATCH 21/43] DOC: Restructure with bibtex and more explicit pgs --- asv/statistics.py | 23 +- asv/step_detect.py | 377 +-------------------------------- docs/source/conf.py | 1 + docs/source/dev.rst | 6 - docs/source/index.rst | 1 + docs/source/step_detection.rst | 355 +++++++++++++++++++++++++++++++ 6 files changed, 385 insertions(+), 378 deletions(-) create mode 100644 docs/source/step_detection.rst diff --git a/asv/statistics.py b/asv/statistics.py index b6549e9b8..ad2709b94 100644 --- a/asv/statistics.py +++ b/asv/statistics.py @@ -76,8 +76,9 @@ def mann_whitney_u(x, y, method='auto'): """ Mann-Whitney U test - Ties are handled conservatively, returning the least significant - tie breaking. + Ties are handled conservatively, returning the least significant tie + breaking. + :cite:empty:`mwu-mannTestWhetherOne1947,mwu-gibbonsNonparametricStatisticalInference2010`. Parameters ---------- @@ -96,8 +97,10 @@ def mann_whitney_u(x, y, method='auto'): References ---------- - .. [1] Mann & Whitney, Ann. Math. Statist. 18, 50 (1947). - .. [2] Gibbons & Chakraborti, "Nonparametric statistical inference". (2003) + .. bibliography:: + :filter: docname in docnames + :labelprefix: MWU_ + :keyprefix: mwu- """ memo = _mann_whitney_u_memo @@ -177,11 +180,19 @@ def mann_whitney_u_r(m, n, u, memo=None): Number of orderings in Mann-Whitney U test. The PMF of U for samples of sizes (m, n) is given by - p(u) = r(m, n, u) / binom(m + n, m). + :cite:empty:`mwur-mannTestWhetherOne1947` + + .. code-block:: + + p(u) = r(m, n, u) / binom(m + n, m). References ---------- - .. [1] Mann & Whitney, Ann. Math. Statist. 18, 50 (1947). + .. bibliography:: + :filter: docname in docnames + :labelprefix: MWUR_ + :keyprefix: mwur- + """ if u < 0: value = 0 diff --git a/asv/step_detect.py b/asv/step_detect.py index 9a9f2e997..ce027821e 100644 --- a/asv/step_detect.py +++ b/asv/step_detect.py @@ -1,362 +1,4 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst -r"""Regression detection in ASV is based on detecting stepwise changes -in the graphs. The assumptions on the data are as follows: the curves -are piecewise constant plus random noise. We don't know the scaling of -the data or the amplitude of the noise, but assume the relative weight -of the noise amplitude is known for each data point. - -ASV measures the noise amplitude of each data point, based on a number -of samples. We use this information for weighting the different data -points: - -.. math:: - - \sigma_j = \sigma \mathrm{CI}_{99} = \sigma / w_j - -i.e., we assume the uncertainty in each measurement point is -proportional to the estimated confidence interval for each data point. -Their inverses are taken as the relative weights ``w_j``. If ``w_j=0`` -or undefined, we replace it with the median weight, or with ``1`` if -all are undefined. The step detection algorithm determines the -absolute noise amplitude itself based on all available data, which is -more robust than relying on the individual measurements. - -Step detection is a well-studied problem. In this implementation, we -mainly follow a variant of the approach outlined in [Friedrich2008]_ -and elsewhere. This provides a fast algorithm for solving the -piecewise weighted fitting problem - -.. math:: - :label: gamma-opt - - \mathop{\mathrm{argmin}}_{k,\{j\},\{\mu\}} \gamma k + - \sum_{r=1}^k\sum_{i=j_{r-1}}^{j_r} w_i |y_i - \mu_r| - -The differences are: as we do not need exact solutions, we add -additional heuristics to work around the :math:`{\mathcal O}(n^2)` -scaling, which is too harsh for pure-Python code. For details, see -``asv.step_detect.solve_potts_approx``. Moreover, we follow a -slightly different approach on obtaining a suitable number of -intervals, by selecting an optimal value for :math:`\gamma`, based on -a variant of the information criterion problem discussed in -[Yao1988]_. - - -.. [Friedrich2008] F. Friedrich et al., - ''Complexity Penalized M-Estimation: Fast Computation'', - Journal of Computational and Graphical Statistics 17.1, 201-224 (2008). - http://dx.doi.org/10.1198/106186008X285591 - -.. [Yao1988] Y.-C. Yao, - ''Estimating the number of change-points via Schwarz criterion'', - Statistics & Probability Letters 6, 181-189 (1988). - http://dx.doi.org/10.1016/0167-7152(88)90118-6 - - -Bayesian information --------------------- - -To proceed, we need an argument by which to select a suitable -:math:`\gamma` in :eq:`gamma-opt`. Some of the literature on step -detection, e.g. [Yao1988]_, suggests results based on Schwarz information -criteria, - -.. math:: - :label: ic-form - - \text{SC} = \frac{m}{2} \ln \sigma^2 + k \ln m = \text{min!} - -where :math:`\sigma^2` is maximum likelihood variance estimator (if -noise is gaussian). For the implementation, see -``asv.step_detect.solve_potts_autogamma``. - -What follows is a handwaving plausibility argument why such an -objective function makes sense, and how to end up with :math:`l_1` -rather than gaussians. Better approaches are probably to be found in -step detection literature. If you have a better formulation, -contributions/corrections are welcome! - -We assume a Bayesian model: - -.. math:: - :label: prob-model - - P(\{y_i\}_{i=1}^m|\sigma,k,\{\mu_i\}_{i=1}^k,\{j_i\}_{i=1}^{k-1}) - = - N - \sigma^{-m} - \exp( - -\sigma^{-1}\sum_{r=1}^k\sum_{i=j_{r-1}+1}^{j_r} w_i |y_i - \mu_r| - ) - -Here, :math:`y_i` are the :math:`m` data points at hand, :math:`k` is -the number of intervals, :math:`\mu_i` are the values of the function -at the intervals, :math:`j_i` are the interval breakpoints; -:math:`j_0=0`, :math:`j_k=m`, :math:`j_{r-1}0`. The effect in the -:math:`\sigma` integral is cutting off the log-divergence, so that -with sufficient accuracy we can in :eq:`bic-form` replace - -.. math:: - :label: bic-form-2 - - \ln \sigma \mapsto \ln(\sigma_0 + \sigma) - -Here, we fix a measurement accuracy floor with the following guess: -``sigma_0 = 0.1 * w0 * min(abs(diff(mu)))`` and ``sigma_0 = 0.001 * w0 -* abs(mu)`` when there is only a single interval. Here, ``w0`` is the -median weight. - -Autocorrelated noise --------------------- - -Practical experience shows that the noise in the benchmark results can be -correlated. Often benchmarks are run for multiple commits at once, for -example the new commits at a given time, and the benchmark machine -does something else between the runs. Alternatively, the background -load from other processes on the machine varies with time. - -To give a basic model for the noise correlations, we include -AR(1) Laplace noise in :eq:`prob-model`, - -.. math:: - :label: autocorr-model - - P(\{y_i\}_{i=1}^m|\sigma,\rho,k,\{\mu_i\}_{i=1}^k,\{j_i\}_{i=1}^{k-1}) - = - N - \sigma^{-m} - \exp(-\sigma^{-1}\sum_{r=1}^k\sum_{i=j_{r-1}+1}^{j_r} |\epsilon_{i,r} - \rho \epsilon_{i-1,r}|) - -where :math:`\epsilon_{i,r}=y_i-\mu_{r}` with -:math:`\epsilon_{j_{r-1},r}=y_{j_{r-1}}-\mu_{r-1}` and -:math:`\epsilon_{j_0,1}=0` are the deviations from the stepwise -model. The correlation measure :math:`\rho` is unknown, but assumed to -be constant in :math:`(-1,1)`. - -Since the parameter :math:`\rho` is global, it does not change the parameter -counting part of the Schwarz criterion. The maximum likelihood term however -does depend on :math:`\rho`, so that the problem becomes: - -.. math:: - :label: bic-form-autocorr - - \mathop{\mathrm{argmin}}_{k,\rho,\{j\},\{\mu\}} r(m) k + - \ln\sum_{r=1}^k\sum_{i=j_{r-1}}^{j_r} |\epsilon_{i,r} - \rho\epsilon_{i-1,r}| - -To save computation time, we do not solve this optimization problem -exactly. Instead, we again minimize along the :math:`\mu_r^*(\gamma)`, -:math:`j_r^*(\gamma)` curve provided by the solution to -:eq:`gamma-opt`, and use :eq:`bic-form-autocorr` only in selecting the -optimal value of the :math:`\gamma` parameter. - -The minimization vs. :math:`\rho` can be done numerically for given -:math:`\mu_r^*(\gamma)`, :math:`j_r^*(\gamma)`. This minimization step -is computationally cheap compared to the piecewise fit, so including -it will not significantly change the runtime of the total algorithm. - -Postprocessing --------------- - -For the purposes of regression detection, we do not report all steps -the above approach provides. For details, see -``asv.step_detect.detect_regressions``. - -Making use of measured variance -------------------------------- - -``asv`` measures also variance in the timings. This information is -currently used to provide relative data weighting (see above). - -""" - import math import collections @@ -541,11 +183,12 @@ def solve_potts(y, w, gamma, min_size=1, max_size=None, where J(x) is the number of jumps (x_{j+1} != x_j) in x. - The algorithm used is described in Ref. [1], it uses dynamic - programming to find an exact solution to the problem (within the - constraints specified). + The algorithm used is described in + :cite:t:`ptts-friedrichComplexityPenalizedMEstimation2008`, it uses dynamic + programming to find an exact solution to the problem (within the constraints + specified). - Computation work is ~ O(n**2 log n). + The computational cost is ~ O(n**2 log n). Parameters ---------- @@ -557,7 +200,7 @@ def solve_potts(y, w, gamma, min_size=1, max_size=None, Minimum interval size to consider max_size : int, optional Maximum interval size to consider - mu_dist : *Dist, optional + mu_dist : Dist, optional Precomputed interval means/medians and cost function values min_pos : int, optional Start point (inclusive) for the interval grid @@ -572,13 +215,15 @@ def solve_potts(y, w, gamma, min_size=1, max_size=None, List of values of the intervals dist : list List of ``sum(|y - x|**p)`` for each interval. - mu_dist : *Dist + mu_dist : Dist Precomputed interval means/medians and cost function values References ---------- - [1] F. Friedrich et al., "Complexity Penalized M-Estimation: Fast Computation", - Journal of Computational and Graphical Statistics 17.1, 201-224 (2008). + .. bibliography:: + :filter: docname in docnames + :labelprefix: PTTS_ + :keyprefix: ptts- """ diff --git a/docs/source/conf.py b/docs/source/conf.py index 5c6c52108..cbb6ad5d0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -31,6 +31,7 @@ autoapi_ignore = ["*_version*"] bibtex_bibfiles = ["asv.bib"] +bibtex_default_style = "alpha" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/source/dev.rst b/docs/source/dev.rst index b325d25c6..89d334070 100644 --- a/docs/source/dev.rst +++ b/docs/source/dev.rst @@ -310,12 +310,6 @@ To use them, at least one of the following needs to be installed: For other options regarding the webdriver to use, see ``py.test --help``. -Step detection --------------- - -.. automodule:: asv.step_detect - - Release management ------------------ diff --git a/docs/source/index.rst b/docs/source/index.rst index cd9922111..49343f011 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -33,6 +33,7 @@ Development: https://github.com/airspeed-velocity/asv tuning.rst reference.rst dev.rst + step_detection.rst changelog.rst credits.rst autoapi/index.rst diff --git a/docs/source/step_detection.rst b/docs/source/step_detection.rst new file mode 100644 index 000000000..4503356a8 --- /dev/null +++ b/docs/source/step_detection.rst @@ -0,0 +1,355 @@ +Step Detection +============== + +Regression detection in ASV is based on detecting stepwise changes +in the graphs. The assumptions on the data are as follows: the curves +are piecewise constant plus random noise. We don't know the scaling of +the data or the amplitude of the noise, but assume the relative weight +of the noise amplitude is known for each data point. + +ASV measures the noise amplitude of each data point, based on a number +of samples. We use this information for weighting the different data +points: + +.. math:: + + \sigma_j = \sigma \mathrm{CI}_{99} = \sigma / w_j + +i.e., we assume the uncertainty in each measurement point is +proportional to the estimated confidence interval for each data point. +Their inverses are taken as the relative weights ``w_j``. If ``w_j=0`` +or undefined, we replace it with the median weight, or with ``1`` if +all are undefined. The step detection algorithm determines the +absolute noise amplitude itself based on all available data, which is +more robust than relying on the individual measurements. + +Step detection is a well-studied problem. In this implementation, we mainly +follow a variant of the approach outlined in +:cite:p:`sdm-friedrichComplexityPenalizedMEstimation2008` and elsewhere. This +provides a fast algorithm for solving the piecewise weighted fitting problem + +.. math:: + :label: gamma-opt + + \mathop{\mathrm{argmin}}_{k,\{j\},\{\mu\}} \gamma k + + \sum_{r=1}^k\sum_{i=j_{r-1}}^{j_r} w_i |y_i - \mu_r| + +The differences are: as we do not need exact solutions, we add additional +heuristics to work around the :math:`{\mathcal O}(n^2)` scaling, which is too +harsh for pure-Python code. For details, see +:py:func:`asv.step_detect.solve_potts_approx`. Moreover, we follow a slightly +different approach on obtaining a suitable number of intervals, by selecting an +optimal value for :math:`\gamma`, based on a variant of the information +criterion problem discussed in +:cite:p:`sdm-yaoEstimatingNumberChangepoints1988`. + + +Bayesian information +-------------------- + +To proceed, we need an argument by which to select a suitable :math:`\gamma` in +:eq:`gamma-opt`. Some of the literature on step detection, e.g. +:cite:p:`sdm-yaoEstimatingNumberChangepoints1988`, suggests results based on +Schwarz information criteria, + +.. math:: + :label: ic-form + + \text{SC} = \frac{m}{2} \ln \sigma^2 + k \ln m = \text{min!} + +where :math:`\sigma^2` is maximum likelihood variance estimator (if +noise is gaussian). For the implementation, see +:py:func:`asv.step_detect.solve_potts_autogamma`. + +What follows is a handwaving plausibility argument why such an +objective function makes sense, and how to end up with :math:`l_1` +rather than gaussians. Better approaches are probably to be found in +step detection literature. If you have a better formulation, +contributions/corrections are welcome! + +We assume a Bayesian model: + +.. math:: + :label: prob-model + + P(\{y_i\}_{i=1}^m|\sigma,k,\{\mu_i\}_{i=1}^k,\{j_i\}_{i=1}^{k-1}) + = + N + \sigma^{-m} + \exp( + -\sigma^{-1}\sum_{r=1}^k\sum_{i=j_{r-1}+1}^{j_r} w_i |y_i - \mu_r| + ) + +Here, :math:`y_i` are the :math:`m` data points at hand, :math:`k` is +the number of intervals, :math:`\mu_i` are the values of the function +at the intervals, :math:`j_i` are the interval breakpoints; +:math:`j_0=0`, :math:`j_k=m`, :math:`j_{r-1}0`. The effect in the +:math:`\sigma` integral is cutting off the log-divergence, so that +with sufficient accuracy we can in :eq:`bic-form` replace + +.. math:: + :label: bic-form-2 + + \ln \sigma \mapsto \ln(\sigma_0 + \sigma) + +Here, we fix a measurement accuracy floor with the following guess: +``sigma_0 = 0.1 * w0 * min(abs(diff(mu)))`` and ``sigma_0 = 0.001 * w0 +* abs(mu)`` when there is only a single interval. Here, ``w0`` is the +median weight. + +Autocorrelated noise +-------------------- + +Practical experience shows that the noise in the benchmark results can be +correlated. Often benchmarks are run for multiple commits at once, for +example the new commits at a given time, and the benchmark machine +does something else between the runs. Alternatively, the background +load from other processes on the machine varies with time. + +To give a basic model for the noise correlations, we include +AR(1) Laplace noise in :eq:`prob-model`, + +.. math:: + :label: autocorr-model + + P(\{y_i\}_{i=1}^m|\sigma,\rho,k,\{\mu_i\}_{i=1}^k,\{j_i\}_{i=1}^{k-1}) + = + N + \sigma^{-m} + \exp(-\sigma^{-1}\sum_{r=1}^k\sum_{i=j_{r-1}+1}^{j_r} |\epsilon_{i,r} - \rho \epsilon_{i-1,r}|) + +where :math:`\epsilon_{i,r}=y_i-\mu_{r}` with +:math:`\epsilon_{j_{r-1},r}=y_{j_{r-1}}-\mu_{r-1}` and +:math:`\epsilon_{j_0,1}=0` are the deviations from the stepwise +model. The correlation measure :math:`\rho` is unknown, but assumed to +be constant in :math:`(-1,1)`. + +Since the parameter :math:`\rho` is global, it does not change the parameter +counting part of the Schwarz criterion. The maximum likelihood term however +does depend on :math:`\rho`, so that the problem becomes: + +.. math:: + :label: bic-form-autocorr + + \mathop{\mathrm{argmin}}_{k,\rho,\{j\},\{\mu\}} r(m) k + + \ln\sum_{r=1}^k\sum_{i=j_{r-1}}^{j_r} |\epsilon_{i,r} - \rho\epsilon_{i-1,r}| + +To save computation time, we do not solve this optimization problem +exactly. Instead, we again minimize along the :math:`\mu_r^*(\gamma)`, +:math:`j_r^*(\gamma)` curve provided by the solution to +:eq:`gamma-opt`, and use :eq:`bic-form-autocorr` only in selecting the +optimal value of the :math:`\gamma` parameter. + +The minimization vs. :math:`\rho` can be done numerically for given +:math:`\mu_r^*(\gamma)`, :math:`j_r^*(\gamma)`. This minimization step +is computationally cheap compared to the piecewise fit, so including +it will not significantly change the runtime of the total algorithm. + +Postprocessing +-------------- + +For the purposes of regression detection, we do not report all steps +the above approach provides. For details, see +``asv.step_detect.detect_regressions``. + +Making use of measured variance +------------------------------- + +``asv`` measures also variance in the timings. This information is +currently used to provide relative data weighting (see above). + +References +---------- + +.. bibliography:: + :filter: docname in docnames + :labelprefix: SDM_ + :keyprefix: sdm- From 3cc220aa935122ed79575a8f01ae91cf32e05e1b Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 19:04:28 +0000 Subject: [PATCH 22/43] DOC: Cleanup more warnings --- asv/graph.py | 18 +++++++++++------- asv/plugin_manager.py | 4 ++-- asv/step_detect.py | 4 +++- asv/util.py | 22 ++++++++++++---------- docs/source/commands.rst | 1 + docs/source/conf.py | 12 +++++++++++- 6 files changed, 40 insertions(+), 21 deletions(-) diff --git a/asv/graph.py b/asv/graph.py index a204cf2eb..190ca2607 100644 --- a/asv/graph.py +++ b/asv/graph.py @@ -16,7 +16,7 @@ class GraphSet: - """Manage multiple `Graph`""" + """Manage multiple :py:class:`Graph` objects""" def __init__(self): self._graphs = {} @@ -326,15 +326,19 @@ def make_summary_graph(graphs): def _compute_summary_data_series(*ys): """ - Given multiple input series:: + Given a multiple input series: - y0, y1, ... + .. code-block:: - calculate summary data series:: + y0, y1, ... - val = [geom_mean([y0[0], y1[0], ...]), - geom_mean([y0[1], y1[1], ...]), - ...] + calculate summary data series: + + .. code-block:: + + val = [geom_mean([y0[0], y1[0], ...]), + geom_mean([y0[1], y1[1], ...]), + ...] Missing data in each y-series is filled for each series separately, before averaging. Data points that are missing from diff --git a/asv/plugin_manager.py b/asv/plugin_manager.py index cf0e592e9..16fd68e26 100644 --- a/asv/plugin_manager.py +++ b/asv/plugin_manager.py @@ -12,8 +12,8 @@ class PluginManager: """ A class to load and manage plugins. - By default in asv, plugins are searched for in the `asv.plugins` - namespace package and in the `asv.commands` package. + By default in asv, plugins are searched for in the :py:mod:`asv.plugins` + namespace package and in the :py:mod:`asv.commands` package. Then, any modules specified in the ``plugins`` entry in the ``asv.conf.json`` file are loaded. diff --git a/asv/step_detect.py b/asv/step_detect.py index ce027821e..eb4f6ad3e 100644 --- a/asv/step_detect.py +++ b/asv/step_detect.py @@ -497,7 +497,9 @@ def merge_pieces(gamma, right, values, dists, mu_dist, max_size): class L1Dist: """ - Fast computations for:: + Fast computations for: + + .. code-block: mu(l, r) = median(y[l:r+1], weights=w[l:r+1]) dist(l, r) = sum(w*abs(x - mu(l, r)) for x, w in zip(y[l:r+1], weights[l:r+1])) diff --git a/asv/util.py b/asv/util.py index cf808b6dc..53ca9a29c 100644 --- a/asv/util.py +++ b/asv/util.py @@ -886,16 +886,18 @@ def format_text_table(rows, num_headers=0, top_header_span_start=0, top_header_text=None): """ - Format rows in as a reStructuredText table, in the vein of:: - - ========== ========== ========== - -- top header text, span start 1 - ---------- --------------------- - row0col0 r0c1 r0c2 - ========== ========== ========== - row1col0 r1c1 r1c2 - row2col0 r2c1 r2c2 - ========== ========== ========== + Format rows in as a reStructuredText table, in the vein of: + + .. code-block:: + + ========== ========== ========== + -- top header text, span start 1 + ---------- --------------------- + row0col0 r0c1 r0c2 + ========== ========== ========== + row1col0 r1c1 r1c2 + row2col0 r2c1 r2c2 + ========== ========== ========== """ diff --git a/docs/source/commands.rst b/docs/source/commands.rst index 48557f5e4..dbb1e2391 100644 --- a/docs/source/commands.rst +++ b/docs/source/commands.rst @@ -4,3 +4,4 @@ Commands .. contents:: .. automodule:: asv.commands + :no-index: diff --git a/docs/source/conf.py b/docs/source/conf.py index cbb6ad5d0..d5d5987ad 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,6 +18,7 @@ } extensions = [ + 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.mathjax', @@ -28,7 +29,16 @@ autoapi_dirs = ['../../asv'] autoapi_add_toc_entry = True autoapi_keep_files = True -autoapi_ignore = ["*_version*"] +autoapi_ignore = ["*_version*", "*migrations*"] +autoapi_options = [ + "members", + "undoc-members", + "private-members", + # "show-inheritance", + "show-module-summary", + "special-members", + "imported-members", +] bibtex_bibfiles = ["asv.bib"] bibtex_default_style = "alpha" From 2ac764534c5a530d046d09da6e778c41ae1b0d85 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 19:33:02 +0000 Subject: [PATCH 23/43] DOC: Minor cleanup with more mathjax --- asv/step_detect.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/asv/step_detect.py b/asv/step_detect.py index eb4f6ad3e..37648af3f 100644 --- a/asv/step_detect.py +++ b/asv/step_detect.py @@ -497,18 +497,20 @@ def merge_pieces(gamma, right, values, dists, mu_dist, max_size): class L1Dist: """ - Fast computations for: + Fast computations for the L1 distance measures. - .. code-block: + This computes: + + .. code-block:: mu(l, r) = median(y[l:r+1], weights=w[l:r+1]) dist(l, r) = sum(w*abs(x - mu(l, r)) for x, w in zip(y[l:r+1], weights[l:r+1])) - We do not use here an approach that has asymptotically optimal - performance; at least O(n**2 * log(n)) would be achievable, whereas - we have here O(n**3). The asymptotic performance does not matter - for solve_potts_approx, which only looks at small windows of the - data. It is more important to try to optimize the constant + We do not use here an approach that has asymptotically optimal performance; + at least :math:`O(n^2 * \log(n))` would be achievable, whereas we have here + :math:`O(n^3)`. The asymptotic performance does not matter for + :py:func:`asv.step_detect.solve_potts_approx`, which only looks at small + windows of the data. It is more important to try to optimize the constant prefactors, which for Python means minimal code. """ From 941aa2c0281993f6c4b75cfb42115ba82b8ab5af Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 19:37:46 +0000 Subject: [PATCH 24/43] DOC: Switch to katex --- docs/source/conf.py | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index d5d5987ad..bfd14a280 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,7 +21,7 @@ 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', - 'sphinx.ext.mathjax', + 'sphinxcontrib.katex', 'sphinxcontrib.bibtex', 'autoapi.extension', ] diff --git a/pyproject.toml b/pyproject.toml index 4eda3d5d2..fe2a712d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ doc = [ "sphinx", "sphinx-autoapi", "sphinxcontrib.bibtex", + "sphinxcontrib.katex", "sphinx_bootstrap_theme", ] dev = [ From 278170e683fac69c9ab8002c44eb1efb77e2dec7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 19:42:31 +0000 Subject: [PATCH 25/43] MAINT: Switch to furo --- docs/source/conf.py | 83 +-------------------------------------------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 83 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index bfd14a280..bd1406543 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,12 +1,5 @@ from importlib.metadata import version as get_version -try: - import sphinx_bootstrap_theme -except ImportError: - raise ImportError( - "sphinx_bootstrap_theme must be installed to build the docs." - " Try `pip install sphinx_bootstrap_theme`.") - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -114,30 +107,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'bootstrap' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - # This is a workaround for a bug in `sphinx_bootstrap_theme` for - # Python 3.x - 'bootswatch_theme': None -} - -# Add any paths that contain custom themes here, relative to this directory. -html_theme_path = sphinx_bootstrap_theme.get_html_theme_path() - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None +html_theme = 'furo' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -148,54 +118,3 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -html_sidebars = { - '**': [] -} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -html_show_sourcelink = False - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'airspeedvelocitydoc' diff --git a/pyproject.toml b/pyproject.toml index fe2a712d8..b3f2d1bf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ doc = [ "sphinx-autoapi", "sphinxcontrib.bibtex", "sphinxcontrib.katex", - "sphinx_bootstrap_theme", + "furo", ] dev = [ "ruff", From 9cca359af36883a6745e9ae03ad2a3d66413b967 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 19:50:21 +0000 Subject: [PATCH 26/43] MAINT: Minor rename --- docs/source/index.rst | 2 +- docs/source/{reference.rst => user_reference.rst} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename docs/source/{reference.rst => user_reference.rst} (74%) diff --git a/docs/source/index.rst b/docs/source/index.rst index 49343f011..3f41d25b3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -31,7 +31,7 @@ Development: https://github.com/airspeed-velocity/asv using.rst writing_benchmarks.rst tuning.rst - reference.rst + user_reference.rst dev.rst step_detection.rst changelog.rst diff --git a/docs/source/reference.rst b/docs/source/user_reference.rst similarity index 74% rename from docs/source/reference.rst rename to docs/source/user_reference.rst index ce0f91d61..1135e5f8e 100644 --- a/docs/source/reference.rst +++ b/docs/source/user_reference.rst @@ -1,5 +1,5 @@ -Reference -========= +User Reference +============== .. toctree:: From 2ddd459d2bb077be08bdbed37f9a111e5672c081 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:02:15 +0000 Subject: [PATCH 27/43] DOC: Add logos and theme options --- docs/source/_static/dark_logo.png | Bin 0 -> 6709 bytes docs/source/_static/light_logo.png | Bin 0 -> 7533 bytes docs/source/conf.py | 7 +++++++ 3 files changed, 7 insertions(+) create mode 100644 docs/source/_static/dark_logo.png create mode 100644 docs/source/_static/light_logo.png diff --git a/docs/source/_static/dark_logo.png b/docs/source/_static/dark_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ec18110bd8f4b203606f591c7e634ee17a57bc6e GIT binary patch literal 6709 zcmV-58p`E~P)oQmKwZd0J)5dz`qo$$z); z-(!5e6e(6Gi${x(CiM+b8Ob+v}wD`mjtt8r`Pbl= z3~=S|UkTv5*z{iu;06F2;@)0OfnGEUx$BfQ7+%OtE^^+9>n@TCPO*FH=GEckk5{>F z&jxUvGWWLu*vWbO=X9CNo{&(w;k8ceV#GX#q%B9&V?kX^14HKC9~TVpaR6%o-U8qk z8SJhw|Njl(V1$=twgjGZJ0)*!nq0&>7VKF7-p3Z845SAE>=1ct7cg%yrzI3Y zD-m)5-URBwn4~mC3Jej6{K+Uwn`0l~9p~TA1#k&~x3N&f=%?8HlTnuDVVTLY0NTx( zL10P~LfV@Xu!Wupm7()nRRVh&fOoJ@4{5wipW-}71&=Nw)XSW7JxsDJfY!v2MIb{% zbGm&YEe|nWGFaZUKMBB(0Jt2$8If`{eVFrb5q_6F_>)9|;ce3Oj%lu?ktyqtvJ_Sx z+Rqm%$OA|AmjbveQ{!c-%>Fr?j}ulv^MZ&UUDl+*HzmaaIR<9k{(3Aw9q37bJouHL z|EC7P`*f|Sd?@IPY0|PK&3h31Pz7UJs(ECEQFXboa+S1$6c>@_zq!8#Kz-tRY4v@L` zSkDwH8kb$TR|EL37QlZLz&DC~>j1w<0??Kv$QFPmpj*}>b*~10m4|O91>UE>5*2p= z&1eFAu0}T1_LLiKA^=$x&GFw&Ont}#$iDrV0RE;$@T>GHRnKKH{UKM}CioPqXihAU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FYZ=n_MCz5(4s-7j%u|YF*K3ls`=?H&o(W+CE z_L#IsuvDZg;)TF}yJ%5+1v(v6gGWtgPNxpO)peM6cY*?gMxR^&VC$xzn9w9o&HR%p zAXex+NS5tK5qI!r4&{PO8s(#TAwmaDaMK0~6g(&k(9yvU) z00765w^Dbht!X7$?U~cYrjo`$s-y8af{;Vg5EPl`)A$2d^9DNC61+myLm$^^uP7cN z!0G}zZ>`sSK=I@0dHezF`xXFbEBOyZ?FaC~g6|@LPm?yu(sq3S(9< zf=4-r_Z=mlU7j=8!|zG_E1zrXVs-x6!P_J*Vp5CHhQNdb*?NQN1YXm3DSsT|ju~|! zd+IYX{_in%2ZsP$p|-MX5@UthV=U7gR}jjmv0s`JX`bt7^%`#^@pJrv%=>4!B56~V z^$>64TQq!Mlk|Z%|GJShSuR39SE^%u&H4?4k42ymKOK%6PUnwhoyl)Mukg#PYkbd6 z@twaauU+DO$AVwG?}<;uZHlpqEI7L}@j zv;c*!hk$=9l6>Q-WPn!$ScL$#Fup6e!9ui)g>4sKU+3e8_>H6o`Fx``wSqP@5CRy2 z@c)!g6i`AEaY5)gi(*)eo!8%zN%{6=>*6gtO|`8q+p56ztugh`^>Uag*`f*V&(q=00960Qm*K5@hI9E00000 LNkvXXu0mjft9-MB literal 0 HcmV?d00001 diff --git a/docs/source/_static/light_logo.png b/docs/source/_static/light_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1a216c64848a89cf6c27b761db5c68d5e75d3a0a GIT binary patch literal 7533 zcmZ9Rbxa&wvxgUV_u|^(?p~lcrMPQ>; zo;Cmw%<(rK0{|fZlRp3e`~(1iBO3rfDi;8t@+$25AoDkYX{V{G40!pEmG)L={*7Sy zs%xuY9pGS-Ni%SCfy)5^I&F1jMT5ZA)1shs4;4R1#QwCnry~QxB#KB^QGqxGn`4CC zCGoqW2uCGpO4Uv=w7xYtF;QJagR63c{j;3`Wg@g=m{g!6Ywpvy#(IXHVu}Gkg*f*0 z=fRMxz23a@f75^u-A^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MWW_6a=0XX48=lWCR$Xr%;^%o3f!0s8 zAWs{k$@YYObtp2R!aef<5RO&32SYqNB8VHP?vI&^=EdGC)k(e@oEAh{4unyY(I*S8 z4ct6cBJUmDROTCyNRzOmIzZH0sdx%blcdL&^q8!brJH>T&Rvy-pWkcy^-U71`j)hM z>IsFv=GS;m4?m7^_J{Gry0OlWbS-vL?4S^KeMHG=bwwmc8PqjQ-I?OujcHOWg9nYH z_r>g0Q!*c#45_Osp4zgEmyK3}U$7t{F<2Dd+W#40viqu-_Xdwz6w4Eq0o*na`69*yF^z?=V8@O5@~ i0Q%axd;Nb#Qc76he~S$IVBG#?0O~3_$_;OAqW%X8gml;d literal 0 HcmV?d00001 diff --git a/docs/source/conf.py b/docs/source/conf.py index bd1406543..4ac78b132 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -118,3 +118,10 @@ # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +html_theme_options = { + "source_repository": "https://github.com/airspeed-velocity/asv/", + "source_branch": "main", + "source_directory": "docs/source/", + "light_logo": "dark_logo.png", + "dark_logo": "light_logo.png", +} From 638bd85a0e1d5cceff03b3a3512dea5391834a7b Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:05:04 +0000 Subject: [PATCH 28/43] MAINT: Rework documentation slightly --- docs/source/conf.py | 46 ------------------------------ docs/source/index.rst | 5 +++- docs/source/installing.rst | 57 +++++++++++++++++++++----------------- 3 files changed, 35 insertions(+), 73 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4ac78b132..c48a1e5aa 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -61,62 +61,16 @@ # The short X.Y.Z version. version: str = ".".join(release.split('.')[:3]) -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = [] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = 'obj' - # Warn about all references where the target cannot be found. nitpicky = True -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - - # -- Options for HTML output ---------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. html_theme = 'furo' - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. html_favicon = '_static/swallow.ico' - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] html_theme_options = { "source_repository": "https://github.com/airspeed-velocity/asv/", diff --git a/docs/source/index.rst b/docs/source/index.rst index 3f41d25b3..8300ef752 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -12,11 +12,14 @@ custom-computed values may be tracked. The results are displayed in an interactive web frontend that requires only a basic static webserver to host. -See examples of Airspeed Velocity websites: +Deployed examples of Airspeed Velocity websites: `astropy `__, `numpy `__, `scipy `__. +User examples may be found at the `asv_sample +`__ repository. + License: `BSD three-clause license `__. diff --git a/docs/source/installing.rst b/docs/source/installing.rst index 5a3edb4be..1bfbf3530 100644 --- a/docs/source/installing.rst +++ b/docs/source/installing.rst @@ -1,23 +1,30 @@ Installing airspeed velocity ============================ -**airspeed velocity** is known to work on Linux, Mac OS-X, and Windows. -It is known to work with Python 3.7 and higher. -It works also with PyPy. +**airspeed velocity** is known to work on Linux, MacOS, and Windows, for Python +3.7 and higher. PyPy 3.8 is also supported. -**airspeed velocity** is a standard Python package, and the latest -released version may be `installed in the standard -way from PyPI `__:: +**airspeed velocity** is a standard Python package, and the latest released +version may be `installed from PyPI +`__: + +.. code-block:: sh pip install asv -The development version can be installed by cloning the source -repository and running ``pip install .`` inside it, or by ``pip -install git+https://github.com/airspeed-velocity/asv``. +The development version can be installed from GitHub: + +.. code-block:: sh + + git clone git@github.com:airspeed-velocity/asv + cd asv + pip install . + # Or in one shot + pip install git+https://github.com/airspeed-velocity/asv -The requirements should be automatically installed. If they aren't -installed automatically, for example due to networking restrictions, -the ``python`` requirements are as noted in the ``pyproject.toml``. +The basic requirements should be automatically installed. If they aren't +installed automatically, for example due to networking restrictions, the +``python`` requirements are as noted in the ``pyproject.toml``. For managing the environments, one of the following packages is required: @@ -43,25 +50,23 @@ For managing the environments, one of the following packages is required: without precompiled wheels usually have to be compiled every time the environments are set up. -Optional optimization ---------------------- +Optional optimizations +---------------------- + +If your project being benchmarked contains C, C++, Objective-C or Cython, +consider installing ``ccache``. `ccache `__ is a +compiler cache that speeds up compilation time when the same objects are +repeatedly compiled. -If your project being benchmarked contains C, C++, Objective-C or -Cython, consider installing ``ccache``. `ccache -`__ is a compiler cache that speeds up -compilation time when the same objects are repeatedly compiled. In -**airspeed velocity**, the project being benchmarked is recompiled at -many different points in its history, often with only minor changes to -the source code, so ``ccache`` can help speed up the total benchmarking -time considerably. +In **airspeed velocity**, the project being benchmarked is recompiled at many +different points in its history, often with only minor changes to the source +code, so ``ccache`` can help speed up the total benchmarking time considerably. Running the self-tests ---------------------- -The self tests are based on `pytest `__. If you -don't have it installed, and you have a connection to the Internet, it -will be installed automatically. +The testsuite is based on `pytest `__. -To run **airspeed velocity**'s self tests:: +To run **airspeed velocity**'s testsuite:: pytest From 567a5348736b2d133ac1646217b37953813edb29 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:16:51 +0000 Subject: [PATCH 29/43] MAINT: Remove unused fork banner --- docs/source/_static/gh_fork.css | 56 ------------------------------ docs/source/_templates/layout.html | 1 - 2 files changed, 57 deletions(-) delete mode 100644 docs/source/_static/gh_fork.css diff --git a/docs/source/_static/gh_fork.css b/docs/source/_static/gh_fork.css deleted file mode 100644 index 1a4004ad2..000000000 --- a/docs/source/_static/gh_fork.css +++ /dev/null @@ -1,56 +0,0 @@ -/* from: https://codepo8.github.io/css-fork-on-github-ribbon/ */ -#forkongithub a{ - background:#000; - color:#fff; - text-decoration:none; - font-family:arial,sans-serif; - text-align:center; - font-weight:bold; - padding:5px 40px; - font-size:1rem; - line-height:2rem; - position:relative; - transition:0.5s; -} -#forkongithub a:hover{ - background:#c11; - color:#fff; -} -#forkongithub a::before,#forkongithub a::after{ - content:""; - width:100%; - display:block; - position:absolute; - top:1px; - left:0; - height:1px; - background:#fff; -} -#forkongithub a::after{ - bottom:1px; - top:auto; -} -@media screen and (min-width:800px){ - #forkongithub{ - position:fixed; - display:block; - top:0; - right:0; - width:200px; - overflow:hidden; - height:200px; - z-index:9999; - } - #forkongithub a{ - width:200px; - position:absolute; - top:60px; - right:-60px; - transform:rotate(45deg); - -webkit-transform:rotate(45deg); - -ms-transform:rotate(45deg); - -moz-transform:rotate(45deg); - -o-transform:rotate(45deg); - box-shadow:4px 4px 10px rgba(0,0,0,0.8); - } -} diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index dc73f7624..40074d50f 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -2,7 +2,6 @@ {% block header %} {{ super() }} -Fork me on GitHub {% endblock %} {# Custom CSS overrides #} From 514d97590c5e8e2845a6d698e4091d8362b56552 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:18:31 +0000 Subject: [PATCH 30/43] MAINT: Remove inline TOC handled by the theme --- docs/source/benchmarks.rst | 2 -- docs/source/commands.rst | 2 -- docs/source/dev.rst | 2 -- 3 files changed, 6 deletions(-) diff --git a/docs/source/benchmarks.rst b/docs/source/benchmarks.rst index f2d7bed05..9997eeb9e 100644 --- a/docs/source/benchmarks.rst +++ b/docs/source/benchmarks.rst @@ -3,8 +3,6 @@ Benchmark types and attributes .. only:: not man - .. contents:: - .. warning:: .. versionchanged:: 0.6.0 diff --git a/docs/source/commands.rst b/docs/source/commands.rst index dbb1e2391..f9b307ecc 100644 --- a/docs/source/commands.rst +++ b/docs/source/commands.rst @@ -1,7 +1,5 @@ Commands ======== -.. contents:: - .. automodule:: asv.commands :no-index: diff --git a/docs/source/dev.rst b/docs/source/dev.rst index 89d334070..e258901d1 100644 --- a/docs/source/dev.rst +++ b/docs/source/dev.rst @@ -12,8 +12,6 @@ developers and other people interested in internals of ``asv``. environments, loading plugins, and collecting the results of the benchmarks run with ``asv_runner``. -.. contents:: - Development setup ----------------- From c5f3da83167484cc4d4be812f93790156162707b Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:32:07 +0000 Subject: [PATCH 31/43] MAINT: Add and use sphinx-collapse --- docs/source/conf.py | 1 + docs/source/credits.rst | 88 ----------------------------------- docs/source/index.rst | 100 +++++++++++++++++++++++++++++++++++++--- pyproject.toml | 1 + 4 files changed, 96 insertions(+), 94 deletions(-) delete mode 100644 docs/source/credits.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index c48a1e5aa..4e1e7fc61 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -16,6 +16,7 @@ 'sphinx.ext.todo', 'sphinxcontrib.katex', 'sphinxcontrib.bibtex', + 'sphinx_collapse', 'autoapi.extension', ] diff --git a/docs/source/credits.rst b/docs/source/credits.rst deleted file mode 100644 index 00e94d5b9..000000000 --- a/docs/source/credits.rst +++ /dev/null @@ -1,88 +0,0 @@ -Credits -------- - -.. rst-class:: credits-list - -- Michael Droettboom (founder) -- Pauli Virtanen - -The rest of the contributors are listed in alphabetical order. - -- Aaron Meurer -- @afragner -- Akihiro Nitta -- Andrew Nelson -- Andrew Thomas -- Antoine Pitrou -- Antony Lee -- Ariel Silvio Norberto RAMOS -- Arne Neumann -- Boris Feld -- Chiara Marmo -- Chris Beaumont -- Christoph Deil -- Christopher Whelan -- Colin Carroll -- Daniel Andres Pinto -- David Stansby -- Dieter Werthmüller -- Dorothy Kabarozi -- @DWesl -- Edison Gustavo Muenz -- Elliott Sales de Andrade -- Eric Dill -- Erik M. Bray -- Erik Tollerud -- Erwan Pannier -- Fangchen Li -- Hans Moritz Günther -- Isuru Fernando -- Jarrod Millman -- @jbrockmendel -- jeremie du boisberranger -- John Kirkham -- Josh Soref -- Juan Nunez-Iglesias -- Julian Rüth -- Kacper Kowalik -- Kacper Kowalik (Xarthisius) -- Kevin Anderson -- @Leenkiz -- Lucas Colley -- Lucy Jiménez -- Marc Garcia -- @mariamadronah -- Mark Harfouche -- Markus Mohrhard -- Matthew Treinish -- Matthew Turk -- Matti Picus -- Mike Sarahan -- Min RK -- Nathan Goldbaum -- Nick Crews -- Nicole Franco León -- @pawel -- Paweł Redzyński -- Philippe Pepiot -- Pierre Glaser -- P. L. Lim -- Raphaël Gomès -- Richard Hattersley -- Rohit Goswami -- Rok Mihevc -- Sayed Adel -- serge-sans-paille -- Sofía Miñano -- Sourcery AI -- Thomas Pfaff -- Thomas Robitaille -- Tim Felgentreff -- Tom Augspurger -- Tushabe Catherine -- Tyler Reddy -- Valentin Haenel -- @Warbo -- Wojtek Ruszczewski -- Yaroslav Halchenko -- Zach Burnett diff --git a/docs/source/index.rst b/docs/source/index.rst index 8300ef752..9116bbcaf 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,11 +1,9 @@ -.. airspeed velocity documentation root file, created by - sphinx-quickstart on Mon Nov 18 09:12:08 2013. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - airspeed velocity ================= +Overview +-------- + **airspeed velocity** (``asv``) is a tool for benchmarking Python packages over their lifetime. Runtime, memory consumption and even custom-computed values may be tracked. The results are displayed in @@ -38,5 +36,95 @@ Development: https://github.com/airspeed-velocity/asv dev.rst step_detection.rst changelog.rst - credits.rst autoapi/index.rst + +Credits +------- + +.. collapse:: Original creators + + - Michael Droettboom (founder) + - Pauli Virtanen + +Other contributors are listed in alphabetical order. + +.. collapse:: Additional contributors + + - Aaron Meurer + - @afragner + - Akihiro Nitta + - Andrew Nelson + - Andrew Thomas + - Antoine Pitrou + - Antony Lee + - Ariel Silvio Norberto RAMOS + - Arne Neumann + - Boris Feld + - Chiara Marmo + - Chris Beaumont + - Christoph Deil + - Christopher Whelan + - Colin Carroll + - Daniel Andres Pinto + - David Stansby + - Dieter Werthmüller + - Dorothy Kabarozi + - @DWesl + - Edison Gustavo Muenz + - Elliott Sales de Andrade + - Eric Dill + - Erik M. Bray + - Erik Tollerud + - Erwan Pannier + - Fangchen Li + - Hans Moritz Günther + - Isuru Fernando + - Jarrod Millman + - @jbrockmendel + - jeremie du boisberranger + - John Kirkham + - Josh Soref + - Juan Nunez-Iglesias + - Julian Rüth + - Kacper Kowalik + - Kacper Kowalik (Xarthisius) + - Kevin Anderson + - @Leenkiz + - Lucas Colley + - Lucy Jiménez + - Marc Garcia + - @mariamadronah + - Mark Harfouche + - Markus Mohrhard + - Matthew Treinish + - Matthew Turk + - Matti Picus + - Mike Sarahan + - Min RK + - Nathan Goldbaum + - Nick Crews + - Nicole Franco León + - @pawel + - Paweł Redzyński + - Philippe Pepiot + - Pierre Glaser + - P. L. Lim + - Raphaël Gomès + - Richard Hattersley + - Rohit Goswami + - Rok Mihevc + - Sayed Adel + - serge-sans-paille + - Sofía Miñano + - Sourcery AI + - Thomas Pfaff + - Thomas Robitaille + - Tim Felgentreff + - Tom Augspurger + - Tushabe Catherine + - Tyler Reddy + - Valentin Haenel + - @Warbo + - Wojtek Ruszczewski + - Yaroslav Halchenko + - Zach Burnett diff --git a/pyproject.toml b/pyproject.toml index b3f2d1bf5..83b5bb02d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ test = [ doc = [ "sphinx", "sphinx-autoapi", + "sphinx-collapse", "sphinxcontrib.bibtex", "sphinxcontrib.katex", "furo", From 8b3f800ac27881a9d56a7c7c65ecdc8f87632aed Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:46:13 +0000 Subject: [PATCH 32/43] MAINT: Update conf --- docs/source/conf.py | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4e1e7fc61..abcfa8648 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,21 +6,21 @@ # needs_sphinx = '1.0' intersphinx_mapping = { - 'python': (' https://docs.python.org/3/', None), - 'asv_runner': ('https://airspeed-velocity.github.io/asv_runner/', None) + "python": (" https://docs.python.org/3/", None), + "asv_runner": ("https://airspeed-velocity.github.io/asv_runner/", None), } extensions = [ - 'sphinx.ext.viewcode', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinxcontrib.katex', - 'sphinxcontrib.bibtex', - 'sphinx_collapse', - 'autoapi.extension', + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", + "sphinx.ext.todo", + "sphinxcontrib.katex", + "sphinxcontrib.bibtex", + "sphinx_collapse", + "autoapi.extension", ] -autoapi_dirs = ['../../asv'] +autoapi_dirs = ["../../asv"] autoapi_add_toc_entry = True autoapi_keep_files = True autoapi_ignore = ["*_version*", "*migrations*"] @@ -38,20 +38,20 @@ bibtex_default_style = "alpha" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -source_encoding = 'utf-8-sig' +source_encoding = "utf-8-sig" # The root toctree document. -root_doc = 'index' +root_doc = "index" # General information about the project. -project = u'airspeed velocity' -copyright = u'2013--present, Michael Droettboom, Pauli Virtanen, asv Developers' +project = "airspeed velocity" +copyright = "2013--present, Michael Droettboom, Pauli Virtanen, asv Developers" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -60,23 +60,24 @@ # The full version, including alpha/beta/rc tags. release: str = get_version("asv") # The short X.Y.Z version. -version: str = ".".join(release.split('.')[:3]) +version: str = ".".join(release.split(".")[:3]) # Warn about all references where the target cannot be found. nitpicky = True # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "lightbulb" +pygments_dark_style = "one-dark" # -- Options for HTML output ---------------------------------------------- -html_theme = 'furo' -html_favicon = '_static/swallow.ico' -html_static_path = ['_static'] +html_theme = "furo" +html_favicon = "_static/swallow.ico" +html_static_path = ["_static"] html_theme_options = { "source_repository": "https://github.com/airspeed-velocity/asv/", "source_branch": "main", "source_directory": "docs/source/", - "light_logo": "dark_logo.png", + "light_logo": "dark_logo.png", "dark_logo": "light_logo.png", } From 4012ef93a334af0cb459b4181e7319471b9ac6e5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:46:21 +0000 Subject: [PATCH 33/43] MAINT: Minor cleanup of documentation --- docs/source/using.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/using.rst b/docs/source/using.rst index 211ee1954..2ee746632 100644 --- a/docs/source/using.rst +++ b/docs/source/using.rst @@ -127,7 +127,9 @@ information about the machine, such as its platform, cpu and memory. **airspeed velocity** will try to make reasonable guesses, so it's usually ok to just press ``Enter`` to accept each default value. This information is stored in the ``~/.asv-machine.json`` file in your home -directory:: +directory: + +.. code-block:: sh I will now ask you some questions about this machine to identify it in the benchmarks. From 3f970fea3dda9a29ac12400b3993ec47e0ec5ab5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 20:50:10 +0000 Subject: [PATCH 34/43] MAINT: Appease linter --- asv/__init__.py | 1 + asv/commands/common_args.py | 2 +- asv/commands/publish.py | 2 +- asv/commands/rm.py | 1 + asv/plugins/mamba.py | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/asv/__init__.py b/asv/__init__.py index 6bb92147d..dc05b7f15 100644 --- a/asv/__init__.py +++ b/asv/__init__.py @@ -1,6 +1,7 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst from importlib.metadata import version as get_version + from asv import plugin_manager # noqa F401 Needed to load the plugins __version__ = get_version("asv") diff --git a/asv/commands/common_args.py b/asv/commands/common_args.py index b0ec3662e..d631cdd7a 100644 --- a/asv/commands/common_args.py +++ b/asv/commands/common_args.py @@ -4,9 +4,9 @@ import math import multiprocessing import argparse +from importlib.metadata import version as get_version from asv import util -from importlib.metadata import version as get_version def add_global_arguments(parser, suppress_defaults=True): diff --git a/asv/commands/publish.py b/asv/commands/publish.py index 4fe986c1f..779dc0e15 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -4,6 +4,7 @@ import multiprocessing import datetime from collections import defaultdict +from importlib.metadata import version as get_version from asv.commands import Command from asv.benchmarks import Benchmarks @@ -14,7 +15,6 @@ from asv.results import iter_results from asv.publishing import OutputPublisher from asv import statistics, util -from importlib.metadata import version as get_version def check_benchmark_params(name, benchmark): diff --git a/asv/commands/rm.py b/asv/commands/rm.py index a2aca672d..6eb6cff0a 100644 --- a/asv/commands/rm.py +++ b/asv/commands/rm.py @@ -5,6 +5,7 @@ from asv_runner.console import get_answer_default from asv import util + from . import Command from ..console import log from ..results import iter_results diff --git a/asv/plugins/mamba.py b/asv/plugins/mamba.py index 64eee75de..8e0be1b7b 100644 --- a/asv/plugins/mamba.py +++ b/asv/plugins/mamba.py @@ -12,8 +12,8 @@ except ImportError: from yaml import Loader - import libmambapy + from ._mamba_helpers import MambaSolver from .. import environment, util from ..console import log From 9f4aa366499d668f5383cb3298cc78b3e050d6e7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 21:18:35 +0000 Subject: [PATCH 35/43] MAINT: Bump scm version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 83b5bb02d..5a5323fe2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ requires = [ # pin setuptools: # https://github.com/airspeed-velocity/asv/pull/1426#issuecomment-2290658198 "setuptools>=64,<72.2.0", - "setuptools_scm>=6", + "setuptools_scm>=8", ] build-backend = "setuptools.build_meta" From f0c87a6f2b803b84c695288753507fa320c917ca Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 22:51:03 +0000 Subject: [PATCH 36/43] MAINT: Go back to an older scm version For licensing --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5a5323fe2..0b2f9b066 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ requires = [ # pin setuptools: # https://github.com/airspeed-velocity/asv/pull/1426#issuecomment-2290658198 "setuptools>=64,<72.2.0", - "setuptools_scm>=8", + "setuptools_scm>=6", # Can't update to 8, it needs 3.8 ] build-backend = "setuptools.build_meta" @@ -121,7 +121,7 @@ line_length = 99 only_sections = true [tool.setuptools_scm] -version_file = "asv/_version.py" +write_to = "asv/_version.py" [tool.cibuildwheel.linux] manylinux-x86_64-image = "manylinux2014" From b637ea259e3406ee7698d338a063b2ba28e0fa80 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 22:55:02 +0000 Subject: [PATCH 37/43] MAINT: Use a backfill for importlib.metadata --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0b2f9b066..f42ebb947 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ dependencies = [ "tabulate", "virtualenv", "packaging", + "importlib-metadata", "tomli; python_version < '3.11'", "colorama; platform_system == 'Windows'", "pyyaml; platform_python_implementation != \"PyPy\"", From c7b149b02884b2939bffc73dd796d8304db551da Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 22:59:46 +0000 Subject: [PATCH 38/43] MAINT: Add the dep needed for sphinx --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f42ebb947..89ca606c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ doc = [ "sphinx-autoapi", "sphinx-collapse", "sphinxcontrib.bibtex", + "setuptools", # dependency from bibtex "sphinxcontrib.katex", "furo", ] From 03615808514370f0840f5c45b389e6ddbf39a33d Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 23:02:24 +0000 Subject: [PATCH 39/43] MAINT: Rework with importlib_metadata --- asv/__init__.py | 2 +- asv/commands/common_args.py | 2 +- asv/commands/publish.py | 2 +- docs/source/conf.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asv/__init__.py b/asv/__init__.py index dc05b7f15..9950fe1ac 100644 --- a/asv/__init__.py +++ b/asv/__init__.py @@ -1,6 +1,6 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst -from importlib.metadata import version as get_version +from importlib_metadata import version as get_version from asv import plugin_manager # noqa F401 Needed to load the plugins diff --git a/asv/commands/common_args.py b/asv/commands/common_args.py index d631cdd7a..56d5d768c 100644 --- a/asv/commands/common_args.py +++ b/asv/commands/common_args.py @@ -4,7 +4,7 @@ import math import multiprocessing import argparse -from importlib.metadata import version as get_version +from importlib_metadata import version as get_version from asv import util diff --git a/asv/commands/publish.py b/asv/commands/publish.py index 779dc0e15..029f0150f 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -4,7 +4,7 @@ import multiprocessing import datetime from collections import defaultdict -from importlib.metadata import version as get_version +from importlib_metadata import version as get_version from asv.commands import Command from asv.benchmarks import Benchmarks diff --git a/docs/source/conf.py b/docs/source/conf.py index abcfa8648..814bc851e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,4 @@ -from importlib.metadata import version as get_version +from importlib_metadata import version as get_version # -- General configuration ------------------------------------------------ From 4b2e8d0703351e5897a9dcee53b8a3b9ce730abd Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 23:31:30 +0000 Subject: [PATCH 40/43] MAINT: Please the linter --- asv/commands/common_args.py | 1 + asv/commands/publish.py | 1 + 2 files changed, 2 insertions(+) diff --git a/asv/commands/common_args.py b/asv/commands/common_args.py index 56d5d768c..13f614cd0 100644 --- a/asv/commands/common_args.py +++ b/asv/commands/common_args.py @@ -4,6 +4,7 @@ import math import multiprocessing import argparse + from importlib_metadata import version as get_version from asv import util diff --git a/asv/commands/publish.py b/asv/commands/publish.py index 029f0150f..91960af26 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -4,6 +4,7 @@ import multiprocessing import datetime from collections import defaultdict + from importlib_metadata import version as get_version from asv.commands import Command From 1aa9ee0f411f9f29a6a9fe768582b5d5c48fd909 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 23:46:51 +0000 Subject: [PATCH 41/43] DOC: Minor cleanup --- docs/source/asv.conf.json.rst | 2 -- docs/source/env_vars.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/source/asv.conf.json.rst b/docs/source/asv.conf.json.rst index f996720b6..f9b6bdb83 100644 --- a/docs/source/asv.conf.json.rst +++ b/docs/source/asv.conf.json.rst @@ -22,8 +22,6 @@ this file and their expected values. .. only:: not man - .. contents:: - ``project`` ----------- The name of the project being benchmarked. diff --git a/docs/source/env_vars.rst b/docs/source/env_vars.rst index 5b9956834..1c9adda97 100644 --- a/docs/source/env_vars.rst +++ b/docs/source/env_vars.rst @@ -27,7 +27,7 @@ behavior are also set: .. note:: - .. versionadded::0.6.0 + .. versionadded:: 0.6.0 ``ASV_RUNNER_PATH`` may be set to provide a local installation of ``asv_runner``, mostly used for the CI to ensure changes to ``asv_runner`` From 047febce127867ee61904752b289b3f25f3e6528 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 8 Sep 2024 23:49:17 +0000 Subject: [PATCH 42/43] MAINT: Fix versionadded calls --- docs/source/asv.conf.json.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/asv.conf.json.rst b/docs/source/asv.conf.json.rst index f9b6bdb83..3672ebb16 100644 --- a/docs/source/asv.conf.json.rst +++ b/docs/source/asv.conf.json.rst @@ -287,12 +287,12 @@ the project being benchmarked may specify in its ``setup.py`` file. preface the package name with ``pip+``. For example, ``emcee`` is only available from ``pip``, so the package name to be used is ``pip+emcee``. - .. versionadded::0.6.0 + .. versionadded:: 0.6.0 ``pip`` dependencies can now accept local (fully qualified) directories, and also take flags (e.g. ``-e``) - .. versionadded::0.6.1 + .. versionadded:: 0.6.1 ``asv`` can now optionally load dependencies from ``environment.yml`` if ``conda`` or ``mamba`` is set as the ``environment_type``. As ``asv`` @@ -300,7 +300,7 @@ the project being benchmarked may specify in its ``setup.py`` file. These specifications in ``environment.yml`` or another (user-defined) file will be overridden by the environment matrix. - .. versionadded::0.6.2 + .. versionadded:: 0.6.2 The ``mamba`` plugin will now take channels and channel priority from the ``MAMBARC`` environment variable if it is provided. e.g. From e88a2acf89e177f2a36faaffe38a88e85f9f8f84 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Mon, 9 Sep 2024 02:21:43 +0000 Subject: [PATCH 43/43] MAINT: Rename and move to clarify statistics --- asv/{statistics.py => _stats.py} | 0 asv/commands/compare.py | 4 ++-- asv/commands/publish.py | 4 ++-- test/test_statistics.py | 24 ++++++++++++------------ 4 files changed, 16 insertions(+), 16 deletions(-) rename asv/{statistics.py => _stats.py} (100%) diff --git a/asv/statistics.py b/asv/_stats.py similarity index 100% rename from asv/statistics.py rename to asv/_stats.py diff --git a/asv/commands/compare.py b/asv/commands/compare.py index 4e53d61d3..14b3cd072 100644 --- a/asv/commands/compare.py +++ b/asv/commands/compare.py @@ -15,7 +15,7 @@ from ..util import human_value, load_json from ..console import log from ..environment import get_environments -from .. import util, statistics +from .. import util, _stats def mean(values): @@ -76,7 +76,7 @@ def _is_result_better(a, b, a_ss, b_ss, factor, use_stats=True): # Special-case the situation with only one sample, in which # case we do the comparison only based on `factor` as there's # not enough data to do statistics. - if not statistics.is_different(a_ss[1], b_ss[1], + if not _stats.is_different(a_ss[1], b_ss[1], a_ss[0], b_ss[0]): return False diff --git a/asv/commands/publish.py b/asv/commands/publish.py index 91960af26..976bfc744 100644 --- a/asv/commands/publish.py +++ b/asv/commands/publish.py @@ -15,7 +15,7 @@ from asv.repo import get_repo from asv.results import iter_results from asv.publishing import OutputPublisher -from asv import statistics, util +from asv import _stats, util def check_benchmark_params(name, benchmark): @@ -191,7 +191,7 @@ def copy_ignore(src, names): b_params = b['params'] result = results.get_result_value(key, b_params) - weight = [statistics.get_weight(s) + weight = [_stats.get_weight(s) for s in results.get_result_stats(key, b_params)] if not b_params: result = result[0] diff --git a/test/test_statistics.py b/test/test_statistics.py index dbe4b5896..e8f810239 100644 --- a/test/test_statistics.py +++ b/test/test_statistics.py @@ -9,7 +9,7 @@ from asv_runner.statistics import (compute_stats, LaplacePosterior, quantile, quantile_ci, binom_pmf, get_err) -from asv import statistics +from asv import _stats def test_compute_stats(): @@ -51,8 +51,8 @@ def test_is_different(): samples_b = true_mean + 0.1 * np.random.rand(n) _, stats_a = compute_stats(samples_a, 1) _, stats_b = compute_stats(samples_b, 1) - assert statistics.is_different(None, None, stats_a, stats_b) == significant - assert statistics.is_different(samples_a, samples_b, stats_a, stats_b) == significant + assert _stats.is_different(None, None, stats_a, stats_b) == significant + assert _stats.is_different(samples_a, samples_b, stats_a, stats_b) == significant def _check_ci(estimator, sampler, nsamples=300): @@ -315,7 +315,7 @@ def check_table(m, tbl): if p is None: continue - p2 = statistics.mann_whitney_u_cdf(m, n, u, memo=memo) + p2 = _stats.mann_whitney_u_cdf(m, n, u, memo=memo) assert p2 == pytest.approx(p, abs=1e-3, rel=0), (m, n, u, p2, p) # Tables from Mann & Whitney, Ann. Math. Statist. 18, 50 (1947). @@ -363,15 +363,15 @@ def test_mann_whitney_u_scipy(): def check(x, y): u0, p0 = stats.mannwhitneyu(x, y, alternative='two-sided', use_continuity=False) - u, p = statistics.mann_whitney_u(x.tolist(), y.tolist(), method='normal') + u, p = _stats.mann_whitney_u(x.tolist(), y.tolist(), method='normal') assert u == u0 assert p == pytest.approx(p0, rel=1e-9, abs=0) - u, p = statistics.mann_whitney_u(x.tolist(), y.tolist(), method='exact') + u, p = _stats.mann_whitney_u(x.tolist(), y.tolist(), method='exact') assert u == u0 assert p == pytest.approx(p0, rel=5e-2, abs=5e-3) - u, p = statistics.mann_whitney_u(x.tolist(), y.tolist()) + u, p = _stats.mann_whitney_u(x.tolist(), y.tolist()) assert u == u0 assert p == pytest.approx(p0, rel=5e-2, abs=5e-3) @@ -388,19 +388,19 @@ def test_mann_whitney_u_basic(): # wilcox.test(a, b, exact=TRUE) a = [1, 2, 3, 4] b = [0.9, 1.1, 0.7] - u, p = statistics.mann_whitney_u(a, b, method='exact') + u, p = _stats.mann_whitney_u(a, b, method='exact') assert u == 11 assert p == pytest.approx(0.11428571428571428, abs=0, rel=1e-10) a = [1, 2] b = [1.5] - u, p = statistics.mann_whitney_u(a, b, method='exact') + u, p = _stats.mann_whitney_u(a, b, method='exact') assert u == 1 assert p == 1.0 a = [1, 2] b = [2.5] - u, p = statistics.mann_whitney_u(a, b, method='exact') + u, p = _stats.mann_whitney_u(a, b, method='exact') assert u == 0 assert p == pytest.approx(2 / 3, abs=0, rel=1e-10) @@ -419,7 +419,7 @@ def test_mann_whitney_u_R(): for m in range(1, len(a) + 1): for n in range(1, len(b) + 1): - u, p = statistics.mann_whitney_u(a[:m], b[:n]) + u, p = _stats.mann_whitney_u(a[:m], b[:n]) r = wilcox_test(robjects.FloatVector(a[:m]), robjects.FloatVector(b[:n])) @@ -442,7 +442,7 @@ def test_mann_whitney_u_R(): def test_binom(): for n in range(10): for k in range(10): - p = statistics.binom(n, k) + p = _stats.binom(n, k) if 0 <= k <= n: p2 = math.factorial(n) / math.factorial(k) / math.factorial(n - k) else: