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 : Transfer of material properties does not appear to work. #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stewartboogert
Copy link
Member

Transfer of material properties does not appear to work. Quick fix, but might not be general

@stewartboogert stewartboogert force-pushed the materialPropertyTransfer branch 4 times, most recently from 040e927 to 0cc79fa Compare December 20, 2023 19:57
Copy link

codecov bot commented Jan 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.12%. Comparing base (cf097c1) to head (735a8ee).

Files with missing lines Patch % Lines
src/pyg4ometry/geant4/Registry.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   74.12%   74.12%   -0.01%     
==========================================
  Files         157      157              
  Lines       22735    22736       +1     
==========================================
  Hits        16853    16853              
- Misses       5882     5883       +1     

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

@lnevay
Copy link
Contributor

lnevay commented Jan 16, 2024

So a similar line of code is on line 170 just above. If the one you propose should be changed, then so should this...

@lnevay
Copy link
Contributor

lnevay commented Jan 16, 2024

More generally, we have two functions "transferDefine" and "transferDefines". We've written that the second should do it recursively. So the second works on Defines.VectorBase, Defines.ScalarBase and Defines.Matrix.

Looking through pyg4ometry/gdml/Defines.py this should cover everything... APART from the Auxiliary class.

Therefore, I would say that what should actually happen is not this change but we add something to "transferDefines" that handles the pyg4ometry.gdml.Defines.Auxiliary class.

Conceptually, "transferDefines" should handle any define type.

Screenshot 2024-01-16 at 09 03 11

Copy link
Contributor

@lnevay lnevay left a comment

Choose a reason for hiding this comment

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

See comments.

@stewartboogert
Copy link
Member Author

As suspected I didn't really understand the subtle aspects of this. The problem I encountered was with the transfer of optical properties, not Auxiliary. This PR fixed that problem, but likely not to be correct. I'll make an issue showing the problem and maybe you can implement the general fix.

Let's leave this PR open for reference.

@stewartboogert stewartboogert force-pushed the materialPropertyTransfer branch 2 times, most recently from f639065 to 7dcd054 Compare March 13, 2024 23:59
@stewartboogert stewartboogert force-pushed the materialPropertyTransfer branch 4 times, most recently from 7d6221e to df7e82d Compare August 6, 2024 20:27
@stewartboogert stewartboogert force-pushed the materialPropertyTransfer branch 2 times, most recently from 7f3b918 to 1336a70 Compare September 25, 2024 13:07
@stewartboogert stewartboogert force-pushed the materialPropertyTransfer branch 3 times, most recently from 7529e10 to 238b6f7 Compare October 27, 2024 20:20
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.

2 participants