Skip to content

Conversation

RasmiaKulan
Copy link
Collaborator

@RasmiaKulan RasmiaKulan commented Aug 13, 2025

Issue Closes #2362

Description

  • Renamed enable_nonpositive_check to enable_value_check and updated the function to do warning checks specific to zero, negative and NaN values.

  • Updated the overlay colors to be user friendly:

    • Zero values

      image image

    • Negative values

      image
    • Invalid values: Not a number

      image
  • Updated the test_negative_nan_overlay test to check against value warning messages.

  • Replaced all the references of enable_nonpositive_check to enable_value_check in the code base.

Developer Testing

  • I have verified unit tests pass locally: python -m unittest -v mantidimaging.eyes_tests.reconstruct_window_test

Acceptance Criteria and Reviewer Testing

  • Unit tests pass locally: python -m pytest -vs
  • Run python -m unittest -v mantidimaging.eyes_tests.reconstruct_window_test and verify all tests pass

Documentation and Additional Notes

  • Screenshot tests have been updated

@JackEAllen
Copy link
Collaborator

This PR introduces changes to the Applitools screenshot tests

@coveralls
Copy link

coveralls commented Aug 15, 2025

Coverage Status

coverage: 70.805% (-0.02%) from 70.829%
when pulling 237776e on 2362-update_operation_window_value_warnings
into 50f905b on main.

Copy link
Collaborator

@JackEAllen JackEAllen left a comment

Choose a reason for hiding this comment

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

Thank you for adding more clarity to the value warnings. The changes look good and are cleanly implemented. I have functionally tested with real data and ran tests locally and all works well. I have left one small suggestion I would like to get your opinion on, but I don't feel too strongly for the suggested change.

@JackEAllen JackEAllen removed their assignment Aug 18, 2025
@JackEAllen JackEAllen marked this pull request as draft August 18, 2025 13:21
@RasmiaKulan RasmiaKulan marked this pull request as ready for review August 19, 2025 12:23
@JackEAllen JackEAllen self-assigned this Aug 20, 2025
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

I've just given this a quick look and have some questions.

  • Is it needed for VALUE_CHECKS to include a nan check? I think all the places that previously used enable_nonpositive_check() also had enable_nan_check(), so that is already being checked.
  • Is the conversion to float needed?
  • Do _is_zero() and _is_negative() need internal nan checks? Those seem redundant, if a value is zero we already know it is not nan.

Also is there any performance hit. I think with the extra conversions and nan checks there might be.

You could do

    def check_for_bad_data(self) -> None:
        with ExecutionTimer(msg="check_for_bad_data()"):
            current_slice = self._get_current_slice()
            if current_slice is not None:
                for test in self.enabled_checks.values():
                    test.do_check(current_slice)

To get the run time of the checks and switch it to ExecutionProfiler to see where the time is spent. (You might need to turn on preformance logging in the settings)

@RasmiaKulan RasmiaKulan marked this pull request as draft August 21, 2025 12:09
@RasmiaKulan RasmiaKulan marked this pull request as ready for review August 21, 2025 14:38
@RasmiaKulan RasmiaKulan moved this to Review in Mantid Imaging Work Aug 22, 2025
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

Working well locally for me. Thanks for the fixes.

@samtygier-stfc samtygier-stfc dismissed JackEAllen’s stale review August 22, 2025 15:43

Requested changes by Jack and I have been made, and I don't think Jack had any further comments. (If there are any those can be resolved when he's back)

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Aug 22, 2025
Merged via the queue into main with commit a6ec859 Aug 22, 2025
9 checks passed
@samtygier-stfc samtygier-stfc deleted the 2362-update_operation_window_value_warnings branch August 22, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operation Window Warnings: Distinguish between Zero, Negative and Nan Values
4 participants