pyFAI
pyFAI copied to clipboard
Simplification of the geometry calculation
Simplify pyFAI.geometry.core line 763
There is one test failing with array of unconsistent size -> investigate.
test pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_radial is failing
======================================================================
ERROR: test_radial (pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_radial)
Non regression for #1602
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_azimuthal_integrator.py", line 276, in test_radial
res = self.ai.integrate_radial(self.data, npt=360, npt_rad=10,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 1646, in integrate_radial
res = self.integrate2d_ng(data, npt_rad, npt,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 2287, in integrate2d_ng
cython_integr = self.setup_sparse_integrator(shape, npt, mask,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 402, in setup_sparse_integrator
dpos0 = self.array_from_unit(shape, "delta", unit0, scale=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/geometry/core.py", line 1067, in array_from_unit
out = Geometry.__dict__[meth_name](self, shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/geometry/core.py", line 978, in delta2Theta
return self.delta_array(shape, units.TTH, False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/geometry/core.py", line 963, in delta_array
delta = abs(corners[..., 0] - numpy.atleast_3d(center))
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
ValueError: operands could not be broadcast together with shapes (1025,2048,4) (1024,2048,1)
======================================================================
FAIL: test_cythonSP_vs_fit2d (pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_cythonSP_vs_fit2d)
Compare cython splitPixel with results of fit2d
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_azimuthal_integrator.py", line 186, in test_cythonSP_vs_fit2d
tth, I = self.ai.integrate1d_ng(self.data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 1518, in integrate1d_ng
intpl = integr(weights=data, variance=variance,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "splitPixel.pyx", line 298, in pyFAI.ext.splitPixel.fullSplit1D_engine
AssertionError: pos.shape[0] == size
======================================================================
FAIL: test_cython_vs_numpy (pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_cython_vs_numpy)
Compare cython histogram with numpy histogram
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_azimuthal_integrator.py", line 224, in test_cython_vs_numpy
tth_sp, I_sp = self.ai.integrate1d_ng(self.__class__.data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 1518, in integrate1d_ng
intpl = integr(weights=data, variance=variance,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "splitPixel.pyx", line 298, in pyFAI.ext.splitPixel.fullSplit1D_engine
AssertionError: pos.shape[0] == size
======================================================================
FAIL: test_separate (pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_separate)
test separate with a mask. issue #209 regression test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_azimuthal_integrator.py", line 250, in test_separate
res = self.ai.separate(self.data, mask=msk)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 3360, in separate
filter_result = self.medfilt1d(data, npt_rad=npt_rad, npt_azim=npt_azim,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 2818, in medfilt1d
res2d = self.integrate2d(data, npt_rad, npt_azim, mask=mask,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/azimuthalIntegrator.py", line 2419, in integrate2d_ng
intpl = integrator(pos=pos,
^^^^^^^^^^^^^^^^^^^
File "splitPixel.pyx", line 1192, in pyFAI.ext.splitPixel.fullSplit2D_engine
AssertionError: pos.shape[0] == size
======================================================================
FAIL: test_integrate2d (pyFAI.test.test_multi_geometry.TestMultiGeometry.test_integrate2d)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_multi_geometry.py", line 139, in test_integrate2d
self.assertTrue(delta.max() < 0.007, "pixel intensity is the same (for populated pixels) delta=%s" % delta.max())
AssertionError: False is not true : pixel intensity is the same (for populated pixels) delta=0.007278070616408172
Stderr:
WARNING:pyFAI.test.test_multi_geometry:TestMultiGeometry.test_integrate2d gave difference of intensity: 0.007278070616408172, count: 0.00018968492728177466 cum: 0.02340690511414323
======================================================================
FAIL: test (pyFAI.test.test_error_model.TestErrorModel.test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/users/kieffer/workspace-400/pyFAI/build/lib/python3.11/site-packages/pyFAI/test/test_error_model.py", line 123, in test
self.assertGreaterEqual(cormap(ref.__getattribute__(array), res.__getattribute__(array)), epsilon, f"array {array} matches for {k} vs numpy")
AssertionError: 0.31476718942382115 not greater than or equal to 0.5 : array sum_normalization matches for ('poisson', 'opencl', 'integrate') vs numpy
Stderr:
WARNING:pyFAI.azimuthalIntegrator:Method requested '('full', 'csr', 'opencl')' not available. Method 'IntegrationMethod(1d int, full split, CSR, cython)' will be used
WARNING:pyFAI.azimuthalIntegrator:Method requested '('full', 'csr', 'opencl')' not available. Method 'IntegrationMethod(1d int, full split, CSR, cython)' will be used
ERROR:pyFAI.test.test_error_model:(poisson, opencl, 'clip') ended in RuntimeError: probably not implemented: Not yet implemented. Sorry
WARNING:pyFAI.azimuthalIntegrator:Method requested '('full', 'csr', 'opencl')' not available. Method 'IntegrationMethod(1d int, full split, CSR, cython)' will be used
WARNING:pyFAI.azimuthalIntegrator:Method requested '('full', 'csr', 'opencl')' not available. Method 'IntegrationMethod(1d int, full split, CSR, cython)' will be used
ERROR:pyFAI.test.test_error_model:(azimuthal, opencl, 'clip') ended in RuntimeError: probably not implemented: Not yet implemented. Sorry
======================================================================
SKIPPED: runTest (pyFAI.gui.test.SkipGuiTest.runTest)
----------------------------------------------------------------------
pyFAI.gui tests disabled (Skipped by command line)
======================================================================
SKIPPED: test_medfilt1d (pyFAI.test.test_azimuthal_integrator.TestAzimHalfFrelon.test_medfilt1d)
SKIPPED: test_mask_CSR_OCL (pyFAI.test.test_mask.TestMask.test_mask_CSR_OCL)
The masked image has a masked ring around 1.5deg with value -10
SKIPPED: test_mask_LUT_OCL (pyFAI.test.test_mask.TestMask.test_mask_LUT_OCL)
The masked image has a masked ring around 1.5deg with value -10
SKIPPED: test_mask_LUT_OCL (pyFAI.test.test_mask.TestMaskBeamstop.test_mask_LUT_OCL)
With a mask with and without limits
SKIPPED: test_nomask_LUT_OCL (pyFAI.test.test_mask.TestMaskBeamstop.test_nomask_LUT_OCL)
without mask, tth value should start at 0
SKIPPED: test_opencl (pyFAI.test.test_preproc.TestPreproc.test_opencl)
----------------------------------------------------------------------
User request to skip OpenCL tests
======================================================================
SKIPPED: test_histo (pyFAI.test.test_azimuthal_integrator.TestIntergrationNextGeneration.test_histo)
----------------------------------------------------------------------
Skipping TestIntergrationNextGeneration.test_histo as OpenCL method not available
======================================================================
SKIPPED: test_hexagonal_detector (pyFAI.test.test_detector.TestDetector.test_hexagonal_detector)
----------------------------------------------------------------------
SplitPixel does not work (yet) with hexagonal pixels: pos.shape[0] == size
======================================================================
SKIPPED: test_sparse_fullsplit (pyFAI.test.test_sparse.TestSparseIntegrate2d.test_sparse_fullsplit)
SKIPPED: test_sparse_nosplit (pyFAI.test.test_sparse.TestSparseIntegrate2d.test_sparse_nosplit)
----------------------------------------------------------------------
Fix this test
======================================================================
SKIPPED: test_opencl_csr (pyFAI.test.test_csr.TestCSR.test_opencl_csr)
----------------------------------------------------------------------
Test on OpenCL disabled
----------------------------------------------------------------------
Ran 389 tests in 122.306s
FAILED (failures=5, errors=1, skipped=12)