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

scale does not handle all zero arrays properly #564

Open
pavlis opened this issue Sep 19, 2024 · 0 comments
Open

scale does not handle all zero arrays properly #564

pavlis opened this issue Sep 19, 2024 · 0 comments

Comments

@pavlis
Copy link
Collaborator

pavlis commented Sep 19, 2024

In working on the revision to CRN3CDecon I discovered a bug in our scale function. It did not handle the case where all the sample data were machine zeros. It created a divide by zero = inf problem when applied to that case create arrays of inf values.

There is a fix in the branch I'm working on but it will likely not be merged for a while as I have a lot more testing to do with the revisions to the CNR3CDecon module. My fix was to the C++ code to do nothing if the computed amplitude was a machine 0 and then log a complaint. There is a parallel problem with scale_ensemble I handled almost the same way. That is, if the entire ensemble has nothing but zeros it does nothing. The difference is that at the moment there is a small disconnect in elog with "Core" ensembles. The low-level C++ function template was designed for "Core" ensembles. That problem could be fixed, but it seems unnecessary as something is really wrong with someone's workflow if they try to run with ensembles of all 0s where the member objects are marked live.

I created a set of tests for the revisions and they behave as expected. The only issue is that until I merge this branch this minor bug will be in the distribution.

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

No branches or pull requests

1 participant