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

Sc tests #21

Merged
merged 8 commits into from
Jan 10, 2025
Merged

Sc tests #21

merged 8 commits into from
Jan 10, 2025

Conversation

KyleQianliMa
Copy link
Collaborator

@KyleQianliMa KyleQianliMa commented Jan 9, 2025

Short description of the changes:

This is a follow up PR for PR #18 that adds unit tests targeting single crystal and powder model.
EWM 8607

It also addresses modQ calcualtions and initialization of HyspecPPTModel class.

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

@KyleQianliMa KyleQianliMa requested a review from mpatrou January 9, 2025 17:52
@@ -0,0 +1,8 @@
import numpy as np # noqa: F401

import hyspecppt.hppt.hppt_model as hppt_model # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

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

better import what you need, for example:
from hyspecppt.hppt.hppt_model import HyspecPPTModel

@@ -0,0 +1,99 @@
import numpy as np

import hyspecppt.hppt.hppt_model as hppt_model
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above for import

@@ -0,0 +1,8 @@
import numpy as np # noqa: F401
Copy link
Collaborator

@mpatrou mpatrou Jan 9, 2025

Choose a reason for hiding this comment

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

lets be consistent on the file names. so far the test filenames are small case separated by underscore.: e.g test_hyspecpptmodel.py

Ei: float = DEFAULT_EXPERIMENT["Ei"]
S2: float = DEFAULT_EXPERIMENT["S2"]
alpha_p: float = DEFAULT_EXPERIMENT["alpha_p"]
plot_type: str = DEFAULT_EXPERIMENT["plot_type"]
cp: CrosshairParameters
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 initialization of the other parameters: CrosshairParameters and SingleCrystalParameters from the experiment_settings happening in another PR?

@AndreiSavici AndreiSavici enabled auto-merge (squash) January 9, 2025 20:21
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.40%. Comparing base (b97f373) to head (81205ed).

Additional details and impacted files
@@            Coverage Diff             @@
##             next      #21      +/-   ##
==========================================
+ Coverage   91.04%   91.40%   +0.35%     
==========================================
  Files          10       10              
  Lines         659      663       +4     
==========================================
+ Hits          600      606       +6     
+ Misses         59       57       -2     

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

@@ -0,0 +1,8 @@
import numpy as np # noqa: F401
Copy link
Collaborator

@mpatrou mpatrou Jan 9, 2025

Choose a reason for hiding this comment

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

it does not look like we need this. it can be omitted.

Copy link
Collaborator

@mpatrou mpatrou left a comment

Choose a reason for hiding this comment

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

It looks good to me!!!

@AndreiSavici AndreiSavici merged commit 620fe26 into next Jan 10, 2025
3 checks passed
@AndreiSavici AndreiSavici deleted the SC-tests branch January 10, 2025 14:47
@KyleQianliMa KyleQianliMa restored the SC-tests branch January 13, 2025 14:38
@KyleQianliMa KyleQianliMa deleted the SC-tests branch January 13, 2025 14:39
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.

4 participants