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

Fixes infinite values in SNR #1328

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.9
1.10.10
4 changes: 4 additions & 0 deletions caiman/source_extraction/cnmf/estimates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,10 @@ def evaluate_components(self, imgs, params, dview=None):
logging.warning('NaN values detected for trace SNR in {}'.format(np.where(np.isnan(SNR_comp))[0]) +
'. Changing their value to 0.')
SNR_comp = np.where(np.isnan(SNR_comp), 0, SNR_comp)
if np.any(np.isinf(SNR_comp)):
logging.warning('inf values detected for trace SNR in {}'.format(np.where(np.isinf(SNR_comp))[0]) +
Copy link
Member

Choose a reason for hiding this comment

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

Using f-strings might be a slightly nicer way to write this

'. Changing their value to 0.')
SNR_comp = np.where(np.isinf(SNR_comp), 0, SNR_comp)
self.SNR_comp = SNR_comp
self.r_values = r_values
self.cnn_preds = cnn_preds
Expand Down
Loading