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

geant4: Adding warning message for divide by units to add properties … #144

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

sealden89
Copy link
Contributor

…to materials.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0a2b1b7) 70.47% compared to head (2c6c771) 70.47%.

Files Patch % Lines
src/pyg4ometry/geant4/_Material.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
- Coverage   70.47%   70.47%   -0.01%     
==========================================
  Files         144      144              
  Lines       21896    21898       +2     
==========================================
+ Hits        15431    15432       +1     
- Misses       6465     6466       +1     

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

@stewartboogert stewartboogert merged commit cf30d6b into g4edge:main Feb 16, 2024
15 checks passed
@ManuelHu
Copy link
Contributor

ManuelHu commented Feb 16, 2024

But why is this check needed in this generality? Units containing a slash (/) are completely normal and can be used in Geant4, so there should be no warning?

Currently your code even advises an user to use 1/unit - even if the user already did pass 1/unit :)

Or did you intend to search for a leading slash, e.g. to warn if one would pass vunit = "/MeV" (which clearly is invalid)? But then the check is wrong, and should be vunit.find("/") == 0.

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