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

Zarr conversion to int warning #115

Merged
merged 1 commit into from
Nov 18, 2024
Merged

Zarr conversion to int warning #115

merged 1 commit into from
Nov 18, 2024

Conversation

briangow
Copy link
Collaborator

As mentioned in: #114 when trying to convert a nan to an int a RuntimeWarning: invalid value encountered in cast warning is given.

This line is setting a default int value (-32768) for NaNs but was previously trying to do the conversion to an int prior to
changing the NaNs to the default value:

np.where(np.isnan(chunk['samples']), nanval, np.round(chunk['samples'] * chunk['gain']).astype(np.int16))

This PR updates the code to finish the conversion to the default value prior to converting to an int which avoids the warning message.

@briangow briangow requested a review from del42 November 15, 2024 20:26
@del42
Copy link
Member

del42 commented Nov 18, 2024

@briangow please merge! Thank you.

@briangow briangow merged commit 5d765ca into main Nov 18, 2024
1 of 2 checks passed
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.

2 participants