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

13 rfx tallies assume a homogeneous or layered tissue geometry #162

Merged

Conversation

hayakawa16
Copy link
Member

No description provided.

…inhomogeneous tissue and ROfFx detector. Also performed code cleaned up on these two files. Since the ValidationResult.IsValid now returns true, simulation will proceed without interruption. This means that the ValidationRule set to "Warning: R(fx) theory assumes a homogeneous or layered tissue geometry" and the Remarks set to "User discretion advised" are not put to the screen since only results with IsValid=false put out these statements.
…ered-tissue-geometry and resolved conflicts:

#	src/Vts/MonteCarlo/DataStructuresValidation/SimulationInputValidation.cs
…ue and R(fx) detector specification to issue Warning and continue with simulation.
…the code, to issuing a warning and continuing on with the simulation.The philosophy here is that if combination of inputs is non-standard but the transport will not error, a warning is issued and the validation result remains true. This allows users to specify inconsistent combinations, e.g. angled source and cylindrical coordinate detectors, receive a warning and have the simulation proceed. If the combination of inputs will cause the transport to error, e.g. defining an embedded ellipsoid that overlaps with a tissue layer, then the input validation fails and the simulation stopped.
@hayakawa16 hayakawa16 self-assigned this Aug 13, 2024
@hayakawa16 hayakawa16 linked an issue Aug 13, 2024 that may be closed by this pull request
@hayakawa16
Copy link
Member Author

I also did some code cleanup since I was editing these files. So more changes shown than the ones required for this fix.

Copy link
Member

@lmalenfant lmalenfant left a comment

Choose a reason for hiding this comment

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

Both files have an unused using.

@@ -166,24 +171,25 @@ private static ValidationResult ValidateCombinedInputParameters(SimulationInput
{
case true when
ellipsoid.Center.X != 0.0 && ellipsoid.Center.Y != 0.0:
Copy link
Member

Choose a reason for hiding this comment

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

I'm seeing an issue here with the floating point comparison, it suggests using a range:
https://www.jetbrains.com/help/resharper/CompareOfFloatsByEqualityOperator.html

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand jetbrains concern. In this particular case, I truly am comparing with 0.0 though. If it is slightly off, ellipsoid will be off center. Since it is a user input (not determined from code), I would prefer to keep this as is.

return new ValidationResult(
true,
"Warning: off center ellipsoid in tissue with cylindrical detector defined",
"User discretion advised: change ellipsoid center to (0,0) or specify non-cylindrical type tally");
case true when ellipsoid.Dx != ellipsoid.Dy:
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@lmalenfant, thanks for your review. I can work on those.

Copy link
Member Author

Choose a reason for hiding this comment

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

Here I agree (although still user input so shouldn't different), so have modified code.

@lmalenfant
Copy link
Member

@hayakawa16 I didn't request changes because I'm not sure that the 2 issues I mentioned are problematic. I can approve if it is working as expected.

Copy link
Member

@lmalenfant lmalenfant left a comment

Choose a reason for hiding this comment

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

I approved and then realized that the quality gate failed, I'm not sure how we can resolve, or why it didn't fail on the previous build.

@hayakawa16
Copy link
Member Author

I can try to fix on this branch. I'll take a closer look tomorrow. Also, my VS continued to act funny. The Test Explorer window wasn't working correctly until I Task Master closed VS and then opened and reloaded sln. Do you think it is possibly related to my VS problems I had today?

@hayakawa16
Copy link
Member Author

Thanks @lmalenfant! Still working on it though!

Copy link

sonarcloud bot commented Aug 23, 2024

@hayakawa16 hayakawa16 merged commit 79cf8e5 into master Aug 23, 2024
2 checks passed
@hayakawa16 hayakawa16 deleted the 13-rfx-tallies-assume-a-homogeneous-or-layered-tissue-geometry branch August 23, 2024 19:32
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.

R(fx) tallies assume a homogeneous or layered tissue geometry
2 participants