Skip to content

Commit

Permalink
filtered by pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Nov 15, 2022
1 parent a9fb777 commit 71fff47
Show file tree
Hide file tree
Showing 205 changed files with 5,908 additions and 5,991 deletions.
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ python:
- requirements: ci/requirements_rtd.txt
- method: pip
path: .

2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Please see doc/source/changelog.rst
Please see doc/source/changelog.rst
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contributing

When contributing to this repository, please first open an issue to discuss the change you wish to make.
Mention you wish to help us improving this specific part of the project, we will be able to provide you guidance.
Mention you wish to help us improving this specific part of the project, we will be able to provide you guidance.

If you have questions, the best is to subscribe to the associated mailing list. Direct contact with maintainers is
If you have questions, the best is to subscribe to the associated mailing list. Direct contact with maintainers is
discouraged as we are few and may be unavailable (holidays, ...).

## Prepare your local working environment
Expand All @@ -16,7 +16,7 @@ discouraged as we are few and may be unavailable (holidays, ...).
6. Build and test `python setup.py build test`

This should take a few minutes and ensures everything is ready for developping within pyFAI.
Later-on no recompilation will be needed unless you modify cython code.
Later-on no recompilation will be needed unless you modify cython code.
In this case, recompilation can be accelerating by installing `ccache`.

## Pull Request Process
Expand All @@ -36,13 +36,12 @@ or to run any third party application using pyFAI (when the full path needs is p
In one word, `bootstrap` is a great tool to help debugging, it re-compiles the code when needed but it is not perfect and corner cases probably exists.
Note: it is forbidden to import pyFAI from the sources, to avoid bugs as many files will be missing or mis-placed.

## Test locally your code
## Test locally your code

The test suite of pyFAI can simply be triggered by running `./run_tests.py` which
takes care of re-building what is needed.
takes care of re-building what is needed.
This helper script has many option about coverage, selecting tests, debuging mode ...
use `./run_tests.py -h` to visualize them all.


Please note we have not yet decided for a code of conduct.

1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ recursive-exclude doc *.npz
recursive-exclude doc *.npy
recursive-exclude doc *.edf
recursive-exclude doc *.edf

10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ As most Python packages, pyFAI is available via PIP::
It is advised to run this in a vitural environment.
Provide the *--user* to perform an installation local to your user (not recommended).
Under UNIX, you may have to run the command via *sudo* to gain root access an
perform a system wide installation (neither recommended).
perform a system wide installation (neither recommended).


With conda
Expand Down Expand Up @@ -90,7 +90,7 @@ repository::
git clone https://github.com/silx-kit/pyFAI.git
cd pyFAI
pip install --upgrade .

If you want pyFAI to make use of your graphic card, please install
`pyopencl <http://mathema.tician.de/software/pyopencl>`_

Expand Down Expand Up @@ -158,13 +158,13 @@ using apt-get these can be installed as::
MacOSX
------

One needs to install `Python` (>=3.6) and `Xcode` prior to start installing pyFAI.
One needs to install `Python` (>=3.6) and `Xcode` prior to start installing pyFAI.
The compiled extension will use only one core due to the limitation of the compiler.
OpenCL is hence greately adviced on Apple systems.
OpenCL is hence greately adviced on Apple systems.
Then install the missing dependencies with `pip`::

pip install -r requirements.txt


Windows
-------
Expand Down
6 changes: 3 additions & 3 deletions build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deb_name=$(echo "$source_project" | tr '[:upper:]' '[:lower:]')

# target system
if [ -f /etc/debian_version ]
then
then
debian_version=$(cat /etc/debian_version | cut -d. -f1 | grep -o '[0-9]*')
if [ -z $debian_version ]
then
Expand Down Expand Up @@ -92,7 +92,7 @@ optional arguments:
--help show this help text
--install install the packages generated at the end of
the process using 'sudo dpkg'
--stdeb-py3 Build using stdeb for python3
--stdeb-py3 Build using stdeb for python3
--debian9 Simulate a debian 9 Stretch system
--debian10 Simulate a debian 10 Buster system
--debian11 Simulate a debian 11 Bullseye system
Expand Down Expand Up @@ -165,7 +165,7 @@ clean_up()
}

build_deb() {
echo "Build for debian 9 or newer using actual packaging"
echo "Build for debian 9 or newer using actual packaging"
tarname=${project}_${debianversion}.orig.tar.gz
clean_up
python3 setup.py debian_src
Expand Down
6 changes: 3 additions & 3 deletions ci/install_pyopencl.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# Compile & install pyopencl
if [ -f ci/intel_opencl_icd.sh ]; then
if [ -f ci/intel_opencl_icd.sh ]; then
source ci/intel_opencl_icd.sh
git clone --depth=1 --shallow-submodules --recurse-submodules https://github.com/pyopencl/pyopencl
pushd pyopencl
pip install "setuptools<60.0.0"
pip install wheel pybind11 mako
pip install wheel pybind11 mako
CL_LIBRARY_PATH=$(python3 -c "import os; print(os.environ.get('LD_LIBRARY_PATH','').split(':')[-1])")
CL_INCLUDE_PATH=$(python3 -c "import os; print(os.environ.get('C_INCLUDE_PATH','').split(':')[-1])")
echo CL_LIBRARY_PATH ${CL_LIBRARY_PATH}
echo CL_LIBRARY_PATH ${CL_LIBRARY_PATH}
echo CL_INCLUDE_PATH ${CL_INCLUDE_PATH}
python3 configure.py --cl-inc-dir=${CL_INCLUDE_PATH} --cl-lib-dir=${CL_LIBRARY_PATH}
python3 setup.py build bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements_appveyor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ matplotlib
#mako
#pyopencl
numexpr
silx
silx
2 changes: 1 addition & 1 deletion ci/requirements_gh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ scipy
matplotlib
#mako
#pybind11
#pyopencl
#pyopencl
numexpr
silx
2 changes: 1 addition & 1 deletion doc/mathematica/geometry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ Out[50]//CForm=
(2.*Sqrt(Power(d1*Cos(rot2)*Cos(rot3) + d2*(Cos(rot3)*Sin(rot1)*Sin(rot2) - Cos(rot1)*Sin(rot3)) + L*(Cos(rot1)*Cos(rot3)*Sin(rot2) + Sin(rot1)*Sin(rot3)),2) +
Power(d1*Cos(rot2)*Sin(rot3) + L*(-(Cos(rot3)*Sin(rot1)) + Cos(rot1)*Sin(rot2)*Sin(rot3)) + d2*(Cos(rot1)*Cos(rot3) + Sin(rot1)*Sin(rot2)*Sin(rot3)),2))*
(Power(L*Cos(rot1)*Cos(rot2) + d2*Cos(rot2)*Sin(rot1) - d1*Sin(rot2),2) + Power(d1*Cos(rot2)*Cos(rot3) + d2*(Cos(rot3)*Sin(rot1)*Sin(rot2) - Cos(rot1)*Sin(rot3)) +
L*(Cos(rot1)*Cos(rot3)*Sin(rot2) + Sin(rot1)*Sin(rot3)),2) + Power(d1*Cos(rot2)*Sin(rot3) + L*(-(Cos(rot3)*Sin(rot1)) + Cos(rot1)*Sin(rot2)*Sin(rot3)) + d2*(Cos(rot1)*Cos(rot3) + Sin(rot1)*Sin(rot2)*Sin(rot3)),2)))
L*(Cos(rot1)*Cos(rot3)*Sin(rot2) + Sin(rot1)*Sin(rot3)),2) + Power(d1*Cos(rot2)*Sin(rot3) + L*(-(Cos(rot3)*Sin(rot1)) + Cos(rot1)*Sin(rot2)*Sin(rot3)) + d2*(Cos(rot1)*Cos(rot3) + Sin(rot1)*Sin(rot2)*Sin(rot3)),2)))
2 changes: 1 addition & 1 deletion doc/source/api/app/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pyFAI.app package

The package pyFAI.app contains the code of the different command line scripts and programs.
This code is not intended to be used by users of pyFAI as a library hence it makes little sense
to document it here.
to document it here.
3 changes: 1 addition & 2 deletions doc/source/api/gui/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pyFAI.gui package

The package pyFAI.gui contains mainly the code of the graphical user interface widgets.
This code is not intended to be used by users of pyFAI as a library hence it makes little sense
to document it all here. Only documentation on the *Jupyter* tools are exposed.
to document it all here. Only documentation on the *Jupyter* tools are exposed.

pyFAI.gui.cli_calibration module
--------------------------------
Expand Down Expand Up @@ -36,4 +36,3 @@ pyFAI.gui.peak_picker module
:members:
:undoc-members:
:show-inheritance:

3 changes: 0 additions & 3 deletions doc/source/api/pyFAI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,3 @@ Other sub-packages:
opencl/index
resources/index
utils/index



1 change: 0 additions & 1 deletion doc/source/biblio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,3 @@ Bibliography
Benecke, G. et al., (2014)
J. Appl. Cryst. 47,
http://dx.doi.org/10.1107/S1600576714019773
1 change: 0 additions & 1 deletion doc/source/calibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,3 @@ Nevertheless its absolute value has no meaning, except the lower, the better.

Subsequently, pyFAI offers some validation options in to check the quality of the fit.
some of them global, some of them limited to given rings.

10 changes: 5 additions & 5 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ Bug-fix release with:
- Implementation in Python, Cython and OpenCL with poissonian and azimuthal error-model
- Sparsification, compression of single crystal data
- Application to peak-picking and quality assessement of SSX data
- Analysis of grid-scan to find single crystal
- Analysis of grid-scan to find single crystal
- Single pass variance propagation in azimuthal bin
- Integration of the Jungfrau detector (ID29)
* 2D integration:
- New integrators with error propagation by default
- Full pixel splitting in addition to BBox and no splitting
* Refactor of all LUT and CSR to share the same code base, makes tests more robust.
* Refactor of all LUT and CSR to share the same code base, makes tests more robust.
* Calibration of experimental setup using Jupyter notebooks
- User interaction with plots in matplotlib (thanks Phil Hans)
- Factorize code between `pyFAI-calib` and jupyter calibration
- Tutorial as notebook and video recording
- Tutorial as notebook and video recording
* Parallax correction for thick detector (still experimental, thanks to Vadim)
* Improved tutorial on detector geometry calibration (based on Kabsch alignment)
* Better performances on HPC nodes by limiting simple OpenMP to fewer cores
Expand All @@ -63,8 +63,8 @@ Bug-fix release with:
-----------------
* One year of development, about 500 commits & 370 files modified.
* Generalization of the new generation 1D integrators (better error propagation)
* Sigma clipping and sparsification of single crystal data (OpenCL only)
* Fix issue introduced with the scipy 1.15 (constrained calibration broken)
* Sigma clipping and sparsification of single crystal data (OpenCL only)
* Fix issue introduced with the scipy 1.15 (constrained calibration broken)
* Improved distortion correction (also on GPU, ...)
* Major re-work of the documentation (thanks Thomas Kluyver and Loic Huder)
* Improve the calibration of Pilatus and Eiger detectors based on a grid of holes.
Expand Down
6 changes: 3 additions & 3 deletions doc/source/design/ai.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Two types of rebinning engines exists:
Histograms loop over each individual pixel from the image, calculate the bin index and transfer the signal to the destination bin.
This family of algorithms is rather easy to implement and provides good single threaded performances,
but they are hard to parallelize (efficiently) due to the need of atomic operations for writing in the destination bin.
Note that several histograms are always needed, at least one for the signal and one for the count, plus one for the normalization factor and possibly one for the variance propagation.
Note that several histograms are always needed, at least one for the signal and one for the count, plus one for the normalization factor and possibly one for the variance propagation.

- Sparse matrix multiplication

Expand All @@ -140,13 +140,13 @@ Three levels of pixel splitting schemes are available within pyFAI:
- No splitting

The whole intensity is assigned to the center of the pixel and
rebinned using a simple histogram.
rebinned using a simple histogram.
Each pixel contributes to a single bin.

- Bounding box pixel splitting

The pixel is abstracted by a box surrounding it with, making calculation
easier but blurring a bit the image. Each pixel contributes to multiple bins.
easier but blurring a bit the image. Each pixel contributes to multiple bins.

- Tight pixel splitting

Expand Down
8 changes: 4 additions & 4 deletions doc/source/design/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ I would describe it as a stack of 5 layers, upper ones relying on lower ones:

5. Graphical user interfaced application: ``pyFAI-calib2``, ``diff_map``, ...

4. Command-line scripts: ``pyFAI-average``, ``pyFAI-benchmark``, ...
4. Command-line scripts: ``pyFAI-average``, ``pyFAI-benchmark``, ...

3. Top level objects: ``AzimuthalIntegrator``, ``Distortion``, ...

Expand All @@ -24,12 +24,12 @@ I would describe it as a stack of 5 layers, upper ones relying on lower ones:

0. Common basement: Python, Numpy, Cython, PyOpenCL and silx

At level 5. are easy-to use applications, requiring no specific computing knowledge.
Levels 3. and 2. are heavily described in tutorials and should be accesible to
At level 5. are easy-to use applications, requiring no specific computing knowledge.
Levels 3. and 2. are heavily described in tutorials and should be accesible to
any Pythonistas. We try to keep the API on those levels consistent between versions.
Level 1. is often written in Cython, or OpenCL and requires low-level expertise.

Of course mastering level 1. provides faster analysis, but it is not of general use.
Of course mastering level 1. provides faster analysis, but it is not of general use.

.. toctree::
:maxdepth: 2
Expand Down
1 change: 0 additions & 1 deletion doc/source/detector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,3 @@ you understanding the underlying mechanism:
* **Distortion** which explains how to correct images for geometric distortion
* **CCD-calibration** which explains how to calibrate such detectors for geometric
distortion.

6 changes: 2 additions & 4 deletions doc/source/ecosystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Program using pyFAI as a library
--------------------------------

`Github keeps track of dependant projects <https://github.com/silx-kit/pyFAI/network/dependents>`_ and 60 open source projects are
explicitely dependant on pyFAI.
Those include data analysis in most synchrotrons in the world (NSLS-II, APS ...) but also on Free electron laser facilities and in electron microscopy.
explicitely dependant on pyFAI.
Those include data analysis in most synchrotrons in the world (NSLS-II, APS ...) but also on Free electron laser facilities and in electron microscopy.
Here is a list of friendly projects which developpers contributed back to pyFAI:


Expand Down Expand Up @@ -184,5 +184,3 @@ graphics for plotting data and it incorporates a number of powerful
packages for integrating 2D powder diffraction images, analyzing the
curves to obtain PDFs and then tools for assessing the data and modeling
it. It is available from `diffpy.org <http://diffpy.org>`_.


10 changes: 5 additions & 5 deletions doc/source/geometry.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ \section{Geometry definition of \texttt{pyFAI}}
by six variables, collectively called the PONI, for point of normal
incidence. In addition, a detector calibration is provided in the
PONI-file to convert pixel coordinates into real-space coordinates. In
the simplest case this is a pixel size.
the simplest case this is a pixel size.

\texttt{pyFAI} uses a coordinate system where the first axis (1) is
\texttt{pyFAI} uses a coordinate system where the first axis (1) is
vertically up (or $y$), the second axis (2) is horizontal ($x$) towards the ring
center (starboard), and the third axis (3) along the beam $z$. Note that
in this order (1,2,3) is a right-handed coordinate system, which makes
Expand Down Expand Up @@ -55,7 +55,7 @@ \section{Geometry definition of \texttt{pyFAI}}
\begin{bmatrix}
\cos(\theta_3) & -\sin(\theta_3) & 0\\
\sin(\theta_3) & \cos(\theta_3) & 0\\
0 & 0 & 1
0 & 0 & 1
\end{bmatrix}
\\
R(\theta_1, \theta_2, \theta_3)
Expand Down Expand Up @@ -143,7 +143,7 @@ \section{Geometry definition of \texttt{pyFAI}}
\end{bmatrix}
& =
\begin{bmatrix}
A_1 \\ A_2 \\ A_3
A_1 \\ A_2 \\ A_3
\end{bmatrix}
+ \alpha
\begin{bmatrix}
Expand Down Expand Up @@ -209,7 +209,7 @@ \section{Geometry definition of \texttt{ImageD11}}
arranged on the detector. If, e.g., the detector is rotated by
$90^{\circ}$, then $O=\begin{bmatrix} 0 & 1 \\ -1 &
0\end{bmatrix}$. If left and right (or up and down) are inverted on the
detector, then $o_{22} = -1$ ($o_{11}=-1$).
detector, then $o_{22} = -1$ ($o_{11}=-1$).
\end{itemize}

It appears that these conventions where defined under the assumption
Expand Down
Loading

0 comments on commit 71fff47

Please sign in to comment.