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

Added Type checking to the liveviewer and recon #2252

Merged
merged 8 commits into from
Jul 24, 2024

Conversation

ashmeigh
Copy link
Collaborator

@ashmeigh ashmeigh commented Jul 3, 2024

Description

Added type annotations to various files within the mantidimaging/gui/windows directory to enhance type safety and improve code maintainability. These annotations ensure clearer function signatures and better compatibility with Python type checkers like mypy.

Testing

Type annotations do not introduce runtime errors.
Functionality across affected modules remains intact.
All affected code paths are adequately covered by existing unit tests.

Acceptance Criteria

No linting errors related to type annotations.
No type-related runtime errors occur during testing.
All affected code paths are adequately covered by existing tests.

@ashmeigh ashmeigh requested a review from samtygier-stfc July 3, 2024 20:50
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.

The tests are failing with the following ruff errors

mantidimaging/gui/windows/recon/model.py:140:93: F821 Undefined name `ReconstructedObject`
mantidimaging/gui/windows/recon/point_table_model.py:6:25: F401 `typing.Optional` imported but unused
mantidimaging/gui/windows/recon/point_table_model.py:6:35: F401 `typing.Union` imported but unused

@coveralls
Copy link

coveralls commented Jul 16, 2024

Coverage Status

coverage: 73.107% (-0.04%) from 73.144%
when pulling 9b7232c on Type_annonations_live_viewer
into 24fbed6 on main.

mantidimaging/gui/windows/recon/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/recon/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/recon/presenter.py Outdated Show resolved Hide resolved
@ashmeigh ashmeigh requested a review from samtygier-stfc July 16, 2024 14:49
mantidimaging/gui/windows/recon/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/recon/model.py Outdated Show resolved Hide resolved
mantidimaging/gui/windows/recon/presenter.py Outdated Show resolved Hide resolved
@ashmeigh ashmeigh requested a review from samtygier-stfc July 23, 2024 07:25
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.

Look good. Mypy and tests pass.

I added a small commit to remove the ignores

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Jul 24, 2024
Merged via the queue into main with commit 621d5cf Jul 24, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the Type_annonations_live_viewer branch July 24, 2024 15:33
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.

3 participants