diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 04b4fcfa..9cc611c5 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -6,3 +6,9 @@ mater ;; Frobenius norm used in np.linalg.norm fro + +;; variable name for a pair type multiplicity in BaseDebyeSum.cpp +multipl + +;; custom scattering factor label used in TestScatteringFactorTable.hpp +ccustom diff --git a/.gitattributes b/.gitattributes index 04b6c92b..cb852f47 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ /.gitattributes export-ignore /.gitignore export-ignore -/doc export-ignore +/docs export-ignore gitarchive.cfg export-subst diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index fc34d9f5..6a572b63 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -3,7 +3,7 @@ name: Check for News on: pull_request_target: branches: - - main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main + - main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main jobs: check-news-item: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74f98b2c..eefb5210 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,12 @@ ci: autoupdate_schedule: monthly skip: [no-commit-to-branch] submodules: false +# Leave the vendored CxxTest SCons tool and the data tables untouched. +exclude: | + (?x)^( + site_scons/site_tools/cxxtest\.py| + .*\.(cif|dat) + )$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 diff --git a/doc/manual/Makefile b/doc/manual/Makefile deleted file mode 100644 index 64f3fb54..00000000 --- a/doc/manual/Makefile +++ /dev/null @@ -1,203 +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 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 " 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/libdiffpy.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/libdiffpy.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/libdiffpy" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/libdiffpy" - @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." - -# 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 --short 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 "Sync 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 12452388..00000000 --- a/doc/manual/source/conf.py +++ /dev/null @@ -1,287 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# libdiffpy documentation build configuration file, created by -# sphinx-quickstart on Sun Feb 9 11:31:20 2014. -# -# 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 sys -import os -import time - -# 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('../../../site_scons')) - -# abbreviations -ab_authors = u'Pavol Juhás, Christopher L. Farrow, Simon J.L. Billinge group' - -# -- 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.intersphinx', - 'sphinx.ext.ifconfig', - 'm2r', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = ['.rst', '.md'] - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'libdiffpy' -copyright = u'%Y, Brookhaven National Laboratory' - -# 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. -from libdiffpybuildutils import getversion -gver = getversion() -# The short X.Y version. -vfmt = '%(major)i.%(minor)i' + ('.%(micro)i' if gver['micro'] else '') -version = vfmt % gver -# The full version, including alpha/beta/rc tags. -release = gver['version'] - -# 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 = '' -fulldate = gver['date'] -today_seconds = time.strptime(fulldate.split()[0], '%Y-%m-%d') -today = time.strftime('%B %d, %Y', 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 = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - -# Display all warnings for missing links. -nitpicky = True - -# -- 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 = 'sphinx_py3doc_enhanced_theme' - -# 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', - 'navigation_with_keys' : 'true', -} - -# 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'] - -# 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 = 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 = 'libdiffpydoc' - - -# -- 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', 'libdiffpy.tex', u'libdiffpy 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', 'libdiffpy', u'libdiffpy 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', 'libdiffpy', u'libdiffpy Documentation', - ab_authors, 'libdiffpy', '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' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -# intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/manual/source/index.rst b/doc/manual/source/index.rst deleted file mode 100644 index b16f66e6..00000000 --- a/doc/manual/source/index.rst +++ /dev/null @@ -1,68 +0,0 @@ -.. libdiffpy documentation master file, created by - sphinx-quickstart on Sun Feb 9 11:31:20 2014. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - - -#################################################### -libdiffpy documentation -#################################################### - -libdiffpy - C++ calculators of PDF, bond valence sum and other pair quantities - -| Software version |release|. -| Last updated |today|. - -libdiffpy is a C++ library for calculating atomic pair distribution function -(PDF), bond valence sums, atom overlaps for a hard-sphere model, bond -distances and directions up to specified maximum distance. The atomic -structure models are represented by classes for non-periodic, periodic or -structures with space group symmetries. libdiffpy supports Crystal and -Molecule classes from the ObjCryst crystallographic library. Calculators -support two evaluation models - BASIC, which performs a full pair-summation -every time, and OPTIMIZED, which updates only pair contributions that have -changed since the last evaluation. libdiffpy supports object serialization -and parallel computations using parallel map function. PDF calculations can -be performed in two modes - either as a real-space summation of peak profiles -(PDFCalculator) or as a reciprocal-space Debye summation and Fourier transform -of the total scattering structure function (DebyePDFCalculator). - -The calculator objects in libdiffpy share common procedure for iteration -over atom pairs and only specialize the processing of pair contributions. -New calculator class can thus be readily defined for any quantity that is -obtained by iteration over atom pairs. - - -================ -Authors -================ - -This code was written by members of the Billinge Group at Columbia -University and Brookhaven National Laboratory including Pavol Juhás, -Christopher Farrow and Simon Billinge. -For a full list of contributors see -https://github.com/diffpy/libdiffpy/graphs/contributors. - -====================================== -Installation -====================================== - -See the `README `_ -file included with the distribution. - -====================================== -Table of contents -====================================== - -.. toctree:: - :titlesonly: - - license - release - -======================================================================== -Indices -======================================================================== - -* :ref:`genindex` -* :ref:`search` diff --git a/doc/manual/source/license.rst b/doc/manual/source/license.rst deleted file mode 100644 index 7d41179e..00000000 --- a/doc/manual/source/license.rst +++ /dev/null @@ -1,140 +0,0 @@ -License -####### - -OPEN SOURCE LICENSE AGREEMENT -============================= - -| Copyright (c) 2009-2011, University of Tennessee -| Copyright (c) 1989, 1991 Free Software Foundation, Inc. -| Copyright (c) 2006, The Regents of the University of California through - Lawrence Berkeley National Laboratory -| Copyright (c) 2014, Australian Synchrotron Research Program Inc., ("ASRP") -| Copyright (c) 2006-2007, Board of Trustees of Michigan State University -| Copyright (c) 2008-2012, The Trustees of Columbia University in - the City of New York -| Copyright (c) 2014-2019, Brookhaven Science Associates, - Brookhaven National Laboratory - - -The "DiffPy-CMI" is distributed subject to the following license conditions: - - -SOFTWARE LICENSE AGREEMENT -========================== - -Software: **DiffPy-CMI** - - -(1) The "Software", below, refers to the aforementioned DiffPy-CMI (in either -source code, or binary form and accompanying documentation). - -Part of the software was derived from the DANSE, ObjCryst++ (with permission), -PyCifRW, Python periodictable, CCTBX, and SasView open source projects, of -which the original Copyrights are contained in each individual file. - -Each licensee is addressed as "you" or "Licensee." - - -(2) The copyright holders shown above and their third-party Licensors hereby -grant licensee a royalty-free nonexclusive license, subject to the limitations -stated herein and U.S. Government license rights. - - -(3) You may modify and make a copy or copies of the software for use within -your organization, if you meet the following conditions: - - (a) Copies in source code must include the copyright notice and this - software license agreement. - - (b) Copies in binary form must include the copyright notice and this - Software License Agreement in the documentation and/or other materials - provided with the copy. - - -(4) You may modify a copy or copies of the Software or any portion of it, thus -forming a work based on the Software, and distribute copies of such work -outside your organization, if you meet all of the following conditions: - - (a) Copies in source code must include the copyright notice and this - Software License Agreement; - - (b) Copies in binary form must include the copyright notice and this - Software License Agreement in the documentation and/or other materials - provided with the copy; - - (c) Modified copies and works based on the Software must carry prominent - notices stating that you changed specified portions of the Software. - - (d) Neither the name of Brookhaven Science Associates or Brookhaven - National Laboratory nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - written permission. - - -(5) Portions of the Software resulted from work developed under a U.S. -Government contract and are subject to the following license: -The Government is granted for itself and others acting on its behalf a -paid-up, nonexclusive, irrevocable worldwide license in this computer software -to reproduce, prepare derivative works, and perform publicly and display -publicly. - - -(6) WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT -WARRANTY OF ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY -LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND -THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING -BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL -LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF -THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE -PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION -UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. - - -(7) LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR -THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF -ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, -CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING -BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, -WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING -NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS -BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. - - -Brookhaven National Laboratory Notice -===================================== - -Acknowledgment of sponsorship ------------------------------ - -This software was produced by the Brookhaven National Laboratory, under -Contract DE-AC02-98CH10886 with the Department of Energy. - - -Government disclaimer of liability ----------------------------------- - -Neither the United States nor the United States Department of Energy, nor -any of their employees, makes any warranty, express or implied, or assumes -any legal liability or responsibility for the accuracy, completeness, or -usefulness of any data, apparatus, product, or process disclosed, or -represents that its use would not infringe privately owned rights. - - -Brookhaven disclaimer of liability ----------------------------------- - -Brookhaven National Laboratory makes no representations or warranties, -express or implied, nor assumes any liability for the use of this software. - - -Maintenance of notice ---------------------- - -In the interest of clarity regarding the origin and status of this -software, Brookhaven National Laboratory requests that any recipient of it -maintain this notice affixed to any distribution by the recipient that -contains a copy or derivative of this software. - - -.. rubric:: END OF LICENSE diff --git a/doc/manual/source/release.rst b/doc/manual/source/release.rst deleted file mode 100644 index 2f0bd47f..00000000 --- a/doc/manual/source/release.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. index:: release notes - -.. include:: ../../../CHANGELOG.rst diff --git a/docs/source/api/libdiffpy.rst b/docs/source/api/libdiffpy.rst deleted file mode 100644 index 3f7fdd00..00000000 --- a/docs/source/api/libdiffpy.rst +++ /dev/null @@ -1,11 +0,0 @@ -:tocdepth: -1 - -|title| -======= - -.. |title| replace:: libdiffpy package - -.. automodule:: libdiffpy - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index 051bfb53..784ff33b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,24 +15,29 @@ import sys import time -from importlib.metadata import version from pathlib import Path -# Attempt to import the version dynamically from GitHub tag. -try: - fullversion = version("libdiffpy") -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. # noqa: E501 # sys.path.insert(0, str(Path(".").resolve())) sys.path.insert(0, str(Path("../..").resolve())) sys.path.insert(0, str(Path("../../src").resolve())) +sys.path.insert(0, str(Path("../../site_scons").resolve())) + +# libdiffpy is a C++ library, so take the version from git tags through +# the SCons build utilities rather than from installed Python metadata. +try: + from libdiffpybuildutils import getversion + + fullversion = getversion()["version"] +except Exception: + fullversion = "No version found. The correct version will appear in the released version." # noqa: E501 # abbreviations -ab_authors = "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members" +ab_authors = ( + "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members" +) # -- General configuration ------------------------------------------------ diff --git a/docs/source/index.rst b/docs/source/index.rst index e80726b5..4164f2d9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,6 +9,25 @@ | Software version |release| | Last updated |today|. +libdiffpy is a C++ library for calculating atomic pair distribution function +(PDF), bond valence sums, atom overlaps for a hard-sphere model, bond +distances and directions up to specified maximum distance. The atomic +structure models are represented by classes for non-periodic, periodic or +structures with space group symmetries. libdiffpy supports Crystal and +Molecule classes from the ObjCryst crystallographic library. Calculators +support two evaluation models - BASIC, which performs a full pair-summation +every time, and OPTIMIZED, which updates only pair contributions that have +changed since the last evaluation. libdiffpy supports object serialization +and parallel computations using parallel map function. PDF calculations can +be performed in two modes - either as a real-space summation of peak profiles +(PDFCalculator) or as a reciprocal-space Debye summation and Fourier transform +of the total scattering structure function (DebyePDFCalculator). + +The calculator objects in libdiffpy share common procedure for iteration +over atom pairs and only specialize the processing of pair contributions. +New calculator class can thus be readily defined for any quantity that is +obtained by iteration over atom pairs. + ======= Authors ======= @@ -35,7 +54,6 @@ Table of contents .. toctree:: :maxdepth: 2 - Package API release license diff --git a/docs/source/license.rst b/docs/source/license.rst index 75f32ed6..38f27eec 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -7,32 +7,138 @@ License OPEN SOURCE LICENSE AGREEMENT ============================= -BSD 3-Clause License - -Copyright (c) 2026, libdiffpy contributors. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +| Copyright (c) 2009-2011, University of Tennessee +| Copyright (c) 1989, 1991 Free Software Foundation, Inc. +| Copyright (c) 2006, The Regents of the University of California through + Lawrence Berkeley National Laboratory +| Copyright (c) 2014, Australian Synchrotron Research Program Inc., ("ASRP") +| Copyright (c) 2006-2007, Board of Trustees of Michigan State University +| Copyright (c) 2008-2012, The Trustees of Columbia University in + the City of New York +| Copyright (c) 2014-2019, Brookhaven Science Associates, + Brookhaven National Laboratory + + +The "DiffPy-CMI" is distributed subject to the following license conditions: + + +SOFTWARE LICENSE AGREEMENT +========================== + +Software: **DiffPy-CMI** + + +(1) The "Software", below, refers to the aforementioned DiffPy-CMI (in either +source code, or binary form and accompanying documentation). + +Part of the software was derived from the DANSE, ObjCryst++ (with permission), +PyCifRW, Python periodictable, CCTBX, and SasView open source projects, of +which the original Copyrights are contained in each individual file. + +Each licensee is addressed as "you" or "Licensee." + + +(2) The copyright holders shown above and their third-party Licensors hereby +grant licensee a royalty-free nonexclusive license, subject to the limitations +stated herein and U.S. Government license rights. + + +(3) You may modify and make a copy or copies of the software for use within +your organization, if you meet the following conditions: + + (a) Copies in source code must include the copyright notice and this + software license agreement. + + (b) Copies in binary form must include the copyright notice and this + Software License Agreement in the documentation and/or other materials + provided with the copy. + + +(4) You may modify a copy or copies of the Software or any portion of it, thus +forming a work based on the Software, and distribute copies of such work +outside your organization, if you meet all of the following conditions: + + (a) Copies in source code must include the copyright notice and this + Software License Agreement; + + (b) Copies in binary form must include the copyright notice and this + Software License Agreement in the documentation and/or other materials + provided with the copy; + + (c) Modified copies and works based on the Software must carry prominent + notices stating that you changed specified portions of the Software. + + (d) Neither the name of Brookhaven Science Associates or Brookhaven + National Laboratory nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + written permission. + + +(5) Portions of the Software resulted from work developed under a U.S. +Government contract and are subject to the following license: +The Government is granted for itself and others acting on its behalf a +paid-up, nonexclusive, irrevocable worldwide license in this computer software +to reproduce, prepare derivative works, and perform publicly and display +publicly. + + +(6) WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT +WARRANTY OF ANY KIND. THE COPYRIGHT HOLDERS, THEIR THIRD PARTY +LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND +THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL +LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF +THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF THE SOFTWARE WOULD NOT INFRINGE +PRIVATELY OWNED RIGHTS, (4) DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION +UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL BE CORRECTED. + + +(7) LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT HOLDERS, THEIR +THIRD PARTY LICENSORS, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF +ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, INCIDENTAL, +CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF ANY KIND OR NATURE, INCLUDING +BUT NOT LIMITED TO LOSS OF PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, +WHETHER SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING +NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, EVEN IF ANY OF SAID PARTIES HAS +BEEN WARNED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGES. + + +Brookhaven National Laboratory Notice +===================================== + +Acknowledgment of sponsorship +----------------------------- + +This software was produced by the Brookhaven National Laboratory, under +Contract DE-AC02-98CH10886 with the Department of Energy. + + +Government disclaimer of liability +---------------------------------- + +Neither the United States nor the United States Department of Energy, nor +any of their employees, makes any warranty, express or implied, or assumes +any legal liability or responsibility for the accuracy, completeness, or +usefulness of any data, apparatus, product, or process disclosed, or +represents that its use would not infringe privately owned rights. + + +Brookhaven disclaimer of liability +---------------------------------- + +Brookhaven National Laboratory makes no representations or warranties, +express or implied, nor assumes any liability for the use of this software. + + +Maintenance of notice +--------------------- + +In the interest of clarity regarding the origin and status of this +software, Brookhaven National Laboratory requests that any recipient of it +maintain this notice affixed to any distribution by the recipient that +contains a copy or derivative of this software. + + +.. rubric:: END OF LICENSE diff --git a/news/docs-migration.rst b/news/docs-migration.rst new file mode 100644 index 00000000..e13f7faa --- /dev/null +++ b/news/docs-migration.rst @@ -0,0 +1,25 @@ +**Added:** + +* Library overview from the old manual on the ``docs/`` index page. + +**Changed:** + +* Moved the Sphinx documentation from ``doc/manual/`` to the scikit-package ``docs/`` layout. +* Read the documentation version from git tags through ``site_scons/libdiffpybuildutils.py``. + +**Deprecated:** + +* + +**Removed:** + +* Old ``doc/manual/`` Sphinx project. +* Python ``automodule`` API page, which cannot document a C++ library. + +**Fixed:** + +* Pre-commit hooks now pass: fixed spelling in C++ comments, reformatted ``site_scons`` helpers, and excluded the vendored CxxTest tool and data tables. + +**Security:** + +* diff --git a/site_scons/fallback_version.py b/site_scons/fallback_version.py index 01b1119b..59b8cdd0 100644 --- a/site_scons/fallback_version.py +++ b/site_scons/fallback_version.py @@ -1,10 +1,11 @@ #!/usr/bin/env python -''' -Definition of FALLBACK_VERSION. Use it when git repository is -not available for example, when building from git zip archive. +"""Definition of FALLBACK_VERSION. + +Use it when git repository is not available for example, when building +from git zip archive. Update FALLBACK_VERSION when tagging a new release. -''' +""" -FALLBACK_VERSION = '1.4.0.post0' +FALLBACK_VERSION = "1.4.0.post0" diff --git a/site_scons/libdiffpybuildutils.py b/site_scons/libdiffpybuildutils.py index a8d8afbd..28580aa2 100644 --- a/site_scons/libdiffpybuildutils.py +++ b/site_scons/libdiffpybuildutils.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -'''Utility functions used by scons and sphinx for version extraction. -''' +"""Utility functions used by scons and sphinx for version extraction.""" import os import re @@ -21,79 +20,81 @@ def gitinfo(): - 'Extract dictionary of version data from git records.' - from subprocess import Popen, PIPE + "Extract dictionary of version data from git records." + from subprocess import PIPE, Popen + global _cached_gitinfo if _cached_gitinfo is not None: return _cached_gitinfo - nullfile = open(os.devnull, 'w') - kw = dict(stdout=PIPE, stderr=nullfile, cwd=MYDIR, - universal_newlines=True) - proc = Popen(['git', 'describe', '--match=v[[:digit:]]*'], **kw) + nullfile = open(os.devnull, "w") + kw = dict(stdout=PIPE, stderr=nullfile, cwd=MYDIR, universal_newlines=True) + proc = Popen(["git", "describe", "--match=v[[:digit:]]*"], **kw) desc = proc.stdout.read() if proc.wait(): _cached_gitinfo = {} return gitinfo() - proc = Popen(['git', 'log', '-1', '--format=%H %ci'], **kw) + proc = Popen(["git", "log", "-1", "--format=%H %ci"], **kw) glog = proc.stdout.read() - words = desc.strip().split('-') - vtag = words[0].lstrip('v') - vnum = int((words[1:2] or ['0'])[0]) + words = desc.strip().split("-") + vtag = words[0].lstrip("v") + vnum = int((words[1:2] or ["0"])[0]) rv = {} - rv['commit'], rv['date'] = glog.strip().split(None, 1) - rv['patchnumber'] = vnum - rv['version'] = vtag + rv["commit"], rv["date"] = glog.strip().split(None, 1) + rv["patchnumber"] = vnum + rv["version"] = vtag if vnum: - rv['version'] += '.post' + str(vnum) + rv["version"] += ".post" + str(vnum) _cached_gitinfo = rv return gitinfo() + _cached_gitinfo = None def getversion(): """Extract version from gitinfo and/or gitarchive.cfg file. - Process gitinfo first and make sure it matches FALLBACK_VERSION - in gitarchive.cfg. Use expanded data from gitarchive.cfg when - these sources are from git archive bundle. + Process gitinfo first and make sure it matches FALLBACK_VERSION in + gitarchive.cfg. Use expanded data from gitarchive.cfg when these + sources are from git archive bundle. """ from fallback_version import FALLBACK_VERSION - gitarchivecfgfile = os.path.join(MYDIR, 'gitarchive.cfg') + + gitarchivecfgfile = os.path.join(MYDIR, "gitarchive.cfg") assert os.path.isfile(gitarchivecfgfile) with open(gitarchivecfgfile) as fp: gacontent = fp.read() - gaitems = re.findall(r'^(\w+) *= *(\S.*?)\s*$', gacontent, re.M) + gaitems = re.findall(r"^(\w+) *= *(\S.*?)\s*$", gacontent, re.M) ga = dict(gaitems) gi = gitinfo() rv = {} if gi: afb = FALLBACK_VERSION - gfb = gi['version'].split('.post')[0] + '.post0' + gfb = gi["version"].split(".post")[0] + ".post0" if gfb != afb: raise RuntimeError(EMSG_BAD_FALLBACK_VERSION.format(afb, gfb)) rv.update(gi) else: # Not a git repository. Require that gitarchive.cfg is expanded. - if '$Format:' in ga['commit']: + if "$Format:" in ga["commit"]: raise RuntimeError(EMSG_GIT_MISSING) - rv['commit'] = ga['commit'] - rv['date'] = ga['date'] + rv["commit"] = ga["commit"] + rv["date"] = ga["date"] # First assume we have an undetermined post-release. Keep version # suffix as ".post0", but set patchnumber to ensure we are post # FALLBACK_VERSION. - rv['version'] = FALLBACK_VERSION - rv['patchnumber'] = 1 + rv["version"] = FALLBACK_VERSION + rv["patchnumber"] = 1 # If we are at version tag turn this to regular release. - mx = re.search(r'\btag: v(\d[^,]*)', ga['refnames']) + mx = re.search(r"\btag: v(\d[^,]*)", ga["refnames"]) if mx: - rv['version'] = mx.group(1) - rv['patchnumber'] = 0 + rv["version"] = mx.group(1) + rv["patchnumber"] = 0 # rv['version'] is resolved, let's parse its subfields. - vbase = rv['version'].split('.post')[0] - mx = re.match(r'^(\d+)\.(\d+)(?:\.(\d+))?((?:[ab]|rc)\d*)?', vbase) - rv['major'] = int(mx.group(1)) - rv['minor'] = int(mx.group(2)) - rv['micro'] = int(mx.group(3) or 0) - rv['prerelease'] = mx.group(4) + vbase = rv["version"].split(".post")[0] + mx = re.match(r"^(\d+)\.(\d+)(?:\.(\d+))?((?:[ab]|rc)\d*)?", vbase) + rv["major"] = int(mx.group(1)) + rv["minor"] = int(mx.group(2)) + rv["micro"] = int(mx.group(3) or 0) + rv["prerelease"] = mx.group(4) return rv diff --git a/src/diffpy/HasClassRegistry.hpp b/src/diffpy/HasClassRegistry.hpp index 87832b18..762e2992 100644 --- a/src/diffpy/HasClassRegistry.hpp +++ b/src/diffpy/HasClassRegistry.hpp @@ -16,7 +16,7 @@ * functions that produce derived classes. To be used as a base for a * specific class branch. For a proper function, the HasClassRegistry * template must be instantiated in just one cpp file that includes the -* implementatios in HasClassRegistry.ipp. +* implementations in HasClassRegistry.ipp. * * A Base class with registry should be declared as * class Base : public HasClassRegistry @@ -62,7 +62,7 @@ class HasClassRegistry /// Clear registration of the specified type under its standard name /// or any alias. Return the number of unset names and aliases or - /// 0 if the specifed string type was not registered. + /// 0 if the specified string type was not registered. static int deregisterType(const std::string& tp); /// Create new instance of a specified string type. diff --git a/src/diffpy/srreal/PairQuantity.cpp b/src/diffpy/srreal/PairQuantity.cpp index 178c6815..f31886c4 100644 --- a/src/diffpy/srreal/PairQuantity.cpp +++ b/src/diffpy/srreal/PairQuantity.cpp @@ -448,7 +448,7 @@ void PairQuantity::updateMaskData() // rebuild minvertpairmask according to mtypemask minvertpairmask.clear(); TypeMaskStorage::const_iterator tpmsk; - // build a list of type masks with all-masks at the begining + // build a list of type masks with all-masks at the beginning list< pair > orderedpairs; for (tpmsk = mtypemask.begin(); tpmsk != mtypemask.end(); ++tpmsk) { diff --git a/src/diffpy/srreal/PeakProfile.hpp b/src/diffpy/srreal/PeakProfile.hpp index d6fd9ad8..c31540f3 100644 --- a/src/diffpy/srreal/PeakProfile.hpp +++ b/src/diffpy/srreal/PeakProfile.hpp @@ -13,7 +13,7 @@ ****************************************************************************** * * class PeakProfile -- base class for calculation of peak profiles. -* When possible total integrated area of the profile should eqaul 1. +* When possible total integrated area of the profile should equal 1. * The operator()(x, fwhm) returns amplitude of a zero-centered profile. * Methods xboundlo(fwhm), xboundhi(fwhm) return low and high x-boundaries, * where amplitude relative to the maximum becomes smaller than precision diff --git a/src/diffpy/srreal/PointsInSphere.cpp b/src/diffpy/srreal/PointsInSphere.cpp index 4b732026..d149d570 100644 --- a/src/diffpy/srreal/PointsInSphere.cpp +++ b/src/diffpy/srreal/PointsInSphere.cpp @@ -14,7 +14,7 @@ * * classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin * -* Comments: sequencers for lattice points insided 3D sphere +* Comments: sequencers for lattice points inside 3D sphere * *****************************************************************************/ @@ -117,7 +117,7 @@ void PointsInSphere::rewind() mHalfSpan = Rmax()*latpar.ar; hi_m = int(ceil(mHalfSpan)); this->_m = -hi_m; - // make indices n, o invalid, reset the neares point + // make indices n, o invalid, reset the nearest point this->_n = hi_n = 0; this->_o = hi_o = outside_o = 0; n0plane = o0plane = o0line = 0.0; diff --git a/src/diffpy/srreal/QuantityType.hpp b/src/diffpy/srreal/QuantityType.hpp index 07dda8d7..d577f43b 100644 --- a/src/diffpy/srreal/QuantityType.hpp +++ b/src/diffpy/srreal/QuantityType.hpp @@ -16,7 +16,7 @@ * * QuantityType -- type that stores PairQuantity results, an array of doubles * It is a unique derived class from vector to avoid conflicts with -* boost_python convertors in cctbx. +* boost_python converters in cctbx. * *****************************************************************************/ diff --git a/src/diffpy/srreal/R3linalg.cpp b/src/diffpy/srreal/R3linalg.cpp index c3473a67..c648eba8 100644 --- a/src/diffpy/srreal/R3linalg.cpp +++ b/src/diffpy/srreal/R3linalg.cpp @@ -12,7 +12,7 @@ * ****************************************************************************** * -* R3linalg -- vector and matrix types and linar algebra operations in R3 space +* R3linalg -- vector and matrix types and linear algebra operations in R3 space * *****************************************************************************/ diff --git a/src/diffpy/srreal/R3linalg.hpp b/src/diffpy/srreal/R3linalg.hpp index 8cd07dbc..6b6ad054 100644 --- a/src/diffpy/srreal/R3linalg.hpp +++ b/src/diffpy/srreal/R3linalg.hpp @@ -12,7 +12,7 @@ * ****************************************************************************** * -* R3linalg -- vector and matrix types and linar algebra operations in R3 space +* R3linalg -- vector and matrix types and linear algebra operations in R3 space * *****************************************************************************/ diff --git a/src/tests/TestObjCrystStructureAdapter.hpp b/src/tests/TestObjCrystStructureAdapter.hpp index 7428a03b..eaa4da27 100644 --- a/src/tests/TestObjCrystStructureAdapter.hpp +++ b/src/tests/TestObjCrystStructureAdapter.hpp @@ -357,7 +357,7 @@ class TestObjCrystStructureBondGenerator : public CxxTest::TestSuite // there are 6 second nearest neighbors at 3.52 m_nibnds->setRmax(3.6); TS_ASSERT_EQUALS(6, countBonds(*m_nibnds)); - // which sums to 18 neigbhors within radius 3.6 + // which sums to 18 neighbors within radius 3.6 m_nibnds->setRmin(0); TS_ASSERT_EQUALS(18, countBonds(*m_nibnds)); } @@ -444,7 +444,7 @@ class TestObjCrystStructureBondGenerator : public CxxTest::TestSuite { TS_ASSERT_DELTA(0.00356, testmsd1(stru, bnds), epsu); } - // other 3 tantalums are related by tripple axis and + // other 3 tantalums are related by triple axis and // have the same msd towards the central Li else { diff --git a/src/tests/TestPeriodicStructureAdapter.hpp b/src/tests/TestPeriodicStructureAdapter.hpp index 935e7ec4..a6d562d4 100644 --- a/src/tests/TestPeriodicStructureAdapter.hpp +++ b/src/tests/TestPeriodicStructureAdapter.hpp @@ -318,7 +318,7 @@ class TestPeriodicStructureBondGenerator : public CxxTest::TestSuite // there are 6 second nearest neighbors at 3.52 m_nibnds->setRmax(3.6); TS_ASSERT_EQUALS(6, countBonds(*m_nibnds)); - // which sums to 18 neigbhors within radius 3.6 + // which sums to 18 neighbors within radius 3.6 m_nibnds->setRmin(0); TS_ASSERT_EQUALS(18, countBonds(*m_nibnds)); } @@ -408,7 +408,7 @@ class TestPeriodicStructureBondGenerator : public CxxTest::TestSuite { TS_ASSERT_DELTA(0.00356, testmsd1(stru, bnds), epsu); } - // other 3 tantalums are related by tripple axis and + // other 3 tantalums are related by triple axis and // have the same msd towards the central Li else {