diff --git a/.gitignore b/.gitignore index 06fee4819..6bff14a84 100644 --- a/.gitignore +++ b/.gitignore @@ -40,10 +40,18 @@ _dependencies #Documentation -!mkdocs.yml -!docs/* -!docs/*/* -!docs/*/*/* +!.readthedocs.yaml +!docs/ +!docs/**/* +docs/**/*.ai +docs/_build/ +docs/_build/**/* +docs/generated/ +docs/generated/**/* +docs/**/*.DS_Store +docs/**/*.swp + + !README_figs/* #Docker and Singularity files diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 000000000..9c1872b1a --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,26 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation with Sphinx +sphinx: + configuration: docs/conf.py + fail_on_warning: false # Optional: Set to true if you want the build to fail on warnings. + +# Optionally set the OS, Python version and other tools +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +python: + install: + - requirements: docs/requirements.txt diff --git a/CMakeFiles/3.27.0/CMakeCCompiler.cmake b/CMakeFiles/3.27.0/CMakeCCompiler.cmake deleted file mode 100644 index a1b553d9c..000000000 --- a/CMakeFiles/3.27.0/CMakeCCompiler.cmake +++ /dev/null @@ -1,74 +0,0 @@ -set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "AppleClang") -set(CMAKE_C_COMPILER_VERSION "15.0.0.15000040") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") -set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") -set(CMAKE_C17_COMPILE_FEATURES "c_std_17") -set(CMAKE_C23_COMPILE_FEATURES "c_std_23") - -set(CMAKE_C_PLATFORM_ID "Darwin") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_C_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_MT "") -set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) -set(CMAKE_C_LINKER_DEPFILE_SUPPORTED FALSE) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/include;/opt/homebrew/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/local/lib;/opt/homebrew/lib") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/CMakeFiles/3.27.0/CMakeFortranCompiler.cmake b/CMakeFiles/3.27.0/CMakeFortranCompiler.cmake deleted file mode 100644 index 12e12ebd9..000000000 --- a/CMakeFiles/3.27.0/CMakeFortranCompiler.cmake +++ /dev/null @@ -1,64 +0,0 @@ -set(CMAKE_Fortran_COMPILER "/opt/homebrew/bin/gfortran-12") -set(CMAKE_Fortran_COMPILER_ARG1 "") -set(CMAKE_Fortran_COMPILER_ID "GNU") -set(CMAKE_Fortran_COMPILER_VERSION "12.3.0") -set(CMAKE_Fortran_COMPILER_WRAPPER "") -set(CMAKE_Fortran_PLATFORM_ID "") -set(CMAKE_Fortran_SIMULATE_ID "") -set(CMAKE_Fortran_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_Fortran_SIMULATE_VERSION "") - - -set(CMAKE_Fortran_COMPILER_SYSROOT "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr") -set(CMAKE_COMPILER_SYSROOT "/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr") - -set(CMAKE_AR "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar") -set(CMAKE_Fortran_COMPILER_AR "/opt/homebrew/bin/gcc-ar-12") -set(CMAKE_RANLIB "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib") -set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") -set(CMAKE_Fortran_COMPILER_RANLIB "/opt/homebrew/bin/gcc-ranlib-12") -set(CMAKE_COMPILER_IS_GNUG77 1) -set(CMAKE_Fortran_COMPILER_LOADED 1) -set(CMAKE_Fortran_COMPILER_WORKS TRUE) -set(CMAKE_Fortran_ABI_COMPILED TRUE) - -set(CMAKE_Fortran_COMPILER_ENV_VAR "FC") - -set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) - -set(CMAKE_Fortran_COMPILER_ID_RUN 1) -set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95;f03;F03;f08;F08) -set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_Fortran_LINKER_PREFERENCE 20) -set(CMAKE_Fortran_LINKER_DEPFILE_SUPPORTED FALSE) -if(UNIX) - set(CMAKE_Fortran_OUTPUT_EXTENSION .o) -else() - set(CMAKE_Fortran_OUTPUT_EXTENSION .obj) -endif() - -# Save compiler ABI information. -set(CMAKE_Fortran_SIZEOF_DATA_PTR "8") -set(CMAKE_Fortran_COMPILER_ABI "") -set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "") - -if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_Fortran_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") -endif() - -if(CMAKE_Fortran_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - - -set(CMAKE_Fortran_SYSROOT_FLAG "-isysroot") -set(CMAKE_Fortran_OSX_DEPLOYMENT_TARGET_FLAG "-mmacosx-version-min=") - -set(CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES "/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/gcc/aarch64-apple-darwin22/12/finclude;/usr/local/include;/opt/homebrew/include;/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/gcc/aarch64-apple-darwin22/12/include;/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/gcc/aarch64-apple-darwin22/12/include-fixed;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include") -set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "gfortran;emutls_w;gcc;quadmath;emutls_w;gcc;gcc") -set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "/usr/local/lib;/opt/homebrew/lib;/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/gcc/aarch64-apple-darwin22/12;/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12/gcc;/opt/homebrew/Cellar/gcc@12/12.3.0/lib/gcc/12") -set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/CMakeFiles/3.27.0/CMakeSystem.cmake b/CMakeFiles/3.27.0/CMakeSystem.cmake deleted file mode 100644 index ac5601a0f..000000000 --- a/CMakeFiles/3.27.0/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Darwin-22.6.0") -set(CMAKE_HOST_SYSTEM_NAME "Darwin") -set(CMAKE_HOST_SYSTEM_VERSION "22.6.0") -set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") - - - -set(CMAKE_SYSTEM "Darwin-22.6.0") -set(CMAKE_SYSTEM_NAME "Darwin") -set(CMAKE_SYSTEM_VERSION "22.6.0") -set(CMAKE_SYSTEM_PROCESSOR "arm64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/distclean.cmake b/distclean.cmake index 19d766f08..d46cbfae5 100644 --- a/distclean.cmake +++ b/distclean.cmake @@ -44,7 +44,6 @@ ENDMACRO() FILE(GLOB_RECURSE CMAKECACHE "${TOPDIR}/*CMakeCache.txt") FILE(GLOB_RECURSE CMAKEINSTALL "${TOPDIR}/*cmake_install.cmake" "${TOPDIR}/*install_manifest.txt") -FILE(GLOB_RECURSE MAKEFILE "${TOPDIR}/*Makefile") FILE(GLOB_RECURSE CMAKETESTFILES "${TOPDIR}/*CTestTestfile.cmake") SET(TOPDIRECTORIES "${TOPDIR}/lib" "${TOPDIR}/libexec" diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..d4bb2cbb9 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/index_api_reference.svg b/docs/_static/index_api_reference.svg new file mode 100644 index 000000000..a2161fb94 --- /dev/null +++ b/docs/_static/index_api_reference.svg @@ -0,0 +1,226 @@ + + \ No newline at end of file diff --git a/docs/_static/index_contribute.svg b/docs/_static/index_contribute.svg new file mode 100644 index 000000000..11821af31 --- /dev/null +++ b/docs/_static/index_contribute.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/_static/index_getting_started.svg b/docs/_static/index_getting_started.svg new file mode 100644 index 000000000..38c7088e2 --- /dev/null +++ b/docs/_static/index_getting_started.svg @@ -0,0 +1,571 @@ + + \ No newline at end of file diff --git a/docs/_static/index_user_guide.svg b/docs/_static/index_user_guide.svg new file mode 100644 index 000000000..ea05581b4 --- /dev/null +++ b/docs/_static/index_user_guide.svg @@ -0,0 +1,606 @@ + + \ No newline at end of file diff --git a/docs/_static/logos/swiftest_logo.png b/docs/_static/logos/swiftest_logo.png new file mode 100644 index 000000000..a776fab3f Binary files /dev/null and b/docs/_static/logos/swiftest_logo.png differ diff --git a/docs/_static/logos/swiftest_logo.svg b/docs/_static/logos/swiftest_logo.svg new file mode 100644 index 000000000..e0b951e0d --- /dev/null +++ b/docs/_static/logos/swiftest_logo.svg @@ -0,0 +1,512 @@ + + \ No newline at end of file diff --git a/docs/_static/logos/swiftest_social_preview.png b/docs/_static/logos/swiftest_social_preview.png new file mode 100644 index 000000000..ebc0da54a Binary files /dev/null and b/docs/_static/logos/swiftest_social_preview.png differ diff --git a/docs/_static/logos/swiftest_social_preview.svg b/docs/_static/logos/swiftest_social_preview.svg new file mode 100644 index 000000000..bed3f6373 --- /dev/null +++ b/docs/_static/logos/swiftest_social_preview.svg @@ -0,0 +1,572 @@ + + \ No newline at end of file diff --git a/docs/_static/style.css b/docs/_static/style.css new file mode 100644 index 000000000..45e945092 --- /dev/null +++ b/docs/_static/style.css @@ -0,0 +1,316 @@ +table.colwidths-given { + table-layout: fixed; + width: 100%; +} +table.docutils td { + white-space: unset; + word-wrap: break-word; +} + +div.bd-header-announcement { + background-color: unset; + color: #000; +} + +/* Reduce left and right margins */ + +.container, .container-lg, .container-md, .container-sm, .container-xl { + max-width: 1350px !important; +} + +/* The following was found at https://stackoverflow.com/a/77588233 */ + +/* -- .bd-container and .bd-container__inner both need to adjust ---------- */ +/* -- this so 'outer container' grows with browser (no L/R 'dead space') -- */ +.bd-container { + max-width: 99%; +} + +/* -- this so the 'inner container' fills the outer container -------------- */ +.bd-container .bd-container__inner { + max-width: 99%; +} + +/* -- .bd-article-container holds the "text in the middle" (notebook / md) ------ */ +/* -- width is as high as as 100 "ems" (characters) wide, scales with font size -*/ +.bd-main .bd-content .bd-article-container { + max-width: 100em; +} + + +/* Copied from +https://github.com/bokeh/bokeh/blob/branch-2.4/sphinx/source/bokeh/static/custom.css +*/ + +:root { + /* Logo image height + all the paddings/margins make the navbar height. */ + --navbar-height: calc(30px + 0.3125rem * 2 + 0.5rem * 2); +} + +.bd-search { + position: relative; + padding-bottom: 20px; +} + +@media (min-width: 768px) { + .search-front-page { + width: 50%; + } +} + +/* minimal copy paste from bootstrap docs css to get sidebars working */ + +.bd-toc { + -ms-flex-order: 2; + order: 2; + padding-top: 1.5rem; + padding-bottom: 1.5rem; + /* font-size: 0.875rem; */ + /* add scrolling sidebar */ + height: calc(100vh - 2rem); + overflow-y: auto; +} + +@supports ((position: -webkit-sticky) or (position: sticky)) { + .bd-toc { + position: -webkit-sticky; + position: sticky; + top: 4rem; + height: calc(100vh - 4rem); + overflow-y: auto; + } +} + +.section-nav { + padding-left: 0; + border-left: 1px solid #eee; + border-bottom: none; +} + +.section-nav ul { + padding-left: 1rem; +} + +.toc-entry { + display: block; +} + +.toc-entry a { + display: block; + padding: 0.125rem 1.5rem; + color: #77757a; +} + +.toc-entry a:hover { + color: rgba(0, 0, 0, 0.85); + text-decoration: none; +} + +.bd-sidebar { + -ms-flex-order: 0; + order: 0; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} + +@media (min-width: 768px) { + .bd-sidebar { + border-right: 1px solid rgba(0, 0, 0, 0.1); + } + @supports ((position: -webkit-sticky) or (position: sticky)) { + .bd-sidebar { + position: -webkit-sticky; + position: sticky; + top: var(--navbar-height); + z-index: 1000; + height: calc(100vh - var(--navbar-height)); + } + } +} + +@media (min-width: 1200px) { + .bd-sidebar { + -ms-flex: 0 1 480px; + flex: 0 1 480px; + } +} + +.bd-links { + padding-top: 1rem; + padding-bottom: 1rem; + margin-right: -15px; + margin-left: -15px; +} + +@media (min-width: 768px) { + @supports ((position: -webkit-sticky) or (position: sticky)) { + .bd-links { + max-height: calc(100vh - 9rem); + overflow-y: auto; + } + } +} + +@media (min-width: 768px) { + .bd-links { + display: block !important; + } +} + +.bd-sidenav { + display: none; +} + +.bd-toc-link { + display: block; + padding: 0.25rem 1.5rem; + font-weight: 400; + color: rgba(0, 0, 0, 0.65); +} + +.bd-toc-link:hover { + color: rgba(0, 0, 0, 0.85); + text-decoration: none; +} + +.bd-toc-item.active { + margin-bottom: 1rem; +} + +.bd-toc-item.active:not(:first-child) { + margin-top: 1rem; +} + +.bd-toc-item.active > .bd-toc-link { + color: rgba(0, 0, 0, 0.85); +} + +.bd-toc-item.active > .bd-toc-link:hover { + background-color: transparent; +} + +.bd-toc-item.active > .bd-sidenav { + display: block; +} + +.bd-sidebar .nav > li > a { + display: block; + padding: 0.25rem 1.5rem; + font-size: 90%; +} + +.bd-sidebar .nav > li > a:hover { + text-decoration: none; + background-color: transparent; +} + +.bd-sidebar .nav > .active > a, +.bd-sidebar .nav > .active:hover > a { + font-weight: 400; + /* adjusted from original + color: rgba(0, 0, 0, 0.85); + background-color: transparent; */ +} + +.bd-sidebar .nav > li > ul { + list-style: none; + padding: 0.25rem 1.5rem; +} + +.bd-sidebar .nav > li > ul > li > a { + display: block; + padding: 0.25rem 1.5rem; + font-size: 90%; +} + +.bd-sidebar .nav > li > ul > .active > a, +.bd-sidebar .nav > li > ul > .active:hover > a { + font-weight: 400; +} + +dt:target { + background-color: initial; +} + +/* Offsetting anchored elements within the main content to adjust for fixed header + https://github.com/pandas-dev/pandas-sphinx-theme/issues/6 */ +main *:target::before { + display: block; + content: ''; + height: var(--navbar-height); + margin-top: calc(-1 * var(--navbar-height)); +} + +body { + /* Add padding to body to avoid overlap with navbar. */ + padding-top: var(--navbar-height); + width: 100%; +} + +/* adjust toc font sizes to improve overview */ +.toc-h2 { + font-size: 0.85rem; +} + +.toc-h3 { + font-size: 0.75rem; +} + +.toc-h4 { + font-size: 0.65rem; +} + +.toc-entry > .nav-link.active { + font-weight: 400; + color: #314254; + background-color: transparent; + border-left: 2px solid #A3B9C0; +} + +.nav-link:hover { + border-style: none; +} + +/* Collapsing of the TOC sidebar while scrolling */ + +/* Nav: hide second level (shown on .active) */ +.bd-toc .nav .nav { + display: none; +} + +.bd-toc .nav > .active > ul { + display: block; +} + +/* Main index page overview cards */ + +.sd-card-img-top { + width: 33% !important; + display: block; + margin-left: auto; + margin-right: auto; + margin-top: 10px; +} + +/* Hide ToC on mobile */ +@media (max-width: 1200px) { + .bd-sidebar-secondary { + display: none; + } + + .bd-sidebar-secondary.active .bd-toc.active { + display: block; + } + + + .article-header-buttons .sidebar-toggle { + display: block; + } + + label.sidebar-toggle.primary-toggle { + display: none; + } + label.sidebar-toggle.secondary-toggle { + display: inline-block; /* or 'block', depending on desired layout */ + } + +} \ No newline at end of file diff --git a/docs/_templates/autosummary/accessor.rst b/docs/_templates/autosummary/accessor.rst new file mode 100644 index 000000000..4ba745cd6 --- /dev/null +++ b/docs/_templates/autosummary/accessor.rst @@ -0,0 +1,6 @@ +{{ fullname }} +{{ underline }} + +.. currentmodule:: {{ module.split('.')[0] }} + +.. autoaccessor:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/docs/_templates/autosummary/accessor_attribute.rst b/docs/_templates/autosummary/accessor_attribute.rst new file mode 100644 index 000000000..b5ad65d6a --- /dev/null +++ b/docs/_templates/autosummary/accessor_attribute.rst @@ -0,0 +1,6 @@ +{{ fullname }} +{{ underline }} + +.. currentmodule:: {{ module.split('.')[0] }} + +.. autoaccessorattribute:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/docs/_templates/autosummary/accessor_callable.rst b/docs/_templates/autosummary/accessor_callable.rst new file mode 100644 index 000000000..7a3301814 --- /dev/null +++ b/docs/_templates/autosummary/accessor_callable.rst @@ -0,0 +1,6 @@ +{{ fullname }} +{{ underline }} + +.. currentmodule:: {{ module.split('.')[0] }} + +.. autoaccessorcallable:: {{ (module.split('.')[1:] + [objname]) | join('.') }}.__call__ diff --git a/docs/_templates/autosummary/accessor_method.rst b/docs/_templates/autosummary/accessor_method.rst new file mode 100644 index 000000000..aefbba6ef --- /dev/null +++ b/docs/_templates/autosummary/accessor_method.rst @@ -0,0 +1,6 @@ +{{ fullname }} +{{ underline }} + +.. currentmodule:: {{ module.split('.')[0] }} + +.. autoaccessormethod:: {{ (module.split('.')[1:] + [objname]) | join('.') }} diff --git a/docs/api.rst b/docs/api.rst new file mode 100644 index 000000000..33b241cbe --- /dev/null +++ b/docs/api.rst @@ -0,0 +1,31 @@ +.. currentmodule:: swiftest + +.. _api: + +######################### +Swiftest API reference +######################### + +This section of the documentation provides a detailed reference for the Production classes in the Swiftest project. + +Simulation +========== + +The Simulation class is the main class for the Swiftest project. + +Creating a Simulation +--------------------- + +.. autosummary:: + :toctree: generated/ + + Simulation + +Running a Simulation +------- + +.. autosummary:: + :toctree: generated/ + + Simulation.run + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 000000000..466628445 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,182 @@ +import datetime +import os +import sys +import inspect +from contextlib import suppress + +import sphinx_autosummary_accessors +from sphinx.application import Sphinx +from sphinx.util import logging +import os + +import swiftest + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +project = 'Swiftest' +copyright = f'{datetime.datetime.now().year}, David A. Minton' +author = 'David A. Minton' +with open(os.path.join(os.path.dirname(__file__), os.pardir, "version.txt"), 'r') as file: + version = file.read().strip() +release = version + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.mathjax", + "sphinx.ext.napoleon", + "sphinx.ext.viewcode", + "IPython.sphinxext.ipython_directive", + "IPython.sphinxext.ipython_console_highlighting", + "nbsphinx", + "sphinx_autosummary_accessors", + "sphinx.ext.linkcode", + "sphinxext.opengraph", + "sphinx_copybutton", + "sphinx_design", + "sphinx_inline_tabs", + "sphinxfortran.fortran_domain", + "sphinxfortran.fortran_autodoc" +] + + +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store','**.ipynb_checkpoints'] + + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + + +# Use Autodoc and Napolean for extracting docstrings +autosummary_generate = True +autodoc_typehints = "none" +napoleon_google_docstring = False +napoleon_numpy_docstring = True +napoleon_use_param = False +napoleon_use_rtype = False + +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "numpy": ("https://numpy.org/doc/stable", None), + "xarray" : ("https://docs.xarray.dev/en/stable/", None), +} + +templates_path = ["_templates"] + +html_theme = 'sphinx_book_theme' +html_title ="" +html_static_path = ["_static"] + +html_context = { + "github_user": "profminton", + "github_repo": "swiftest", + "github_version": "main", + "doc_path": "docs", +} + +# 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 = dict( + # analytics_id='' this is configured in rtfd.io + # canonical_url="", + repository_url="https://github.com/profminton/swiftest", + repository_branch="main", + navigation_with_keys=False, # pydata/pydata-sphinx-theme#1492 + path_to_docs="docs", + use_edit_page_button=True, + use_repository_button=True, + use_issues_button=True, + home_page_in_toc=False, + extra_footer="""Theme by the Executable Book Project
""", + icon_links=[], # workaround for pydata/pydata-sphinx-theme#1220 + announcement="🍾 Swiftest is currently under development 🎉", +) + + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +html_logo = "_static/logos/swiftest_social_preview.svg" + +# 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/logos/swiftest_logo.svg" + +# 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_css_files = ["style.css"] + +# configuration for sphinxext.opengraph +ogp_site_url = "https://swiftest.readthedocs.io/en/latest/" +ogp_image = "https://swiftest.readthedocs.io/en/stable/_static/logos/swiftest_social_preview.png" +ogp_custom_meta_tags = [ + '', +] + + +# based on numpy doc/source/conf.py +def linkcode_resolve(domain, info): + """ + Determine the URL corresponding to Python object + """ + if domain != "py": + return None + + modname = info["module"] + fullname = info["fullname"] + + submod = sys.modules.get(modname) + if submod is None: + return None + + obj = submod + for part in fullname.split("."): + try: + obj = getattr(obj, part) + except AttributeError: + return None + + try: + fn = inspect.getsourcefile(inspect.unwrap(obj)) + except TypeError: + fn = None + if not fn: + return None + + try: + source, lineno = inspect.getsourcelines(obj) + except OSError: + lineno = None + + if lineno: + linespec = f"#L{lineno}-L{lineno + len(source) - 1}" + else: + linespec = "" + + fn = os.path.relpath(fn, start=os.path.dirname(swiftest.__file__)) + + + +def html_page_context(app, pagename, templatename, context, doctree): + # Disable edit button for docstring generated pages + if "generated" in pagename: + context["theme_use_edit_page_button"] = False + +fortran_src = [os.path.join(os.pardir, "fortran","*/*.f90")] +fortran_ext = ["f90"] +fortran_encoding = "utf-8" \ No newline at end of file diff --git a/docs/contributing.rst b/docs/contributing.rst new file mode 100644 index 000000000..906222d1f --- /dev/null +++ b/docs/contributing.rst @@ -0,0 +1,14 @@ +.. _contributing: + +*************************** +Contributing to Swiftest +*************************** + +.. note:: + + This document is a work in progress. It is not yet complete. + +Overview +======== + +TBD diff --git a/docs/getting-started-guide/index.rst b/docs/getting-started-guide/index.rst new file mode 100644 index 000000000..d6b7e1ebd --- /dev/null +++ b/docs/getting-started-guide/index.rst @@ -0,0 +1,11 @@ +################ +Getting Started +################ + +TBD + +.. toctree:: + :maxdepth: 2 + :hidden: + + diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 000ea3455..000000000 --- a/docs/index.md +++ /dev/null @@ -1,17 +0,0 @@ -# Welcome to MkDocs - -For full documentation visit [mkdocs.org](https://www.mkdocs.org). - -## Commands - -* `mkdocs new [dir-name]` - Create a new project. -* `mkdocs serve` - Start the live-reloading docs server. -* `mkdocs build` - Build the documentation site. -* `mkdocs -h` - Print help message and exit. - -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..a84d13b53 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,74 @@ +.. module:: swiftest + +Swiftest +==================== +Swiftest is a software packaged designed to model the dynamical evolution of gravitational systems. Swiftest is an upgrade over the `Swifter