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

Make analysis reduction a Mantid algorithm #128

Merged
merged 25 commits into from
Aug 22, 2024

Commits on Jul 29, 2024

  1. Change unit test to avoid mocking

    The unit test that existed before used a mock of mantid
    and of a table workspace to test. It is better practice to
    avoid mocking when possible, and this way the internal implementation
    of the unit test can change whilst maintaining the validity of
    the test.
    GuiMacielPereira committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    91c876e View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Create new folder for transitioning into oop

    Started work to make analysis routine into an object.
    Created folder to keep my work organised.
    GuiMacielPereira committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    066767c View commit details
    Browse the repository at this point in the history
  2. Change most functions to be contained in object

    Most of the work consisted in including 'self' in functions and
    replace the previous 'ic' methods with 'self' methods
    GuiMacielPereira committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    a945aa8 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Fix first part of routine

    The first part of the routine up until the MS and Gamma corrections
    is now working, have not tested it yet.
    GuiMacielPereira committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    b6291d0 View commit details
    Browse the repository at this point in the history
  2. Fix remaining of routine

    Fixed second part of routine to use analysis object.
    Currently running in its entirety but have not checked tests
    GuiMacielPereira committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    3927498 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Fix system tests to run new analysis

    Added a system test for the new AnalysisReduction object.
    All system tests are passing. The system tests have a coverage of
    95% of analysis_reduction.py and are very stringent, so it is
    fairly safe to say that this transition to OOP has not introduced
    any new bugs.
    GuiMacielPereira committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    9ab2044 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Clean the fitting of profiles

    Instead of fit the workspace in one go, and then create a
    table and the final workspaces, it makes more sense to populate the
    table and the final worksapaces row by row as the spectra are being
    fit row by row.
    GuiMacielPereira committed Aug 2, 2024
    Configuration menu
    Copy the full SHA
    a4e2fa8 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2024

  1. Cleaned fit of ncps to use object methods

    - Renamed functions
    - Changed functions to use self._row_being_fit instead
    of using the row as a function argument
    - Deleted functions made redundant due to previous commit
    GuiMacielPereira committed Aug 5, 2024
    Configuration menu
    Copy the full SHA
    d58bee7 View commit details
    Browse the repository at this point in the history
  2. Clean masking of columns in input workspace

    When the input workspace contains columns of zeros,
    these should be replaced by the fitted profile before
    doing the multiple scattering and gamma correction.
    GuiMacielPereira committed Aug 5, 2024
    Configuration menu
    Copy the full SHA
    fa66910 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e0f79d7 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2024

  1. Clean calculation of means and corrections

    Made it easier to read and understand what the routine
    is doing when calculating the mean widths and intensity ratios.
    Put the multiple scattering and gamma corrections into its
    own function.
    GuiMacielPereira committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    f2b0f87 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    35bf3db View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. Replace previous routine with new one

    This work changes analysis_routines.py to be the "glue" between
    current interface and new oop interface.
    
    The idea is to keep the current interface for now and focus on
    turning the analysis rouinte into a Mantid algorithm.
    
    The analysis system tests were changed to account for this re-routing.
    GuiMacielPereira committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    ba625de View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2024

  1. Rewrite routine to link two analysis routines

    Rewrote routine for chaining two analysis routines together,
    known as the 'JOINT' procedure.
    This means that the resulting means and intensities from one
    analysis routine, usually backscattering, are used as the starting
    guesses for forward routine, and all widths except the lightest
    element (usually Hydrogen) are fixed.
    
    New procedure using the AnalysisReduction object is easier to read and less prone to bugs.
    
    Also checked that figures and result files are saved at correct
    location.
    GuiMacielPereira committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    aab0f15 View commit details
    Browse the repository at this point in the history
  2. Removed system test that was testing old interface

    The new AanalysisReduction class is already being tested by
    test_analysis.py so the removed test was redundant.
    GuiMacielPereira committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    7f9f2a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

  1. Clean procedure to estimate H ratio

    Updated procedure to estimate H ratio to use new object of
    AnalysisReduction. The ratio is set to always be in relation to
    the lowest mass in the sample.
    GuiMacielPereira committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    6a66e5b View commit details
    Browse the repository at this point in the history
  2. Add constraints

    I added two functions to handle constraints with the new OOP
    interface, but promptly forgot that they are not necessary in
    the current interface as it is, so I commented them out for now,
    to be used in the future when the shift towards using the new
    interface happens
    GuiMacielPereira committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    ea4498f View commit details
    Browse the repository at this point in the history
  3. Tidy some small parts of the code

    Made imports clearer, deleted useless comments and organized some
    sections into separate functions.
    GuiMacielPereira committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    1b9ba3a View commit details
    Browse the repository at this point in the history
  4. Delete old files and rename new ones

    This commit finalizes the transition between the previous
    analysis routine using only functions and the new one using an
    object to run the routine. All of the intermediate files have
    been deleted and final routine was renamed to the existing
    analysis_reduction.py
    GuiMacielPereira committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    d4614d0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    959110a View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2024

  1. Separate imports by groups

    Separated import statements by three groups of standard library,
    external imports and mvesuvio package imports
    GuiMacielPereira committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    457198e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0a2488 View commit details
    Browse the repository at this point in the history
  3. Fix assertion and rename variables

    Implemented review suggestions
    GuiMacielPereira committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    3caecae View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

  1. Uncomment unused functions

    Uncomment functions to use in the future
    GuiMacielPereira committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    68abc66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f10fbf3 View commit details
    Browse the repository at this point in the history