Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AlignDetectors algorithm #37799

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

Remove AlignDetectors algorithm #37799

wants to merge 21 commits into from

Conversation

sf1919
Copy link
Contributor

@sf1919 sf1919 commented Aug 14, 2024

Description of work

Removal of AlignDetectors Algorithm as this has been replaced with ConvertUnits.

Summary of work

Part of #31258

Further detail of work

Deprecated in 2021 - see #30163

To test:


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@sf1919 sf1919 added the Framework Issues and pull requests related to components in the Framework label Aug 14, 2024
@sf1919 sf1919 added this to the Release 6.11 milestone Aug 14, 2024
@sf1919
Copy link
Contributor Author

sf1919 commented Aug 14, 2024

@RichardWaiteSTFC can you examine the commits c3b9e0d and b25ac52 please? I'm not sure if I've made quite the right adjustments in the documentation on these.

:math:`TZERO` is related to the difference between the measured and
actual time-of-flight base on emission time from the moderator, :math:`DIFA` is an empirical term (ideally zero), and :math:`DIFC` is

.. math:: DIFC = \frac{2m_N}{h} L_{tot} sin \theta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this info should actually live in unit factory docs
https://docs.mantidproject.org/nightly/concepts/UnitFactory.html#unit-factory
or in the ConvertUnits docs.
This algorithm is no longer used (it pre-dates my work on engineering GUI) - also the name suggest something engineering specific whereas this relates to TOF powder diffraction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ConvertUnits actually use DIFC? I can't see an obvious place to put it in the documentation.

Copy link
Contributor

@RichardWaiteSTFC RichardWaiteSTFC Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does yes, it uses the UnitParams map in the conversions - I think the logic is in Unit.cpp - by default DIFA=TZERO=0 and DIFC is calculated using L1+L2 and sin(theta)

@@ -43,7 +43,7 @@ When not specified using the ``MaskWorkspace`` parameter, the default name for t

The resulting calibration table can be saved with
:ref:`algm-SaveDiffCal`, loaded with :ref:`algm-LoadDiffCal` and
applied to a workspace with :ref:`algm-AlignDetectors`. There are also
applied to a workspace with :ref:`algm-ConvertUnits`. There are also
Copy link
Contributor

@RichardWaiteSTFC RichardWaiteSTFC Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also mention ApplyDiffCal - which actually uses the calibration table and updates the diffractometer constants in the UnitParams map of the workspace which is then used in ConvertUnits

@sf1919
Copy link
Contributor Author

sf1919 commented Aug 22, 2024

Currently blocked by #37859

@sf1919 sf1919 added Diffraction Issues and pull requests related to diffraction ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS Extra Attention Testers and Gate keepers should pay extra attention as this affects core aspects. labels Aug 23, 2024
@sf1919
Copy link
Contributor Author

sf1919 commented Sep 3, 2024

Some workflow diagrams refer to AlignDetectors algorithm. However these appear to be generally out of date and so separate issues have been raised to deal with these (see #37905 and #37907)

@sf1919 sf1919 force-pushed the 31258_aligndetectors branch from 3eaf334 to 34d3769 Compare September 10, 2024 07:20
@sf1919 sf1919 modified the milestones: Release 6.11, Release 6.12 Sep 10, 2024
@sf1919
Copy link
Contributor Author

sf1919 commented Sep 10, 2024

I'm moving this to 6.12 as there are some issues that I think need to be fixed separately before this one can continue. I'll write up the relevant issues.

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

👋 Hi, @sf1919,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

- Remove head and main files
- Remove references from CMake
- Remove test and reference from CMake
- Removed the User documentation of the algorithm
- Removed links from previous release notes
- Removed references to the AlignDetectors Algorithm as an example in documentation
- Where possible remove or convert reference to AlignDetectors to ConvertUnits
- For some algorithm documentation there are references made to the GSAS equations in AlignDetectors. This commit moves that information into the relevant documentation to enable the references to AlignDetectorsto be removed.
- The GSAS equation information would be best situated in the Unit Factory concept documentation. This commit makes that change and updates references to this concept documentation instead.
- Remove references to AlignDetectors from CalFile and PowderDiffractionCalibration.
- Replace references where necessary with suitable alternatives
- DiffractionFocussing2 made reference to using AlignDetectors. This has been changed to ConvertUnits
- The associated test used AlignDetectors. This has been changed to ConvertUnits and variables renamed accordingly
- Updated DiffractionFocussing2 documentation
- ConvertUnits is not a direct swap with AlignDetectors. Instead a combination of ApplyDIffCal and ConvertUnits is needed. This makes that fix,
Remove links from other algorithms for AlignDetectors under the 'see also' section
- Remove AlignDetectors and replace with ApplyDiffCal and COnvertUnits algorithms
- Replaced with ApplyDiffCal and ConvertUnits algorithms
- ApplyDiffCal does not take an InputWorkspace. Instead it takes an InstrumentWorkspace.
- Removed link to alignDetectors from See Also in SaveGDA
- Removed reference from explanation of OffsetsWorkspace
@sf1919 sf1919 force-pushed the 31258_aligndetectors branch from c1ca028 to 470e13f Compare December 10, 2024 16:37
@github-actions github-actions bot removed the Has Conflicts Used by the bot to label pull requests that have conflicts label Dec 10, 2024
@sf1919 sf1919 modified the milestones: Release 6.12, Release 6.13 Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Diffraction Issues and pull requests related to diffraction Extra Attention Testers and Gate keepers should pay extra attention as this affects core aspects. Framework Issues and pull requests related to components in the Framework ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants