mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
209 stars 122 forks source link

Investigate unit test for `PDCalibration` using peak windows #36170

Open rboston628 opened 12 months ago

rboston628 commented 12 months ago

Describe the outcome that is desired.

When using PDCalibration with peak windows, implement a test to make sure the windows are being sorted along with the peak centers.

Describe any solutions you are considering

Use CreateSampleWorkspace to make sample data with several peaks (>=3) at known locations. Create a vector of peak centers near these locations, but deliberately out of ascending order. Associated with each, use peak windows deliberately chosen so the windows are smaller than half the distance between peaks. By some means, ensure that

  1. the peaks and peak windows are internally sorted by increasing peak center in d-space
  2. the peak windows given to PDCalibration are the peak windows used by the internal FitPeaks call. Possibly writing a unit test to read the logger? Or create a new get method to expose peak centers and windows.

Additional context Related to Issue #36122 . This test will hedge out that bug being reintroduced. Related to PR #36158. That PR fixed the issue, but did not include tests.

sf1919 commented 8 months ago

Is this one now complete?