Fix doc on python modules

This commit is contained in:
Valentin Valls 2019-05-17 10:18:11 +02:00
parent 018daa2df3
commit 91faa4dfe3
29 changed files with 155 additions and 69 deletions

View File

@ -33,7 +33,7 @@ __author__ = "Jerome Kieffer, Picca Frédéric-Emmanuel"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "01/03/2019"
__date__ = "17/05/2019"
__status__ = "production"
import os
@ -99,8 +99,8 @@ def parse_algorithms(options):
def cleanup_input_paths(input_paths):
"""Clean up filename using :: to access to data inside file.
:returns: Returns a list of paths without directory separator inside the filename
location.
:returns: Returns a list of paths without directory separator inside the
filename location.
"""
result = []
for path in input_paths:

View File

@ -25,9 +25,7 @@
# THE SOFTWARE.
"""Pre-Processing
A module for all common pixel-wise pre-processing of data.
"""Module providing common pixel-wise pre-processing of data.
"""
from __future__ import absolute_import, print_function, with_statement
@ -36,7 +34,7 @@ __author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "06/05/2019"
__date__ = "17/05/2019"
__status__ = "development"
import warnings
@ -87,10 +85,8 @@ def preproc(raw,
NaN are always considered as invalid values
if neither empty nor dummy is provided, empty pixels are 0.
Empty pixels are always zero in "split_result" mode
Empty pixels are always zero in "split_result" mode.
Split result:
-------------
When set to False, i.e the default, the pixel-wise operation is:
I = (raw - dark)/(flat \* solidangle \* polarization \* absorption)
Invalid pixels are set to the dummy or empty value.
@ -100,7 +96,7 @@ def preproc(raw,
I = [(raw - dark), (variance), (flat \* solidangle \* polarization \* absorption)]
Empty pixels will have all their 2 or 3 values to 0 (and not to dummy or empty value)
If poissonian is set to True, the variance is evaluated as (raw + dark)
If poissonian is set to True, the variance is evaluated as (raw + dark).
"""
if isinstance(dtype, str):
dtype = numpy.dtype(dtype).type

View File

@ -0,0 +1,29 @@
# coding: utf-8
# /*##########################################################################
#
# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
"""Package containing all Cython binary extensions"""
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__license__ = "MIT"

View File

@ -25,14 +25,14 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
'''Spline evaluation function
Created on Nov 4, 2013
'''
"""Module containing a re-implementation of bi-cubic spline evaluation from
scipy."""
__authors__ = ["Zubair Nawaz", "Jerome Kieffer"]
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "15/11/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"
@ -51,13 +51,15 @@ def bisplev(x, y, tck, dx=0, dy=0):
Return a rank-2 array of spline function values (or spline derivative
values) at points given by the cross-product of the rank-1 arrays x and
y. In special cases, return an array or just a float if either x or y or
both are floats. Based on BISPEV from FITPACK.
both are floats. Based on BISPEV from FITPACK.
See :func:`bisplrep` to generate the `tck` representation.
See also :func:`splprep`, :func:`splrep`, :func:`splint`, :func:`sproot`,
:func:`splev`, :func:`UnivariateSpline`, :func:`BivariateSpline`
References: [1]_, [2]_, [3]_.
.. [1] Dierckx P. : An algorithm for surface fitting
with spline functions
Ima J. Numer. Anal. 1 (1981) 267-283.

View File

@ -25,12 +25,16 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
Some Cythonized function for blob detection function
Some Cythonized function for blob detection function.
It is used to find peaks in images by performing subsequent blurs.
"""
__authors__ = ["Aurore Deschildre", "Jerome Kieffer"]
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "10/01/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"
import cython

View File

@ -26,11 +26,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Implementation of a separable 2D convolution"""
"""Implementation of a separable 2D convolution.
It is used in real space are used to blurs images, used in blob-detection
algorithm.
"""
__authors__ = ["Pierre Paleo", "Jerome Kieffer"]
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "01/12/2016"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"
import cython

View File

@ -26,9 +26,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
Distortion correction are correction are applied by look-up table (or CSR)
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "21/01/2019"
__date__ = "17/05/2019"
__copyright__ = "2011-2018, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -26,9 +26,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
This extension is a fast-implementation for calculating the geometry, i.e. where
every pixel of an array stays in space (x,y,z) or its (r, :math:`\\chi`)
coordinates.
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "26/10/2018"
__date__ = "17/05/2019"
__copyright__ = "2011-2016, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -26,9 +26,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Module used in file hierarchy tree for the diff_map graphical user interface.
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "09/01/2018"
__date__ = "17/05/2019"
__copyright__ = "2011-2015, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -25,10 +25,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Module with makes a discrete 2D-array appear like a continuous function thanks
to bilinear interpolations.
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "18/04/2019"
__date__ = "17/05/2019"
__copyright__ = "2011-2015, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -26,10 +26,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""A set of histogram functions with or without OpenMP enabled."""
"""A set of histogram functions with or without OpenMP enabled.
Re-implementation of the numpy.histogram, optimized for azimuthal integration.
Deprecated, will be replaced by ``silx.math.histogramnd``.
"""
__author__ = "Jerome Kieffer"
__date__ = "06/05/2019"
__date__ = "17/05/2019"
__license__ = "MIT"
__copyright__ = "2011-2019, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -25,9 +25,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
Module providing inversion transformation from pixel coordinate to radial/azimuthal
coordinate.
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "06/05/2019"
__date__ = "17/05/2019"
__copyright__ = "2018-2018, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -26,12 +26,15 @@
# THE SOFTWARE.
"""
A few binary morphology operation
This module provides a couple of binary morphology operations on images.
They are also implemented in ``scipy.ndimage`` in the general case, but not as
fast.
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "09/01/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"

View File

@ -25,10 +25,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
Contains a preprocessing function in charge of the dark-current subtraction,
flat-field normalization... taking care of masked values and normalization.
"""
__author__ = "Jerome Kieffer"
__license__ = "MIT"
__date__ = "06/05/2019"
__date__ = "17/05/2019"
__copyright__ = "2011-2018, ESRF"
__contact__ = "jerome.kieffer@esrf.fr"

View File

@ -25,11 +25,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Cython module to reconstruct the masked values of an image"""
"""Cython module to reconstruct the masked values of an image.
It's a simple inpainting module for reconstructing the missing part of an
image (masked) to be able to use more common algorithms.
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "15/11/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"

View File

@ -26,11 +26,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""A module to relabel regions"""
"""Module providing features to relabel regions.
It is used to flag from largest regions to the smallest.
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "15/11/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"

View File

@ -26,11 +26,12 @@
# THE SOFTWARE.
#
"""Inverse watershed for connecting region of high intensity
"""Peak peaking via inverse watershed for connecting region of high intensity
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.kieffer@esrf.fr"
__date__ = "11/01/2018"
__date__ = "17/05/2019"
__status__ = "stable"
__license__ = "MIT"

View File

@ -22,6 +22,7 @@
# THE SOFTWARE.
#
# ###########################################################################*/
"""This module inits matplotlib and setups the backend to use.
It MUST be imported prior to any other import of matplotlib.
@ -29,11 +30,12 @@ It MUST be imported prior to any other import of matplotlib.
It provides the matplotlib :class:`FigureCanvasQTAgg` class corresponding
to the used backend.
"""
from __future__ import absolute_import
__authors__ = ["T. Vincent"]
__license__ = "MIT"
__date__ = "20/02/2018"
__date__ = "17/05/2019"
import sys

View File

@ -27,7 +27,7 @@ from __future__ import absolute_import
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "11/04/2019"
__date__ = "17/05/2019"
import functools
@ -41,8 +41,8 @@ class ChangeEvent(object):
"""
Define a change done on an item from the :class:`ListModel`.
:param int index, The location where to put/remove the item (before the change)
or the current index of the changed item
:param int index: The location where to put/remove the item (before the
change) or the current index of the changed item
:param object item: The item involved in this change
:param bool updated: True if the item was changed
:param bool added: True if the item was added

View File

@ -27,7 +27,7 @@ from __future__ import absolute_import
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "07/05/2019"
__date__ = "17/05/2019"
import numpy
from .AbstractModel import AbstractModel
@ -91,7 +91,7 @@ class PeakModel(AbstractModel):
List of axis/ord can be reached like that.
.. code-block::
.. code-block:: python
coords = group.coords()
yy = coords[:, 0]

View File

@ -27,7 +27,7 @@ from __future__ import absolute_import
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "16/05/2019"
__date__ = "17/05/2019"
import logging
import numpy
@ -767,8 +767,8 @@ class IntegrationPlot(qt.QFrame):
def setIntegrationProcess(self, integrationProcess):
"""
:param IntegrationProcess integrationProcess: Result of the integration
process
:param :class:`~pyFAI.gui.tasks.IntegrationTask.IntegrationProcess` integrationProcess:
Result of the integration process
"""
self.__clearRings()

View File

@ -30,7 +30,7 @@ from __future__ import division
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "05/11/2018"
__date__ = "17/05/2019"
import logging
@ -43,7 +43,8 @@ class Timer(object):
"""Kind of context manager to call a code while the amount of seconds is
not finished.
.. code-block::
.. code-block:: python
timer = Timer(seconds=10)
while not timer.isTimeout():
print("Tick")

View File

@ -27,7 +27,7 @@ from __future__ import absolute_import
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "25/04/2019"
__date__ = "17/05/2019"
import logging
@ -139,7 +139,7 @@ class AdvancedComboBox(qt.QComboBox):
Only `qt.Qt.DisplayRole` and `qt.Qt.DecorationRole` are supported.
.. code-block::
.. code-block:: python
def displayedData(widget, row, role=qt.Qt.DisplayRole):
if role == qt.Qt.DisplayRole:

View File

@ -30,11 +30,13 @@
# OTHER DEALINGS IN THE SOFTWARE.
#
"""Contains all OpenCL implementation."""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "2012-2017 European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "25/02/2019"
__date__ = "17/05/2019"
__status__ = "stable"
import os

View File

@ -34,26 +34,29 @@ of this modules to ensure access across different distribution schemes:
- Frozen fat binary application using pyFAI (frozen with cx_Freeze or py2app).
This needs special care for the resource files in the setup:
- With cx_Freeze, add pyFAI/resources to include_files::
- With cx_Freeze, add pyFAI/resources to include_files:
.. code-block:: python
import pyFAI.resources
pyFAI_include_files = (os.path.dirname(pyFAI.resources.__file__),
os.path.join('pyFAI', 'resources'))
setup(...
options={'build_exe': {'include_files': [pyFAI_include_files]}}
)
setup(...,
options={'build_exe': {'include_files': [pyFAI_include_files]}}
)
- With py2app, add pyFAI in the packages list of the py2app options:
- With py2app, add pyFAI in the packages list of the py2app options::
.. code-block:: python
setup(...
options={'py2app': {'packages': ['pyFAI']}}
)
setup(...,
options={'py2app': {'packages': ['pyFAI']}}
)
"""
__authors__ = ["V.A. Sole", "Thomas Vincent"]
__license__ = "MIT"
__date__ = "20/02/2018"
__date__ = "17/05/2019"
import os

View File

@ -27,14 +27,14 @@
# THE SOFTWARE.
"""
Utilities
Module with miscelaneous tools
"""
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "04/10/2018"
__date__ = "17/05/2019"
__status__ = "production"
import logging

View File

@ -23,11 +23,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
""" Bayesian evaluation of background for 1D powder diffraction pattern
"""Bayesian evaluation of background for 1D powder diffraction pattern.
Code according to Sivia and David, J. Appl. Cryst. (2001). 34, 318-324
# Version: 0.1 2012/03/28
# Version: 0.2 2016/10/07: OOP implementation
* Version: 0.1 2012/03/28
* Version: 0.2 2016/10/07: OOP implementation
"""
from __future__ import absolute_import, print_function, division
@ -35,7 +36,7 @@ from __future__ import absolute_import, print_function, division
__authors__ = ["Vincent Favre-Nicolin", "Jérôme Kieffer"]
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "09/01/2018"
__date__ = "17/05/2019"
__status__ = "development"
__docformat__ = 'restructuredtext'

View File

@ -23,14 +23,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""Module containing utilities around shell"""
"""Module containing utilities around shell command line."""
from __future__ import absolute_import, print_function, division
__author__ = "valentin.valls@esrf.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "25/02/2019"
__date__ = "17/05/2019"
__status__ = "development"
__docformat__ = 'restructuredtext'

View File

@ -26,12 +26,12 @@
from __future__ import absolute_import, print_function, division
"""Module containing utilitary around string"""
"""Module containing enhanced string formatters."""
__author__ = "valentin.valls@esrf.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "16/05/2019"
__date__ = "17/05/2019"
__status__ = "development"
__docformat__ = 'restructuredtext'