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

From Powder to Single Crystal Mode Switch #23

Merged
merged 16 commits into from
Jan 13, 2025
Merged

Conversation

mpatrou
Copy link
Collaborator

@mpatrou mpatrou commented Jan 10, 2025

Short description of the changes:

The code includes mainly changes for switching from powder mode to Single crystal. This is the second part of the switch, so any multiple switching back and forth are captured here and the related tests.

Long description of the changes:

It includes the following:

  • view and presenter changes for single crystal parameters and qmod values
  • custom validators for single crystal angle fields
  • tests for mode switching, and validators
  • code cleanup, improvements to conform with variable naming standards
  • mode get_crosshair small updates

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

Switch from PD and SC mode

@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.30%. Comparing base (620fe26) to head (df0e1d1).

Additional details and impacted files
@@            Coverage Diff             @@
##             next      #23      +/-   ##
==========================================
+ Coverage   91.40%   92.30%   +0.90%     
==========================================
  Files          10       10              
  Lines         663      715      +52     
==========================================
+ Hits          606      660      +54     
+ Misses         57       55       -2     

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


# check the conditions
if angle_sum > 360 or (
alpha_beta_sum < gamma_value or alpha_gamma_sum < beta_value or beta_gamma_sum < alpha_value
Copy link
Member

@AndreiSavici AndreiSavici Jan 10, 2025

Choose a reason for hiding this comment

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

Make everything <= instead of < I get NaN with 90, 45, 45

@AndreiSavici AndreiSavici enabled auto-merge (squash) January 13, 2025 21:01
Copy link
Member

@AndreiSavici AndreiSavici left a comment

Choose a reason for hiding this comment

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

Works as expected

@AndreiSavici AndreiSavici merged commit 908be3d into next Jan 13, 2025
3 checks passed
@AndreiSavici AndreiSavici deleted the pd_sc_mode_switch branch January 13, 2025 21:02
KyleQianliMa pushed a commit that referenced this pull request Jan 14, 2025
* ei value update and passed from view-presenter-model through callback functions

* experiment data update -save and restore- on pwoder switch

* presenter, tests for mode switch, code cleanup, move for visibility, model left out itentionally

* updates after comparing with intermediate model (model still not included)

* selection mode init rewrite, presenter cleaunp

* qmod boundaries view, model

* angle validation added

* max modq rename

* tests updated for modq with 3 decimal places on the view

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* precommit fixes, double function removed, code cleanup

* angles second condition for forming a triangle added

* = added in angle validation triangle conditions

* tests for validators, sc-pd switch, qmod, etc

* switch_to_SC renamed for concistency

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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