Skip to content

Fixed setting global numpy settings.

Jordy Gloudemans requested to merge np_div_zero into development

Description

The function _get_acq_data_and_convert potentially does a divide-by-zero using numpy when the average count is zero. This is intended behaviour, but it throws a warning which needs to be suppressed. Currently, that was done by changing the numpy settings globally, which is very undesired. This MR fixes that by making the warning suppression local to the code that does the division.

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Issue(s)

N/A

Related MRs

N/A

Testing

The pipeline does tests where the average count is disabled. If the warning is not properly suppressed it pops-up in the logs.

Notes

Merge checklist

  • Cleaned up code (correct alligment/spacing/code-style, no dead code, etc).
  • Merge request targets development branch.
  • Assigned assignee (you) and reviewers (team-members).
  • Merge request has been reviewed by at least one team-members.
  • All pipelines pass, including manually triggered ones.
Edited by Jordy Gloudemans

Merge request reports