FLASH PR Refactor How Fits Files are Loaded to Remove String Formatting #2462
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
FLASH PR
Description
Change implementation of how
.fits
files are read into the live viewer (mantidimaging/gui/windows/live_viewer/presenter.py:112
).Using
__str__()
, which is a special method directly which is normally used bystr()
does not respect the encapsulation of the object's implementation and can be less explicit. This in turn means using__str__()
could be considered less Pythonic. This PR removes the use of__str__()
as string formatting is not necessary.As
load_image()
states that annp.ndarray
should be returned, I have also assignedimage_data
to an empty array (np.array([])
) to cover the case where neither a.tif
,.tiff
or.fits
file is in the suffix of the path used as an argument toload_image()
to resolve'image_data' before assignment - Pylint
whereimage_data
was not previously assigned if neither case was met.Testing
Describe the tests that you were used to verify your changes.
scripts/simulate_live_data.py
) with.fits
files.Acceptance Criteria
Acceptance criteria for reviewer to tick off in order to verify your changes.
.fits
files can correctly be loaded and read by live viewer.fits
still works as it did on mainscripts/simulate_live_data.py
script that the live viewer loads in.fits
files as they arrive in a selected folderDocumentation
How have you changed the documentation to reflect your changes? All changes should be noted in the appropriate file in docs/release_notes
N/A not needed.