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

Add a parameter augment_copy to the augment_score function #221

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

pstrepetov
Copy link
Contributor

@pstrepetov pstrepetov commented Feb 14, 2025

Hi!

This pull request introduces a new parameter 'augment_copy' to the augment_score function in the data_augmentation module. This enhancement provides users with more control over how the augmentation is applied to the input Score object.

Changes made:

  1. Added a new boolean parameter 'augment_copy' with a default value of True.
  2. Updated the function's docstring to include a description of the new parameter.
  3. Modified the function logic to use the 'augment_copy' parameter when deciding whether to create a copy of the input Score object or modify it in-place.

The 'augment_copy' parameter allows users to choose between two behaviors:

  • When True (default): A copy of the input symusic.Score object is augmented and returned, preserving the original object.
  • When False: The input symusic.Score object is modified in-place, which can be more memory-efficient for large scores.

This change enhances the flexibility of the augment_score function, allowing users to optimize for either safety (by working on a copy) or performance (by modifying in-place) based on their specific use case.


📚 Documentation preview 📚: https://miditok--221.org.readthedocs.build/en/221/

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.13%. Comparing base (2982218) to head (435eb92).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
- Coverage   90.25%   90.13%   -0.13%     
==========================================
  Files          41       41              
  Lines        6598     6598              
==========================================
- Hits         5955     5947       -8     
- Misses        643      651       +8     

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

@Natooz Natooz added the enhancement New feature or request label Feb 14, 2025
@Natooz
Copy link
Owner

Natooz commented Feb 14, 2025

Hi, thank your for this nice addition which can indeed be quite useful!

@Natooz Natooz merged commit e94589d into Natooz:main Feb 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants