Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
439 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Installation | ||
------------- | ||
|
||
To install as a Python module, type | ||
|
||
`python -m pip install .` | ||
|
||
from the root directory. | ||
For developers, you should install in linked .egg mode using | ||
|
||
`python -m pip install . develop` | ||
|
||
If you are using a Python virtual environment, you should activate this first before using the above commands. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Docs README | ||
------------- | ||
|
||
The documentation for xrdfit is generated using the Sphinx Python package and built and hosted at Read The Docs. | ||
|
||
Documentation is written in reStructuredText format and compiled by the Sphinx package into a HTML source. At compilation time Sphinx also scrapes docstrings from the Python scripts and adds these to the documentation. | ||
|
||
|
||
Requrements to compile documentation | ||
====================================== | ||
|
||
Install: Sphinx (http://www.sphinx-doc.org/en/master/) - (conda install sphinx/pip install sphinx) | ||
|
||
|
||
Compiling documentation | ||
========================= | ||
|
||
To recompile the documentation after a change, from the docs folder use the commands:: | ||
|
||
sphinx-build -b html ./source ./html | ||
|
||
If the structure of the Python scripts is significantly changed, api-doc can autogenerate the API documentation with the command:: | ||
|
||
sphinx-apidoc -o ./source ../xrdfit | ||
|
||
The HTML output should not be committed to the repository, this is just a local preview version. Each time the repository is pushed to GitHub the docs are rebuilt from source at: https://xrdfit.readthedocs.io/en/latest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<meta http-equiv="refresh" content="0; url=./html/index.html" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# 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. | ||
# | ||
# import os | ||
# import sys | ||
# sys.path.insert(0, os.path.abspath('.')) | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = 'xrdfit' | ||
copyright = '2019, Peter Crowther' | ||
author = 'Peter Crowther' | ||
|
||
# The full version, including alpha/beta/rc tags | ||
release = '0.1' | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# 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.autodoc', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.mathjax', | ||
'sphinx.ext.viewcode', | ||
'sphinx.ext.githubpages', | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = [] | ||
|
||
|
||
# The master toctree document. | ||
master_doc = 'index' | ||
|
||
# -- 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 = 'default' | ||
|
||
# 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 = {"body_max_width": "100%"} | ||
|
||
# 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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. xrdfit documentation master file, created by | ||
sphinx-quickstart on Mon Dec 16 15:47:29 2019. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to xrdfit's documentation! | ||
================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
xrdfit | ||
====== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
xrdfit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
xrdfit package | ||
============== | ||
|
||
Submodules | ||
---------- | ||
|
||
xrdfit.fit\_analysis module | ||
--------------------------- | ||
|
||
.. automodule:: xrdfit.fit_analysis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
xrdfit.plotting module | ||
---------------------- | ||
|
||
.. automodule:: xrdfit.plotting | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
xrdfit.pv\_fit module | ||
--------------------- | ||
|
||
.. automodule:: xrdfit.pv_fit | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
xrdfit.spectrum\_fitting module | ||
------------------------------- | ||
|
||
.. automodule:: xrdfit.spectrum_fitting | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: xrdfit | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
% Encoding: UTF-8 | ||
@Misc{Newville2014, | ||
author = {Newville, Matthew and Stensitzki, Till and Allen, Daniel B. and Ingargiola, Antonino}, | ||
title = {LMFIT: Non-Linear Least-Square Minimization and Curve-Fitting for Python}, | ||
year = {2014}, | ||
doi = {10.5281/ZENODO.11813}, | ||
keywords = {python, non-linear least-squares optimization, curve-fitting}, | ||
publisher = {Zenodo}, | ||
} | ||
|
||
@Comment{jabref-meta: databaseType:bibtex;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: 'xrdfit: A Python package for fitting SXRD diffraction spectra' | ||
tags: | ||
- Python | ||
- physics | ||
- crystallography | ||
- material structure | ||
authors: | ||
- name: Peter Crowther | ||
orcid: 0000-0002-5430-6924 | ||
affiliation: 1 | ||
- name: Christopher Daniel | ||
orcid: 0000-0002-5574-6833 | ||
affiliation: 1 | ||
affiliations: | ||
- name: Univeristy of Manchester | ||
index: 1 | ||
date: 16 December 2019 | ||
bibliography: paper.bib | ||
|
||
--- | ||
|
||
# Summary | ||
|
||
100 words on xrd and material structure | ||
|
||
``xrdfit`` is an Python package for fitting the peaks found in shallow x-ray | ||
diffraction spectra. It is designed to be an easy to use tool for quick analysis of | ||
spectra. Features are included for automating fitting over many spectra to enable | ||
tracking of peaks as they shift through the experiment. Some basic Materials anlysis | ||
algorithms are added which allow converstion of the peak positions to material properties | ||
like strain. ``xrdfit`` uses the Python package ``lmfit`` for the underlying fitting [@Newville2014]. | ||
|
||
``xrdfit`` is designed to be used by experimental researchers who need to | ||
process SXRD spectra but do not have a detailed knowledge of programming or | ||
fitting. It has been used for the analysis of data presented in [insert paper here]. | ||
We hope that its public release will allow other researchers to benefit from | ||
fast data fitting, reducing the effort required to do basic analysis of their | ||
experimental data. | ||
|
||
# Acknowledgements | ||
|
||
We acknowledge funding from | ||
|
||
# References |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file provides configuration for building the documentation at: https://xrdfit.readthedocs.io/en/latest/index.html | ||
|
||
version: 2 | ||
|
||
python: | ||
version: 3.6 | ||
install: | ||
- requirements: requirements.txt | ||
- method: setuptools | ||
path: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numpy | ||
matplotlib | ||
pandas | ||
dill | ||
tqdm | ||
scipy | ||
lmfit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='xrdfit', | ||
version='0.1', | ||
description='Automated fitting of XRD peaks using Pseudo-Voight fits', | ||
author='Peter Crowther', | ||
packages=find_packages(), | ||
install_requires=['numpy', | ||
'matplotlib', | ||
'pandas', | ||
'dill', | ||
'tqdm', | ||
'scipy', | ||
'lmfit' | ||
], | ||
extras_require={"documentation_compilation": "sphinx"} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.