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

Remove utils.myopen(), add tests for io.open_file() #926

Merged
merged 3 commits into from
May 24, 2022

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented May 13, 2022

Description of proposed changes

Motivated by work in #854.

Related issue(s)

N/A

Testing

Added tests for io.open_file().

@victorlin victorlin self-assigned this May 13, 2022
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #926 (785b232) into master (440f7c6) will increase coverage by 24.99%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master     #926       +/-   ##
===========================================
+ Coverage   34.59%   59.59%   +24.99%     
===========================================
  Files          42       43        +1     
  Lines        6044     6056       +12     
  Branches     1549     1550        +1     
===========================================
+ Hits         2091     3609     +1518     
+ Misses       3879     2188     -1691     
- Partials       74      259      +185     
Impacted Files Coverage Δ
augur/utils.py 56.90% <ø> (+12.58%) ⬆️
augur/titer_model.py 19.96% <100.00%> (ø)
augur/dates.py 87.17% <0.00%> (-12.83%) ⬇️
bin/augur 80.00% <0.00%> (ø)
augur/util_support/date_disambiguator.py 96.07% <0.00%> (+1.96%) ⬆️
augur/io.py 100.00% <0.00%> (+2.43%) ⬆️
augur/import_beast.py 10.71% <0.00%> (+3.57%) ⬆️
augur/util_support/color_parser.py 100.00% <0.00%> (+3.57%) ⬆️
augur/util_support/node_data_reader.py 100.00% <0.00%> (+4.87%) ⬆️
augur/sequence_traits.py 14.92% <0.00%> (+5.97%) ⬆️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 440f7c6...785b232. Read the comment docs.

@victorlin victorlin marked this pull request as ready for review May 16, 2022 22:11
@victorlin victorlin requested a review from a team May 16, 2022 22:11
Copy link
Contributor

@huddlej huddlej left a comment

Choose a reason for hiding this comment

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

Whoa...I didn't realize this function was still in use! It looks like the only usage is now in the titer_model.py module. Instead of maintaining myopen, I would replace the reference to it in titer_model.py with io.open_file and then delete the function from utils.py.

That open_file function is already tested, so we wouldn't need to add any more tests as part of this change.

myopen is deprecated in favor of the newer function, already used by other modules.
@victorlin victorlin changed the title Support .xz files with utils.myopen, ensure text mode is used Remove utils.myopen(), add tests for io.open_file() May 24, 2022
@victorlin
Copy link
Member Author

@huddlej thanks for providing that context, I didn't realize open_file/xopen does the same thing but probably better. I chose to keep the tests but move them to test_io.py, for completeness in testing read/write of txt/gz/xz files.

@victorlin victorlin requested a review from huddlej May 24, 2022 17:32
@victorlin victorlin merged commit 9dda176 into nextstrain:master May 24, 2022
@victorlin victorlin deleted the utils/update-myopen branch May 24, 2022 17:41
@victorlin victorlin added this to the Major release 16.0.0 milestone Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants