Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
merrygoat committed May 15, 2020
2 parents 84270ec + b18b1a2 commit f6e9516
Show file tree
Hide file tree
Showing 37 changed files with 10,508 additions and 4,599 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -14,3 +14,5 @@ __pycache__/
/xrdfit/test.py
/xrdfit.egg-info
/example_data/example_data_large/
/build
/dist
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,26 @@
# Contributing

We welcome bug reports, feature requests and suggestions for improvement made to this package. Below are some guidelines to keep in mind when requesting or making changes.

## Reporting Issues

If you encounter a problem with the code, please open an issue on the project's GitHub issue board: https://github.com/LightForm-group/xrdfit/issues

You should include details about what version of ``xrdfit`` you are using, what you are attempting to do, details of the error you encountered and if possible a [minimal working example](https://en.wikipedia.org/wiki/Minimal_working_example) that shows the problem.

## Coding style

This project uses the PEP8 standard for formatting Python code with the exception that the maximum line length is 120 characters.

Docstrings are formatted in the reStructuredText format. These are automatically harvested by the Sphinx autodoc extension and form the API documentation at Read The Docs: (https://xrdfit.readthedocs.io/en/latest/)

## Release guidelines

Releases follow the [semver](https://semver.org/) numbering scheme.

When releasing a new version the following need to be updated:
* Update version number in setup.py
* Update version number in docs/config.py
* Add tag to git repo of the version number prefixed by the letter “v”
* Draft release on GitHub for that tag with a list of changes since the last version
* Upload new version to PyPi
36 changes: 34 additions & 2 deletions README.md
@@ -1,13 +1,45 @@
[![PyPI version](https://badge.fury.io/py/xrdfit.svg)](https://badge.fury.io/py/xrdfit)
[![Documentation Status](https://readthedocs.org/projects/xrdfit/badge/?version=latest)](https://xrdfit.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/203145007.svg)](https://zenodo.org/badge/latestdoi/203145007)

Introduction
--------------

xrdfit is a Python module 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. xrdfit uses the Python module lmfit for the underlying fitting. xrdfit is designed to be accessible for all researchers who need to process SXRD spectra and so does not require a detailed knowledge of programming or fitting.

Installation
-------------

To install as a Python module, type

`python -m pip install .`
`python -m pip install xrdfit`

from the root directory.
For developers, you should install in linked .egg mode using

`python -m pip install -e .`

If you are using a Python virtual environment, you should activate this first before using the above commands.
If you are using a Python virtual environment, you should activate this first before using the above commands.

Documentation
---------------
Documentation including an API reference is provided at: https://xrdfit.readthedocs.io/en/latest/

The majority of the documentation is provided as example driven interactive Jupyter notebooks. These are included along with the source code in the "tutorial notebooks" folder.
If this package was downloaded from pip, the source can be found on GitHub: https://github.com/LightForm-group/xrdfit


Required libraries
--------------------

This module uses the Python libraries:
* NumPy (https://numpy.org/)
* matplotlib (https://matplotlib.org/)
* pandas (https://pandas.pydata.org/)
* dill (https://pypi.org/project/dill/)
* tqdm (https://tqdm.github.io/)
* SciPy (https://www.scipy.org/)
* lmfit (https://lmfit.github.io/lmfit-py/)

The following libraries are required to use the tutorial documentation workbooks:
* Jupyter (https://jupyter.org/)
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

11 changes: 7 additions & 4 deletions docs/source/conf.py
Expand Up @@ -18,11 +18,11 @@
# -- Project information -----------------------------------------------------

project = 'xrdfit'
copyright = '2019, Peter Crowther'
author = 'Peter Crowther'
copyright = '2019, Peter Crowther and Christopher Daniel'
author = 'Peter Crowther and Christopher Daniel'

# The full version, including alpha/beta/rc tags
release = '0.1'
release = '0.1.1'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -66,4 +66,7 @@
# 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']
html_static_path = ['_static']

# -- Autodoc options --------------------
autoclass_content = 'both'
59 changes: 46 additions & 13 deletions docs/source/index.rst
@@ -1,20 +1,53 @@
.. 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.
xrdfit documentation
======================

Welcome to xrdfit's documentation!
==================================
``xrdfit`` is a Python package for fitting the diffraction peaks in synchrotron X-ray diffraction (SXRD) and XRD spectra. It is intended as an easy to use tool for the quick analysis of individual and overlapping lattice plane peaks, to quantify the peak positions and profiles. ``xrdfit`` uses the Python package `lmfit <https://lmfit.github.io/lmfit-py/>`_ for the underlying fitting. Features are included for selecting different 'cakes' of data and automating fitting over many spectra, to enable tracking of peaks as they shift throughout the experiment. ``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.


Installation
==============

``xrdfit`` is compatible with Python 3.6+.

Use :command:`pip` to install the latest stable version of ``xrdfit``:

.. code-block:: console
pip install xrdfit
The current development version is available on `github
<https://github.com/LightForm-group/xrdfit>`__. To install use:

.. code-block:: console
git clone --branch develop https://github.com/LightForm-group/xrdfit
cd xrdfit
python -m pip install .
.. toctree::
:maxdepth: 2
:caption: Contents:
Getting started
================

This documentation is primarily an API reference, auto-generated from the docstrings in the source code.

Indices and tables
==================
The primary source of documentation for new users is a series of tutorial Jupyter Notebooks which are included with the source code.

The source and notebooks are available on the project’s GitHub page: `<https://github.com/LightForm-group/xrdfit>`_


Acknowledgements
=================

This project was developed at the `University of Manchester <https://www.manchester.ac.uk/>`_ with funding from the UK's Engineering and Physical Sciences Research Council (EPSRC) `LightForm <https://lightform.org.uk/>`_ grant: `(EP/R001715/1) <https://gow.epsrc.ukri.org/NGBOViewGrant.aspx?GrantRef=EP/R001715/1>`_.


API Reference
===============

.. toctree::
:maxdepth: 3

modules

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

22 changes: 1 addition & 21 deletions docs/source/xrdfit.rst
@@ -1,17 +1,6 @@
xrdfit package
==============

Submodules
----------

xrdfit.fit\_analysis module
---------------------------

.. automodule:: xrdfit.fit_analysis
:members:
:undoc-members:
:show-inheritance:

xrdfit.plotting module
----------------------

Expand All @@ -34,13 +23,4 @@ xrdfit.spectrum\_fitting module
.. automodule:: xrdfit.spectrum_fitting
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: xrdfit
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:

0 comments on commit f6e9516

Please sign in to comment.