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

refactor align helper functions out of align.py #259

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

joanise
Copy link
Member

@joanise joanise commented Jan 29, 2025

PR Goal?

align.py is a monster file doing too much stuff. This PR takes the alignment I/O out to align_utils.py.

The work was inspired by #170, which is non essential, but I decided to do it because it makes the code somewhat cleaner, and the Heroku image leaner.

Not done: I'm not sure how to declare, when updating requirements.txt from pyproject.toml, to exclude soundswallower... (added documentation to do it on update).

Fixes?

Fixes #170

Priority?

low

Tests added?

This was almost all already covered by existing tests. I just had to do minor tweaks on the heroku workflow to streamline it.

Confidence?

high

Version change?

no

Copy link

semanticdiff-com bot commented Jan 29, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  readalongs/web_api.py  97% smaller
  readalongs/cli.py  58% smaller
  readalongs/align.py  2% smaller
  .github/workflows/tests.yml Unsupported file format
  bin/post_compile Unsupported file format
  readalongs/align_utils.py  0% smaller
  readalongs/api.py  0% smaller
  readme-heroku.md Unsupported file format
  requirements.txt Unsupported file format
  test/test_force_align.py  0% smaller
  test/test_make_xml_cli.py  0% smaller

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

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

Project coverage is 88.08%. Comparing base (17073b6) to head (cb053cd).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
readalongs/align_utils.py 98.29% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #259      +/-   ##
==========================================
+ Coverage   88.04%   88.08%   +0.03%     
==========================================
  Files          21       22       +1     
  Lines        1824     1830       +6     
  Branches      330      330              
==========================================
+ Hits         1606     1612       +6     
  Misses        180      180              
  Partials       38       38              

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

@joanise joanise requested review from roedoejet and dhdaines January 30, 2025 12:16
@joanise joanise force-pushed the dev.ej/refactor-align-io branch from 6152a32 to cb053cd Compare January 30, 2025 19:17
Copy link
Collaborator

@roedoejet roedoejet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward refactor - thanks @joanise !

@joanise joanise merged commit 301a46a into main Jan 30, 2025
8 checks passed
@joanise joanise deleted the dev.ej/refactor-align-io branch January 30, 2025 19:52
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.

Refactoring idea: change web_api so it does not import soundswallower
2 participants