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

increase filter_abund.py coverage #568

Merged
merged 6 commits into from
Dec 30, 2014
Merged

increase filter_abund.py coverage #568

merged 6 commits into from
Dec 30, 2014

Conversation

themangoemoji
Copy link
Contributor

  • Is it mergable
  • Did it pass the tests?
  • N/A If it introduces new functionality in scripts/ is it tested?
    Check for code coverage.
  • Is it well formatted? Look at pep8/pylint, cppcheck, and
    make doc output. Use autopep8 and astyle -A10 --max-code-length=80
    if needed.
  • Is it documented in the Changelog?
  • Was spellcheck run on the source code and documentation after changes
    were made?

@themangoemoji
Copy link
Contributor Author

@mr-c ready to merge

@@ -1,3 1,8 @@
2014-07-24 Michael Wright <[email protected]>

Copy link
Contributor

Choose a reason for hiding this comment

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

two spaces after your name

You might like http://www.vim.org/scripts/script.php?script_id=1631

@mr-c
Copy link
Contributor

mr-c commented Aug 5, 2014

@wrightmhw Fix these two things ASAP and I'll include this in the next release; thanks!

@mr-c
Copy link
Contributor

mr-c commented Aug 18, 2014

This is being bumped to the 1.2 release.

@mr-c mr-c added this to the 1.1 2 milestone Aug 18, 2014
@ctb
Copy link
Member

ctb commented Sep 9, 2014

ping @wrightmhw?

@themangoemoji themangoemoji force-pushed the fix/filter_abund_cov branch 4 times, most recently from 9cfbfdb to 0e8d31f Compare September 16, 2014 19:38
@themangoemoji
Copy link
Contributor Author

@mr-c I don't see how Jenkins is failing. All tests passed and no pylint/pep8 errors??

@themangoemoji
Copy link
Contributor Author

test this please


args = [n_counting_ht, n_infile, '-o' 'outfile']
utils.runscript(script, args, in_dir)
assert os.path.exists(outfile), outfile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mr-c Is that assert testing the last set of args correctly, or is it testing a previous set?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch: If you're rerunning within the same test you should use a new filename especially when just doing existence checks.

Copy link
Member

Choose a reason for hiding this comment

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

Umm, note that in args its using '-o outfile' and not '-o %s' % outfile, so you're literally writing to the file named 'outfile' not the file named by the value in the variable outfile...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ctb should I use %s or '.format' here?
http://stackoverflow.com/questions/12382719/python-way-of-printing-with-format-or-percent-form
(I know stack overflow, sorry. But I couldn't find documentation on my question. I only see it as important if '%' is not supported for python3)

Copy link
Member

Choose a reason for hiding this comment

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

On Tue, Sep 30, 2014 at 11:54:53PM -0700, Michael Wright wrote:

 assert len(seqs) == 1, seqs
 assert 'GGTTGACGGGGCTCAGGG' in seqs
  • args = [n_counting_ht, n_infile]
  • utils.runscript(script, args, n_in_dir)
  • seqs = set([r.sequence for r in screed.open(n_infile)])
  • assert os.path.exists(n_outfile), n_outfile
  • args = [n_counting_ht, n_infile, '-o' 'outfile']
  • utils.runscript(script, args, in_dir)
  • assert os.path.exists(outfile), outfile

@ctb should I use %s or '.format' here?
http://stackoverflow.com/questions/12382719/python-way-of-printing-with-format-or-percent-form
(I know stack overflow, sorry. But I couldn't find documentation on my question. I only see it as important if '%' is not supported for python3)

They've been mixed in the codebase, so it doesn't matter. I gather {} is
more modern.

@themangoemoji themangoemoji force-pushed the fix/filter_abund_cov branch 2 times, most recently from 1025900 to a1cb6bc Compare September 30, 2014 20:47
@ged-jenkins
Copy link

Test PASSed.

1 similar comment
@ged-jenkins
Copy link

Test PASSed.

@ged-jenkins
Copy link

Test FAILed.

@ged-jenkins
Copy link

Test FAILed.

@ged-jenkins
Copy link

Test PASSed.

@ctb
Copy link
Member

ctb commented Nov 20, 2014

Ping @wrightmhw.

@mr-c
Copy link
Contributor

mr-c commented Dec 30, 2014

I've rebased again the master tree and fixed the test.

@mr-c
Copy link
Contributor

mr-c commented Dec 30, 2014

I can confirm that this PR increases the code coverage of filter-abund.py. Thank you @wrightmhw

mr-c added a commit that referenced this pull request Dec 30, 2014
increase filter_abund.py coverage
@mr-c mr-c merged commit 4601b7b into master Dec 30, 2014
@mr-c mr-c deleted the fix/filter_abund_cov branch December 30, 2014 18:16
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.

None yet

4 participants