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

Tighten checks on inputs and consolidate code in calc_CosmicDoseRate() #596

Merged
merged 4 commits into from
Mar 5, 2025

Conversation

mcol
Copy link
Contributor

@mcol mcol commented Mar 5, 2025

This fixes #595 and adds some more validation of inputs to cover other corner cases.

The code for the case in which length(depth) == 1 can be removed because after validation it must be that also length(density) == 1: note that the computation done in that block is undone and then recomputed in the second block, as it's also true that length(depth) == length(density). So we may as well just use the code in the second block in both cases.

mcol added 4 commits March 5, 2025 13:30
The code in the two if blocks is effectively the same, as if length(depth) = 1
then it must be that also length(density) = 1, so it's true that both depth and
density have the same length.
@mcol mcol merged commit 726bc65 into master Mar 5, 2025
9 checks passed
@mcol mcol deleted the issue_595 branch March 5, 2025 14:12
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.

crash in calc_CosmicDoseRate() if number depths > number of densities > 1
1 participant