timmahrt / praatIO

A python library for working with praat, textgrids, time aligned audio transcripts, and audio files. It is primarily used for extracting features from and making manipulations on audio files given hierarchical time-aligned transcriptions (utterance > word > syllable > phone, etc).
MIT License
311 stars 33 forks source link

refactor: make tierNameList dependent on the state of tierDict #43

Closed timmahrt closed 1 year ago

timmahrt commented 1 year ago

This PR addresses concerns raised in: https://github.com/timmahrt/praatIO/issues/39

Before this PR, tierNameList and tierDict were independent. An unwary user could create a Tier with an inconsistent tierNameList and tierDict.

After this PR, tierNameList is derived from tierDict. Furthermore, tierNameList has been made read only and tierDict was made protected (_tierDict). _tierDict should be accessed and modified via the provided helper methods tg.addTier, tg.getTier, tg.removeTier, and tg.renameTier.

coveralls commented 1 year ago

Coverage Status

Coverage: 75.575% (-0.03%) from 75.605% when pulling 23aeda5af2c69c4a42c0dc5b8e41142a59991ecc on 39_prevent_inconsistent_state_with_tier_name_list into b1330ddf4cb38cee9c91f3e8b25f9348280b921e on praatio_v6.

coveralls commented 1 year ago

Coverage Status

Coverage: 75.585% (-0.02%) from 75.605% when pulling 9ed8fda7c8bcdaf04ebc8a1953291eab46c2563b on 39_prevent_inconsistent_state_with_tier_name_list into b1330ddf4cb38cee9c91f3e8b25f9348280b921e on praatio_v6.

codecov-commenter commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (praatio_v6@b1330dd). Click here to learn what that means. Patch has no changes to coverable lines.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## praatio_v6 #43 +/- ## ============================================= Coverage ? 75.71% ============================================= Files ? 21 Lines ? 2623 Branches ? 0 ============================================= Hits ? 1986 Misses ? 637 Partials ? 0 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tim)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.