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

Fix/gh 48 export relative paths #49

Merged
merged 8 commits into from
Feb 2, 2025
Merged

Conversation

mbsantiago
Copy link
Owner

This pull request addresses the issue raised by @namitha-sh in #48, where exporting datasets includes full recording paths. This behavior hinders dataset sharing, as paths often need modification for re-import into Whombat. Furthermore, full paths can contain sensitive information that should not be shared.

This PR implements the following changes to export recordings with paths relative to the dataset's audio_dir:

  1. Unit Test: Added a unit test to verify that dataset import and export correctly handle relative paths. The test imports and exports the test dataset, then checks if the exported recording paths are relative to the audio_dir.

  2. Dataset API Enhancements: Created import_dataset and export_dataset methods within the whombat.api.datasets module. These methods encapsulate the logic for dataset import and export operations. Currently, AOEF format is supported, with plans to add support for other formats in the future.

  3. REST API Integration: Updated the import and export REST API routes to utilize the new dataset API methods.

  4. Path Modification: Modified the export functions to remove the audio_dir prefix from recording paths, ensuring they are relative.

All tests are currently passing.

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 66.60%. Comparing base (dd70269) to head (b50408f).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
back/src/whombat/routes/datasets.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
+ Coverage   66.47%   66.60%   +0.12%     
==========================================
  Files         179      179              
  Lines        8367     8372       +5     
==========================================
+ Hits         5562     5576      +14     
+ Misses       2805     2796       -9     

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

@mbsantiago mbsantiago merged commit 75dfd32 into main Feb 2, 2025
6 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.

1 participant