diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index a4661f5..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build Documentation - -on: - push: - branches: - - main - release: - -jobs: - test: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: build - auto-update-conda: true - - - name: install requirements - run: >- - conda install -n build -c conda-forge - --file requirements/build.txt - --file requirements/run.txt - --file requirements/docs.txt - --quiet --yes - - - name: install the package - run: python -m pip install . --no-deps - - - name: build documents - run: make -C doc html - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doc/build/html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index f023470..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: CI - -on: - push: - branches: - - main - - CI - pull_request: - workflow_dispatch: - -jobs: - miniconda: - name: Miniconda ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["ubuntu-latest"] - steps: - - name: check out diffpy.srmise - uses: actions/checkout@v3 - with: - repository: diffpy/diffpy.srmise - path: . - fetch-depth: 0 # avoid shallow clone with no tags - - - name: initialize miniconda - # this uses a marketplace action that sets up miniconda in a way that makes - # it easier to use. I tried setting it up without this and it was a pain - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: test - # environment.yml file is needed by this action. Because I don't want - # maintain this but rather maintain the requirements files it just has - # basic things in it like conda and pip - environment-file: ./environment.yml - python-version: 3 - auto-activate-base: false - - - name: install diffpy.srmise requirements - shell: bash -l {0} - run: | - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda activate test - conda install --file requirements/run.txt - conda install --file requirements/test.txt - pip install . --no-deps - - - name: Validate diffpy.srmise - shell: bash -l {0} - run: | - conda activate test - coverage run -m pytest -vv -s - coverage report -m - codecov diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index f2ff7e4..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - workflow_dispatch: - -jobs: - pre-commit: - # pull requests are a duplicate of a branch push if within the same repo. - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 - with: - extra_args: --all-files diff --git a/doc/manual/Makefile b/doc/manual/Makefile deleted file mode 100644 index 0158356..0000000 --- a/doc/manual/Makefile +++ /dev/null @@ -1,179 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# 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 publish - -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 " 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 " 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/SrMise.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/SrMise.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/SrMise" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/SrMise" - @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." - -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." - -# Manual publishing to the gh-pages branch - -GITREPOPATH = $(shell cd $(CURDIR) && git rev-parse --git-dir) -GITREMOTE = origin -GITREMOTEURL = $(shell git config --get remote.$(GITREMOTE).url) -GITLASTCOMMIT = $(shell git rev-parse HEAD) - -publish: - @test -d build/html || \ - ( echo >&2 "Run 'make html' first!"; false ) - git show-ref --verify --quiet refs/heads/gh-pages || \ - git branch --track gh-pages $(GITREMOTE)/gh-pages - test -d build/gh-pages || \ - git clone -s -b gh-pages $(GITREPOPATH) build/gh-pages - cd build/gh-pages && \ - git pull $(GITREMOTEURL) gh-pages - rsync -acv --delete --exclude=.git --exclude=.rsync-exclude \ - --exclude-from=build/gh-pages/.rsync-exclude \ - --link-dest=$(CURDIR)/build/html build/html/ build/gh-pages/ - cd build/gh-pages && \ - git add --all . && \ - git diff --cached --quiet || \ - git commit -m "Synced with the source at $(GITLASTCOMMIT)." - cd build/gh-pages && \ - git push origin gh-pages diff --git a/doc/manual/source/conf.py b/doc/manual/source/conf.py deleted file mode 100644 index d856aef..0000000 --- a/doc/manual/source/conf.py +++ /dev/null @@ -1,281 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# diffpy.srfit documentation build configuration file, created by -# sphinx-quickstart on Fri Dec 6 18:09:01 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. - -import os -import sys -import time - -from setup import versiondata - -# 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('.')) -# sys.path.insert(0, os.path.abspath('../../..')) - -# abbreviations -ab_authors = "Luke Granlund" - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [ - "sphinx.ext.ifconfig", - "sphinx.ext.autodoc", - "sphinx.ext.intersphinx", - "sphinx.ext.extlinks", -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# The suffix of source filenames. -source_suffix = ".rst" - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = "SrMise" -copyright = "%Y, Board of Trustees of Michigan State University" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -sys.path.insert(0, os.path.abspath("../../..")) - -fullversion = versiondata.get("DEFAULT", "version") -# The short X.Y version. -version = ".".join(fullversion.split(".")[:2]) -# The full version, including alpha/beta/rc tags. -release = fullversion - -# 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 = '' -today_seconds = versiondata.getint("DEFAULT", "timestamp") -today = time.strftime("%B %d, %Y", time.localtime(today_seconds)) -year = today.split()[-1] -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' -# substitute YEAR in the copyright string -copyright = copyright.replace("%Y", year) - -# 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 = None - -# 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 = ["diffpy.srmise."] - -# Display all warnings for missing links. -nitpicky = True - -# Define :source-release:`zip` and :source-release:`tar.gz` to point to the -# GitHub source archive corresponding to the most recent release. -lasttag = release.split("-")[0] # Drop post-release git version increment. -extlinks = { - "source-release": ( - "https://github.com/diffpy/diffpy.srmise/archive/v%s" % lasttag + ".%s", - "", - ) -} - -# -- 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 = 'classic' -html_theme = "nature" - -# 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 = {'collapsiblesidebar' : 'true'} #classic -html_theme_options = {} # nature - -# Add any paths that contain custom themes here, relative to this directory. -# 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 - -# 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 = None - -# 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'] - -# 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 = True - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# 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 = "SrMisedoc" - - -# -- 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]). -latex_documents = [ - ("index", "SrMise_manual.tex", "SrMise Documentation", ab_authors, "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 = [("index", "srmise", "SrMise Documentation", ab_authors, 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", - "SrMise", - "SrMise Documentation", - ab_authors, - "SrMise", - "One line description of project.", - "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' - - -# Example configuration for intersphinx: refer to the Python standard library. -# intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/manual/source/extending.rst b/doc/manual/source/extending.rst deleted file mode 100644 index 43951b9..0000000 --- a/doc/manual/source/extending.rst +++ /dev/null @@ -1,146 +0,0 @@ -.. _extending-srmise: - -=================== -Extending SrMise -=================== - -The :ref:`tutorial` gives an overview of how to use SrMise with the existing -peak and baseline functions. These inherit from classes providing generic peak -and baseline functionality, and from which additional peaks and baselines can be -implemented. The process for adding new peaks and baselines is summarized -below, but see the source code for additional details. - -If you implement a peak or baseline likely to be of broad interest to the PDF -community, please consider submitting a pull request to the GitHub -`SrMise repository `_. - -Organization of Functions -------------------------- - -The ``BaseFunction`` class in ``diffpy.srmise.basefunction`` implements the -functionality common to all SrMise baseline and peak functions, which are -separately implemented in the ``diffpy.srmise.baselines`` and -``diffpy.srmise.peaks`` subpackages. Specific baseline and peak functions -inherit from the ``BaselineFunction`` and ``PeakFunction`` classes in those -subpackges, as shown below. - -* .. py:class:: BaseFunction - - + .. py:class:: BaselineFunction - - - .. py:class:: FromSequence - - .. py:class:: NanoSpherical - - .. py:class:: Polynomial - - *etc.* - - + .. py:class:: PeakFunction - - - .. py:class:: Gaussian - - .. py:class:: GaussianOverR - - *etc.* - -Adding Baselines -------------------------------------- - -To add a baseline, create a new module which defines a class inheriting from -``diffpy.srmise.baselines.base.BaselineFunction``. The class data and methods -which need to be implemented are summarized in the source code. - - -.. literalinclude:: ../../../diffpy/srmise/baselines/base.py - :pyobject: BaselineFunction - :end-before: __init__ - -The class methods should follow these specifications. See existing baselines -for examples. - -.. py:method:: estimate_parameters(r, y) - - Return a Numpy array of parameters estimated from the data. - - :param r: Grid on which the data are defined. - :param y: The data. - :type r: `Sequence` - :type y: `Sequence` - :returns: Estimated parameters - :rtype: `numpy.ndarray` - :raises: NotImplementedError if estimation has not been implemented. - :raises: SrMiseEstimationError if estimation fails. - - -.. py:method:: _jacobian_raw(pars, r, free) - - Return Jacobian for parameters evaluated over `r`. - - :param pars: The parameters of the baseline. - :param r: Scalar or grid on which to calculate the Jacobian. - :param free: Boolean values indicating if corresponding parameter is free (True) or fixed (False). - :type pars: `Sequence(float)` - :type r: `int`, `float`, or `Sequence(int` or `float)` - :type free: `Sequence(boolean)` - :returns: List of Jacobian values (or None if parameter is not free) for each parameter evaluated at `r`. - :rtype: `list(numpy.ndarray(float) or float or None)` - -.. py:method:: _transform_derivativesraw(pars, in_format, out_format) - - Return the gradient matrix of `pars` represented in format 'out_format'. - - :param pars: The parameters of the baseline. - :param in_format: The format of `pars`. - :param out_format: The desired format of `pars`. - :type pars: `Sequence(float)` - :type in_format: `str` - :type out_format: `str` - :returns: The gradient matrix for the transformation. - :rtype: `numpy.ndarray` - -.. py:method:: _transform_parametersraw(pars, in_format, out_format) - - Return parameters transformed into format 'out_format'. - - :param pars: The parameters of the baseline. - :param in_format: The format of `pars`. - :param out_format: The desired format of `pars`. - :type pars: `Sequence(float)` - :type in_format: `str` - :type out_format: `str` - :returns: The transformed parameters. - :rtype: `numpy.ndarray` - -.. py:method:: _valueraw(pars, r) - - Return value of baseline with given parameters at r. - - :param pars: The parameters of the baseline. - :param r: Scalar or grid on which to calculate the baseline. - :type pars: `Sequence(float)` - :type r: `int`, `float`, or `Sequence(int` or `float)` - :returns: The value of the baseline. - :rtype: `float` or `numpy.ndarray(float)`. - - -Adding Peaks --------------------------- - -To add a new peak function, create a new module which defines a class -inheriting from ``diffpy.srmise.peaks.base.PeakFunction``. Implementing a peak -function is nearly identical to implementing a baseline function, with the -following differences: - -1) The ``estimate_parameters`` method is required. -2) The "position" key must be defined in the ``parameterdict`` class member. -3) Peak functions must implement the additional method ``scale_at``. - -.. py:method:: scale_at(pars, r, scale) - - Return peak parameters such that the value at ``r`` is scaled by ``scale`` - while the position of the peak's maxima remains unchanged. - - :param pars: The parameters of the peak. - :param r: Position where the peak will be rescaled. - :param scale: A scale factor > 0. - :type pars: `Sequence(float)` - :type r: `int` or `float` - :type scale: `float` - :returns: The adjusted peak parameters. - :rtype: `numpy.ndarray(float)`. diff --git a/doc/manual/source/index.rst b/doc/manual/source/index.rst deleted file mode 100644 index 5ca43fe..0000000 --- a/doc/manual/source/index.rst +++ /dev/null @@ -1,93 +0,0 @@ -.. _srmise-documentation-index: - -#################################################### -SrMise Documentation -#################################################### - -Software version |release|. - -Last updated |today|. - -Tool for unbiased peak extraction from atomic pair distribution functions. - -The diffpy.srmise package is an implementation of the `ParSCAPE algorithm -`_ for peak extraction from -atomic pair distribution functions (PDFs). It is designed to function even -when *a priori* knowledge of the physical sample is limited, utilizing the -Akaike Information Criterion (AIC) to estimate whether peaks are -statistically justified relative to alternate models. Three basic use cases -are anticipated for diffpy.srmise. The first is peak fitting a user-supplied -collections of peaks. The second is peak extraction from a PDF with no (or -only partial) user-supplied peaks. The third is an AIC-driven multimodeling -analysis where the output of multiple diffpy.srmise trials are ranked. - -The framework for peak extraction defines peak-like clusters within the data, -extracts a single peak within each cluster, and iteratively combines nearby -clusters while performing a recursive search on the residual to identify -occluded peaks. Eventually this results in a single global cluster -containing many peaks fit over all the data. Over- and underfitting are -discouraged by use of the AIC when adding or removing (during a pruning step) -peaks. Termination effects, which can lead to physically spurious peaks in -the PDF, are incorporated in the mathematical peak model and the pruning step -attempts to remove peaks which are fit better as termination ripples due to -another peak. - -Where possible, diffpy.srmise provides physically reasonable default values -for extraction parameters. However, the PDF baseline should be estimated by -the user before extraction, or by performing provisional peak extraction with -varying baseline parameters. The package defines a linear (crystalline) -baseline, arbitrary polynomial baseline, a spherical nanoparticle baseline, -and an arbitrary baseline interpolated from a list of user-supplied values. -In addition, PDFs with accurate experimentally-determined uncertainties are -necessary to provide the most reliable results, but historically such PDFs -are rare. In the absence of accurate uncertainties an ad hoc uncertainty -must be specified. - - -=================== -Disclaimer -=================== - -.. literalinclude:: ../../../LICENSE.txt - -.. literalinclude:: ../../../LICENSE_PDFgui.txt - -================ -Acknowledgments -================ - -Developers ------------ - -diffpy.srmise is developed and maintained by - -.. literalinclude:: ../../../AUTHORS.txt - -The source code of *pdfdataset.py* was derived from diffpy.pdfgui. - -====================================== -Installation -====================================== - -See the `README.rst `_ -file included with the distribution. - -====================================== -Where next? -====================================== - -.. toctree:: - :maxdepth: 2 - - tutorial/index.rst - extending.rst - -====================================== -API -====================================== - -Detailed API documentation will be available in a future version of -diffpy.srmise. - -* :ref:`genindex` -* :ref:`search` diff --git a/doc/source/extending.rst b/doc/source/extending.rst index 202c6cf..43951b9 100644 --- a/doc/source/extending.rst +++ b/doc/source/extending.rst @@ -27,14 +27,14 @@ subpackges, as shown below. * .. py:class:: BaseFunction + .. py:class:: BaselineFunction - + - .. py:class:: FromSequence - .. py:class:: NanoSpherical - .. py:class:: Polynomial - *etc.* - + + .. py:class:: PeakFunction - + - .. py:class:: Gaussian - .. py:class:: GaussianOverR - *etc.* @@ -57,7 +57,7 @@ for examples. .. py:method:: estimate_parameters(r, y) Return a Numpy array of parameters estimated from the data. - + :param r: Grid on which the data are defined. :param y: The data. :type r: `Sequence` @@ -69,9 +69,9 @@ for examples. .. py:method:: _jacobian_raw(pars, r, free) - + Return Jacobian for parameters evaluated over `r`. - + :param pars: The parameters of the baseline. :param r: Scalar or grid on which to calculate the Jacobian. :param free: Boolean values indicating if corresponding parameter is free (True) or fixed (False). @@ -84,7 +84,7 @@ for examples. .. py:method:: _transform_derivativesraw(pars, in_format, out_format) Return the gradient matrix of `pars` represented in format 'out_format'. - + :param pars: The parameters of the baseline. :param in_format: The format of `pars`. :param out_format: The desired format of `pars`. @@ -97,7 +97,7 @@ for examples. .. py:method:: _transform_parametersraw(pars, in_format, out_format) Return parameters transformed into format 'out_format'. - + :param pars: The parameters of the baseline. :param in_format: The format of `pars`. :param out_format: The desired format of `pars`. @@ -106,11 +106,11 @@ for examples. :type out_format: `str` :returns: The transformed parameters. :rtype: `numpy.ndarray` - + .. py:method:: _valueraw(pars, r) Return value of baseline with given parameters at r. - + :param pars: The parameters of the baseline. :param r: Scalar or grid on which to calculate the baseline. :type pars: `Sequence(float)` @@ -130,12 +130,12 @@ following differences: 1) The ``estimate_parameters`` method is required. 2) The "position" key must be defined in the ``parameterdict`` class member. 3) Peak functions must implement the additional method ``scale_at``. - + .. py:method:: scale_at(pars, r, scale) Return peak parameters such that the value at ``r`` is scaled by ``scale`` while the position of the peak's maxima remains unchanged. - + :param pars: The parameters of the peak. :param r: Position where the peak will be rescaled. :param scale: A scale factor > 0. diff --git a/news/Recookiecut.rst b/news/Recookiecut.rst new file mode 100644 index 0000000..4763dd7 --- /dev/null +++ b/news/Recookiecut.rst @@ -0,0 +1,23 @@ +**Added:** + +* add api workflow + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Recookiecuttered diffpy.srmise to new BillingeGroup standard + +**Security:** + +* diff --git a/news/api_build.rst b/news/api_build.rst new file mode 100644 index 0000000..ae4edee --- /dev/null +++ b/news/api_build.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Used dynamic api build generated by new cookiecutter. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/workflow.rst b/news/workflow.rst new file mode 100644 index 0000000..3a0b96b --- /dev/null +++ b/news/workflow.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Changed workflow for build to satisfy new cookiecutter + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*