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

add display Q-beam angle in view and presenter #45

Open
wants to merge 18 commits into
base: next
Choose a base branch
from

Conversation

KyleQianliMa
Copy link
Collaborator

@KyleQianliMa KyleQianliMa commented Feb 19, 2025

Short description of the changes:

Implement the gui component and MVP connection of the Q-beam angle in view and presenter.
Implement unit tests.

EWM 9409

Long description of the changes:

Check list for the pull request

  • I have read the [CONTRIBUTING]
  • I have read the [CODE_OF_CONDUCT]
  • I have added tests for my changes
  • I have updated the documentation accordingly

Check list for the reviewer

  • I have read the [CONTRIBUTING]
  • I have verified the proposed changes
  • best software practices
    • all internal functions have an underbar, as is python standard
    • clearly named variables (better to be verbose in variable names)
    • code comments explaining the intent of code blocks
  • All the tests are passing
  • The documentation is up to date
  • code comments added when explaining intent

Manual test for the reviewer

References

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.56%. Comparing base (e0e8bea) to head (9383df8).

Additional details and impacted files
@@            Coverage Diff             @@
##             next      #45      +/-   ##
==========================================
+ Coverage   98.53%   98.56%   +0.02%     
==========================================
  Files          10       10              
  Lines         819      835      +16     
==========================================
+ Hits          807      823      +16     
  Misses         12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KyleQianliMa KyleQianliMa changed the title add display options add display Q-beam angle in view and presenter Feb 19, 2025
Base automatically changed from addQbeamang to next February 19, 2025 20:53
@KyleQianliMa KyleQianliMa marked this pull request as ready for review February 20, 2025 19:06
@KyleQianliMa KyleQianliMa marked this pull request as draft February 20, 2025 19:07
@KyleQianliMa KyleQianliMa marked this pull request as ready for review February 21, 2025 20:13
crosshair_widget.modQ_edit.setFocus()
qtbot.keyPress(crosshair_widget.modQ_edit, Qt.Key_Return)

assert crosshair_widget.QZ_angle_edit.text() == "nan"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it is very user friendly to have a Nan value displayed on the view. Also the field is defined to have numerical values as valid ones and is not valid.
Can we add a red border and/or replace the NaN to either empty or similar?

self.powder_mode_switch_callback = None
self.sc_mode_switch_callback = None

# callback functions defined by the presenter
self.fields_callback = None
self.powder_mode_switch_callback = None
self.sc_mode_switch_callback = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

lines 42-35 are duplicated with lines 46-48.
It seems like some rebase/merge conflicts were not resolved properly.
I would suggest checking other files for duplicated code, too.

@@ -143,3 +151,4 @@ def handle_switch_to_sc(self):
# if the view contains an invalid value it is overwritten
saved_values = self.model.get_single_crystal_data()
self.view.sc_widget.set_values(saved_values)
self.handle_QZ_angle()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the label updated at different times than the rest crosshair values?
from what I see they are updated at the same time in the presenter.
They don't need to be a separate flow, they can be part of the same flow (functions), e.g crosshair_widget.set_values

@mpatrou
Copy link
Collaborator

mpatrou commented Feb 25, 2025

documentation classes, module and workflow graphs would need to be updated with this new addition, too.

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