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

Support Python 3 #49

Merged
merged 11 commits into from
Oct 26, 2020
Merged

Support Python 3 #49

merged 11 commits into from
Oct 26, 2020

Conversation

chrisbrickhouse
Copy link
Collaborator

Python 2.7 has been retired in favor of Python 3. This pull request implements FAVE in Python 3 along with a number of improvements to code style and code documentation.

  • Modularization
    • FAAValign and FAAVextract have been moved to modules fave.align and fave.extract respectively
    • The shared dependencies of praat.py and cmu(dictionary).py have been merged and moved to the root module directory as fave.praat and fave.cmudictionary respectively
    • Praat scripts have been moved to their own directory fave/praatScripts
    • fave.extract configuration files have been moved to the fave/extract/config directory
    • Wherever I noticed, references to package resources like praat scripts, config files, and default dictionaries have been replaced with pkg_resources which is a system and implementation independent way of accessing these files
    • fave.align has cross-module logging using the standard logging library allowing users to specify verbosity in a more fine-grained manner
    • Because of the above, end users must run python -m pip install -e /path/to/FAVE/directory or python -m pip install /path/to/fave/wheel/file so that the modules can work together appropriately
  • Packaging
    • The repository is set up as a standard PyPI package including automated package building and dependency management using poetry
    • Python package distributions in tar.gz and .whl are included and may be installed by end users with python -m pip install fave-2.0.0.dev0-py3-none-any.whl
    • An eventual goal is to distribute these via the Python Package Index so end users can run pip install fave from any machine
  • Documentation

chrisbrickhouse and others added 11 commits May 13, 2020 17:54
The FAAValign.py script has been broken up into three files
each covering different aspects of the program. The file
cmudictionary.py handles operations related to the dictionary.
The file transcriptprocessor.py handles the processing of the
input tsv file. The main module, aligner.py, handles the
aspects related to force alignment and serves as a
wrapper for interfacing with the previous two modules.

In the process of modularizing the code, it has been
rewritten to run under Python3 since Python2 is no longer
supported. The new modules have been linted to comply
with PEP standards, and the linter configuration is included
as .pylintrc in the root directory.
Set up auto documentation of code based on method docstrings
and introspection. Still needs the user-facing documentation
created, and the code's actual documentation needs to
be improved.
Sets up Continuous Integration for building documentation on push.
The FAAValign.py script has been broken up into three files
each covering different aspects of the program. The file
cmudictionary.py handles operations related to the dictionary.
The file transcriptprocessor.py handles the processing of the
input tsv file. The main module, aligner.py, handles the
aspects related to force alignment and serves as a
wrapper for interfacing with the previous two modules.

In the process of modularizing the code, it has been
rewritten to run under Python3 since Python2 is no longer
supported. The new modules have been linted to comply
with PEP standards, and the linter configuration is included
as .pylintrc in the root directory.
Set up auto documentation of code based on method docstrings
and introspection. Still needs the user-facing documentation
created, and the code's actual documentation needs to
be improved.
FAVE has been modularized into fave.extract and
fave.align, and the common dependencies, praat.py
and cmu(dictionary).py have been merged and placed
in the main fave module. The python files have been
updated to work with python 3, and the wrapper
scripts for end users have been updated to use
these new modules with minimal changes to the
interface.

Squashed commit of the following:

commit 8d8d9c1c084c790624bca26a35ddc8ee0def4121
Author: Christian <[email protected]>
Date:   Sun May 17 12:25:37 2020 -0700

    Update documentation and minor fixes

commit fa563c3a035fd863e7de53d5150536729bd189c2
Merge: 00373bd bd35b29
Author: Christian <[email protected]>
Date:   Sun May 17 11:38:31 2020 -0700

    Merge branch 'modular' into documentation

commit bd35b29b7cd663dac1aca876031aa66de4fc1cc0
Author: Christian <[email protected]>
Date:   Sun May 17 01:31:46 2020 -0700

    Get FAAVextract.py script working

commit 41c49ee
Author: Christian <[email protected]>
Date:   Fri May 15 21:30:07 2020 -0700

    Working FAAValign.py script

commit 25d6e2f
Author: Christian <[email protected]>
Date:   Fri May 15 21:29:41 2020 -0700

    Merge cmu.py and cmudictionary.py

commit d785972
Author: Christian <[email protected]>
Date:   Fri May 15 14:23:12 2020 -0700

    Packaging: Set up poetry and add wheel file for install

commit 2bd2266
Merge: 62f04e7 52d857c
Author: Christian <[email protected]>
Date:   Fri May 15 14:02:54 2020 -0700

    Merge branch 'modular' of github.com:chrisbrickhouse/FAVE into modular

commit 62f04e7
Author: Christian <[email protected]>
Date:   Fri May 15 13:46:30 2020 -0700

    Reorganize

commit f9fb50d
Author: Christian <[email protected]>
Date:   Fri May 15 13:31:05 2020 -0700

    Rename so import path is sane

commit a077268
Merge: 2ee5b3b db0d35f
Author: Christian <[email protected]>
Date:   Fri May 15 13:27:56 2020 -0700

    Merge branch 'documentation' into modular

commit 2ee5b3b
Author: Christian <[email protected]>
Date:   Thu May 14 22:29:41 2020 -0700

    Modularize FAAValign

    Most of the core files are properly linted. The praat module still
    needs linted, and a replacement for the FAAValign.py script still
    needs written.

commit 7ab28e6
Author: Christian <[email protected]>
Date:   Thu May 14 17:28:24 2020 -0700

    WIP: Modularize FAAValign

    The pieces all work together and it will align files. The
    remaining steps are to get the remaining stray bugs
    and lint warnings

commit c772676
Author: Christian <[email protected]>
Date:   Thu May 14 01:18:15 2020 -0700

    WIP: Modularize FAAValign

    Most of the pieces fit together now. The main pipeline works up
    until the actual alignment.

commit 9d29e81
Author: Christian <[email protected]>
Date:   Wed May 13 19:19:32 2020 -0700

    WIP: Modularize FAAV-align

    Putting the pieces back together. Works up to the dictionary
    checking, but none of the words can be found in the dictionary.

commit a0a06d1
Author: Christian <[email protected]>
Date:   Wed May 13 19:05:12 2020 -0700

    WIP: Rename so import path is sane

commit bbc70cb
Author: Christian <[email protected]>
Date:   Wed May 13 18:13:38 2020 -0700

    WIP: Modularize FAAV-align

    praat.py is linted. Final step is to put the pieces back together

commit b4342c0
Author: Christian <[email protected]>
Date:   Wed May 13 15:00:51 2020 -0700

    WIP: Modularize FAAValign

    Everything except praat.py is linted. Next step is to lint
    that module and then make sure all the pieces work together

commit 786bbae
Author: Christian <[email protected]>
Date:   Wed May 13 14:32:37 2020 -0700

    WIP: Modularize FAAValign

    FAVE-align/align.py is linted and has no outstanding errors other
    than that it cannot import the other modules which have errors.

commit d082b75
Author: Christian <[email protected]>
Date:   Tue May 12 23:54:32 2020 -0700

    WIP: Modularize FAAValign

    Everything seems to be in the right places, dependencies still
    need to be added back and the pieces fit together.

    Still in the process of linting

commit cf904de
Author: Christian <[email protected]>
Date:   Tue May 12 01:02:46 2020 -0700

    WIP: Modularize FAAValign

    Start moving back-end aligning methods to their own class
    and file. Move things around. Still need to finish sorting
    back-end and front-end; finishing touches like proper
    logging, checking dependencies, and testing that everything
    fits together properly still far off.

commit 4e8fd56
Author: Christian <[email protected]>
Date:   Wed May 6 23:35:39 2020 -0700

    WIP: Modularize FAAValign

    Separate out functions for working with the CMU Dictionary
    and processing the transcript

commit 52d857c
Author: Christian <[email protected]>
Date:   Thu May 14 22:29:41 2020 -0700

    Modularize FAAValign

    Most of the core files are properly linted. The praat module still
    needs linted, and a replacement for the FAAValign.py script still
    needs written.

commit e1a8596
Author: Christian <[email protected]>
Date:   Thu May 14 17:28:24 2020 -0700

    WIP: Modularize FAAValign

    The pieces all work together and it will align files. The
    remaining steps are to get the remaining stray bugs
    and lint warnings

commit b6495f2
Author: Christian <[email protected]>
Date:   Thu May 14 01:18:15 2020 -0700

    WIP: Modularize FAAValign

    Most of the pieces fit together now. The main pipeline works up
    until the actual alignment.

commit c2099ad
Author: Christian <[email protected]>
Date:   Wed May 13 19:19:32 2020 -0700

    WIP: Modularize FAAV-align

    Putting the pieces back together. Works up to the dictionary
    checking, but none of the words can be found in the dictionary.

commit 7716008
Author: Christian <[email protected]>
Date:   Wed May 13 19:05:12 2020 -0700

    WIP: Rename so import path is sane

commit a09d195
Author: Christian <[email protected]>
Date:   Wed May 13 18:13:38 2020 -0700

    WIP: Modularize FAAV-align

    praat.py is linted. Final step is to put the pieces back together

commit ab8eb47
Author: Christian <[email protected]>
Date:   Wed May 13 15:00:51 2020 -0700

    WIP: Modularize FAAValign

    Everything except praat.py is linted. Next step is to lint
    that module and then make sure all the pieces work together

commit e114344
Author: Christian <[email protected]>
Date:   Wed May 13 14:32:37 2020 -0700

    WIP: Modularize FAAValign

    FAVE-align/align.py is linted and has no outstanding errors other
    than that it cannot import the other modules which have errors.

commit bb640d2
Author: Christian <[email protected]>
Date:   Tue May 12 23:54:32 2020 -0700

    WIP: Modularize FAAValign

    Everything seems to be in the right places, dependencies still
    need to be added back and the pieces fit together.

    Still in the process of linting

commit 8b62eae
Author: Christian <[email protected]>
Date:   Tue May 12 01:02:46 2020 -0700

    WIP: Modularize FAAValign

    Start moving back-end aligning methods to their own class
    and file. Move things around. Still need to finish sorting
    back-end and front-end; finishing touches like proper
    logging, checking dependencies, and testing that everything
    fits together properly still far off.

commit 1765281
Author: Christian <[email protected]>
Date:   Wed May 6 23:35:39 2020 -0700

    WIP: Modularize FAAValign

    Separate out functions for working with the CMU Dictionary
    and processing the transcript
@chrisbrickhouse
Copy link
Collaborator Author

Incidentally, this also fixes #46

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