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

Implement soundevent.arrays Module for Enhanced DataArray Workflows #7

Merged
merged 7 commits into from
May 10, 2024

Conversation

mbsantiago
Copy link
Owner

Feature implementation: Arrays module

New array module for better handling of xarray DataArray objects. It is common to have numerical arrays in audio analysis with potentially multiple axes, where each bin has specific coordinates. For example, the raw audio signal can be thought of as a 1-dimensional array with one axis for time, where each bin was taken at a specific time after the start of the recording, and can potentially have another axis for the number of audio channels. Another great example is the spectrogram, where you have a 2-dimensional array; here, each bin corresponds to a particular time and frequency range.

It is much easier to work with these numerical arrays if the dimensions are labelled and there are easy ways of mapping the coordinates into the array bins. Hence soundevent has adopted xarray as a great library to ease working with these numerical arrays. We can take advantage of all of the hard work the geospatial community has been doing for decades working with their own numerical arrays, and repurpose it for audio analysis.

This arrays module adds functions for the standardization of dimension names and attributes, as well as for creation and manipulation of both data arrays and their dimensions.

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 84.80565% with 43 lines in your changes are missing coverage. Please review.

Project coverage is 86.87%. Comparing base (172c0d0) to head (4c1bef5).

Files Patch % Lines
src/soundevent/types.py 0.00% 24 Missing ⚠️
src/soundevent/geometry/positions.py 31.81% 15 Missing ⚠️
src/soundevent/arrays/dimensions.py 97.64% 0 Missing and 2 partials ⚠️
src/soundevent/arrays/operations.py 98.13% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
- Coverage   87.14%   86.87%   -0.27%     
==========================================
  Files         100      106       +6     
  Lines        2885     3154     +269     
  Branches      439      492      +53     
==========================================
+ Hits         2514     2740     +226     
- Misses        282      321      +39     
- Partials       89       93       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mbsantiago mbsantiago merged commit f9a6d1a into main May 10, 2024
5 of 7 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.

None yet

1 participant