From 214586ed93673244ab4ca7d8792f184328fffbb5 Mon Sep 17 00:00:00 2001 From: Kai Wagoner-Oshima Date: Tue, 24 Jun 2025 12:57:47 -0400 Subject: [PATCH 1/3] chore: move over rest of doc and src files --- doc/source/api/diffpy.srmise.rst | 8 ++++--- doc/source/conf.py | 41 ++++++++++++++++++++++++++++---- doc/source/index.rst | 29 ++++++++++++++-------- doc/source/license.rst | 2 +- src/diffpy/__init__.py | 5 ++-- src/diffpy/srmise/__init__.py | 10 ++++---- src/diffpy/srmise/version.py | 4 ++-- 7 files changed, 72 insertions(+), 27 deletions(-) diff --git a/doc/source/api/diffpy.srmise.rst b/doc/source/api/diffpy.srmise.rst index 98ea790..08a3202 100644 --- a/doc/source/api/diffpy.srmise.rst +++ b/doc/source/api/diffpy.srmise.rst @@ -1,7 +1,9 @@ :tocdepth: -1 -diffpy.srmise package -===================== +|title| +======= + +.. |title| replace:: diffpy.srmise package .. automodule:: diffpy.srmise :members: @@ -18,7 +20,7 @@ Subpackages diffpy.srmise.modelevaluators diffpy.srmise.applications diffpy.srmise.baselines - + Submodules ---------- diff --git a/doc/source/conf.py b/doc/source/conf.py index 65d3685..956f1a9 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,6 +18,12 @@ from importlib.metadata import version from pathlib import Path +# Attempt to import the version dynamically from GitHub tag. +try: + fullversion = version("diffpy.srmise") +except Exception: + fullversion = "No version found. The correct version will appear in the released version." + # 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 Path().resolve() to make it absolute, like shown here. @@ -26,7 +32,7 @@ sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Billinge Group members and community contributors" +ab_authors = "Simon Billinge, Billinge Group members" # -- General configuration ------------------------------------------------ @@ -43,6 +49,7 @@ "sphinx.ext.viewcode", "sphinx.ext.intersphinx", "sphinx_rtd_theme", + "sphinx_copybutton", "m2r", ] @@ -68,7 +75,6 @@ # |version| and |release|, also used in various other places throughout the # built documents. -fullversion = version(project) # The short X.Y version. version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. @@ -88,6 +94,11 @@ # substitute YEAR in the copyright string copyright = copyright.replace("%Y", year) +# For sphinx_copybutton extension. +# Do not copy "$" for shell commands in code-blocks. +copybutton_prompt_text = r"^\$ " +copybutton_prompt_is_regexp = True + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["build"] @@ -123,6 +134,14 @@ # html_theme = "sphinx_rtd_theme" +html_context = { + "display_github": True, + "github_user": "diffpy", + "github_repo": "diffpy.srmise", + "github_version": "main", + "conf_py_path": "/doc/source/", +} + # 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. @@ -221,7 +240,13 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ("index", "diffpy.srmise.tex", "diffpy.srmise Documentation", ab_authors, "manual"), + ( + "index", + "diffpy.srmise.tex", + "diffpy.srmise Documentation", + ab_authors, + "manual", + ), ] # The name of an image file (relative to this directory) to place at the top of @@ -249,7 +274,15 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "diffpy.srmise", "diffpy.srmise Documentation", ab_authors, 1)] +man_pages = [ + ( + "index", + "diffpy.srmise", + "diffpy.srmise Documentation", + ab_authors, + 1, + ) +] # If true, show URL addresses after external links. # man_show_urls = False diff --git a/doc/source/index.rst b/doc/source/index.rst index 417085e..3de5698 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -4,19 +4,24 @@ .. |title| replace:: diffpy.srmise documentation -diffpy.srmise - Peak extraction and peak fitting tool for atomic pair distribution functions.. +``diffpy.srmise`` - Peak extraction and peak fitting tool for atomic pair distribution functions -| Software version |release|. +| Software version |release| | Last updated |today|. +=============== +Getting started +=============== + +Welcome to the ``diffpy.srmise`` documentation! + +To get started, please visit the :ref:`Getting started ` page. + ======= Authors ======= -diffpy.srmise is developed by Billinge Group -and its community contributors. - -For a detailed list of contributors see +``diffpy.srmise`` is developed by Simon Billinge, Billinge Group members. The maintainer for this project is Simon Billinge. For a detailed list of contributors see https://github.com/diffpy/diffpy.srmise/graphs/contributors. ============ @@ -26,15 +31,19 @@ Installation See the `README `_ file included with the distribution. +================ +Acknowledgements +================ + +``diffpy.srmise`` is built and maintained with `scikit-package `_. + ================= Table of contents ================= .. toctree:: - :maxdepth: 1 - :titlesonly: + :maxdepth: 2 - tutorial/index - extending + getting-started Package API release license diff --git a/doc/source/license.rst b/doc/source/license.rst index 75f0bdd..65646b0 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -11,7 +11,7 @@ BSD 3-Clause License Copyright 2014-2015, Board of Trustees of Michigan State University -Copyright 2016-2024, The Trustees of Columbia University in the City of New York. +Copyright 2016-2025, The Trustees of Columbia University in the City of New York. All rights reserved. diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 1fd9c20..b100c40 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. @@ -12,6 +12,7 @@ # See LICENSE.rst for license information. # ############################################################################## + """Blank namespace package for module diffpy.""" @@ -19,4 +20,4 @@ __path__ = extend_path(__path__, __name__) -# End of file +# End of file \ No newline at end of file diff --git a/src/diffpy/srmise/__init__.py b/src/diffpy/srmise/__init__.py index 52fd6a9..408f4ae 100644 --- a/src/diffpy/srmise/__init__.py +++ b/src/diffpy/srmise/__init__.py @@ -1,10 +1,10 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# File coded by: Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.srmise/graphs/contributors @@ -12,8 +12,8 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Peak extraction and peak fitting tool for atomic pair distribution -functions.""" +"""Peak extraction and peak fitting tool for atomic pair distribution functions""" + # package version from diffpy.srmise.version import __version__ @@ -21,4 +21,4 @@ # silence the pyflakes syntax checker assert __version__ or True -# End of file +# End of file \ No newline at end of file diff --git a/src/diffpy/srmise/version.py b/src/diffpy/srmise/version.py index 129ef83..1b97580 100644 --- a/src/diffpy/srmise/version.py +++ b/src/diffpy/srmise/version.py @@ -1,10 +1,10 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# File coded by: Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.srmise/graphs/contributors From d432f8634a89eb50d1ca14f1ea177f2d802c5e47 Mon Sep 17 00:00:00 2001 From: Kai Wagoner-Oshima Date: Tue, 24 Jun 2025 16:57:40 -0400 Subject: [PATCH 2/3] chore: run pre-commit --- doc/source/api/diffpy.srmise.rst | 2 +- src/diffpy/__init__.py | 3 +-- src/diffpy/srmise/__init__.py | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/api/diffpy.srmise.rst b/doc/source/api/diffpy.srmise.rst index 08a3202..aa7f200 100644 --- a/doc/source/api/diffpy.srmise.rst +++ b/doc/source/api/diffpy.srmise.rst @@ -20,7 +20,7 @@ Subpackages diffpy.srmise.modelevaluators diffpy.srmise.applications diffpy.srmise.baselines - + Submodules ---------- diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index b100c40..0163760 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """Blank namespace package for module diffpy.""" @@ -20,4 +19,4 @@ __path__ = extend_path(__path__, __name__) -# End of file \ No newline at end of file +# End of file diff --git a/src/diffpy/srmise/__init__.py b/src/diffpy/srmise/__init__.py index 408f4ae..a4e8b2b 100644 --- a/src/diffpy/srmise/__init__.py +++ b/src/diffpy/srmise/__init__.py @@ -12,7 +12,8 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Peak extraction and peak fitting tool for atomic pair distribution functions""" +"""Peak extraction and peak fitting tool for atomic pair distribution +functions.""" # package version @@ -21,4 +22,4 @@ # silence the pyflakes syntax checker assert __version__ or True -# End of file \ No newline at end of file +# End of file From 5ad2098dfe8b5f75903aacecd04ed4b191c62276 Mon Sep 17 00:00:00 2001 From: Kai Wagoner-Oshima Date: Wed, 25 Jun 2025 20:47:15 -0400 Subject: [PATCH 3/3] chore: fix index.rst back to original --- doc/source/index.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 3de5698..2e91dbe 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -41,9 +41,11 @@ Acknowledgements Table of contents ================= .. toctree:: - :maxdepth: 2 + :maxdepth: 1 + :titlesonly: - getting-started + tutorial/index + extending Package API release license