From 916e9798961a400fe05eee292a20d618bc915ad6 Mon Sep 17 00:00:00 2001 From: Kai Wagoner-Oshima Date: Fri, 13 Jun 2025 16:47:40 -0400 Subject: [PATCH 1/2] chore: move over doc and src files --- doc/source/api/diffpy.srmise.rst | 6 +++-- doc/source/conf.py | 45 +++++++++++++++++++++++++++----- doc/source/index.rst | 29 +++++++++++++------- doc/source/license.rst | 2 +- src/diffpy/__init__.py | 11 +------- src/diffpy/srmise/__init__.py | 7 +++-- src/diffpy/srmise/version.py | 5 ++-- 7 files changed, 69 insertions(+), 36 deletions(-) diff --git a/doc/source/api/diffpy.srmise.rst b/doc/source/api/diffpy.srmise.rst index 98ea790..aa7f200 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: diff --git a/doc/source/conf.py b/doc/source/conf.py index 65d3685..11ae0ea 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.srmise documentation build configuration file, created by +# diffpy.srmise documentation build configuration file, created by # noqa: E501 # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its @@ -18,15 +18,21 @@ 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." # noqa: E501 + # 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. +# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501 # sys.path.insert(0, str(Path(".").resolve())) sys.path.insert(0, str(Path("../..").resolve())) sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Billinge Group members and community contributors" +ab_authors = "Luke Granlund, 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..24d13dc 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 Luke Granlund, 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 377a0f9..eff8147 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,12 +12,3 @@ # See LICENSE.rst for license information. # ############################################################################## - -"""Blank namespace package for module diffpy.""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - -# End of file diff --git a/src/diffpy/srmise/__init__.py b/src/diffpy/srmise/__init__.py index 65eb42b..86275c4 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: Luke Granlund, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.srmise/graphs/contributors @@ -12,11 +12,10 @@ # See LICENSE.rst for license information. # ############################################################################## - """Peak extraction and peak fitting tool for atomic pair distribution functions.""" # package version -from diffpy.srmise.version import __version__ +from diffpy.srmise.version import __version__ # silence the pyflakes syntax checker assert __version__ or True diff --git a/src/diffpy/srmise/version.py b/src/diffpy/srmise/version.py index 304027c..1fe6325 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: Luke Granlund, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.srmise/graphs/contributors @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """Definition of __version__.""" # We do not use the other three variables, but can be added back if needed. From 89b55fac052bf7a8be1c88e6b07493f953066a3d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 21:03:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/srmise/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffpy/srmise/__init__.py b/src/diffpy/srmise/__init__.py index 86275c4..82b24c9 100644 --- a/src/diffpy/srmise/__init__.py +++ b/src/diffpy/srmise/__init__.py @@ -15,7 +15,7 @@ """Peak extraction and peak fitting tool for atomic pair distribution functions.""" # package version -from diffpy.srmise.version import __version__ +from diffpy.srmise.version import __version__ # silence the pyflakes syntax checker assert __version__ or True