-
Notifications
You must be signed in to change notification settings - Fork 295
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
initial stab at exception handling around file operations #333
Conversation
Test PASSed. |
Are there other file IO operations in the C++ code that need wrapping? |
On Wed, Mar 19, 2014 at 06:23:44AM -0700, Ram RS wrote:
Yes, of course, but I want to get the approach worked out first. |
Hmmm, so you have given a demo on how to handle file input on wholesale Would you be willing to go over a list I prepare of candidate spots? I'd Ram On Wed, Mar 19, 2014 at 9:25 AM, C. Titus Brown notifications@github.comwrote:
|
On Wed, Mar 19, 2014 at 07:01:32AM -0700, Ram RS wrote:
Please feel free to prepare such a list, but I might ignore it :) |
I'm gonna go out on a limb and wrap most (if not all) c_str(file,ios::X) operations. Quick question: would it not be easier to wrap the open() lines in the underlying read_parsers.cc and other source files? |
On Wed, Mar 19, 2014 at 11:12:28AM -0700, Ram RS wrote:
Ram, please don't step on my work; it's preliminary. Thanks. |
I wasn't planning to actually start working on this, just figured we could discuss. I apologize. I think if we could assign issues (at least those opened by repo collaborators for themselves), that would avoid this confusion. |
Ah, I understand now. I apologize for this oversight. It was foolish of me to assume that this PR was a pilot/demo to a branch of work and not an ongoing piece in and of itself. |
Test FAILed. |
Test FAILed. |
Also see #411. |
…g_file_exceptions Conflicts: lib/counting.cc
Here is a brief description of the strategy, implemented (for now) in counting.cc, CountingHashFileReader constructor:
@mr-c and I talked about why we shouldn't just catch the ifstream exceptions in _khmermodule. The reason I did it this way is so that we can add in more specific error messages in the function that is actually doing the loading: _khmermodule will have no real context for why an exception is being thrown, while the code in counting.cc may be able to figure it out and provide a more useful error message to the Python level. (See last link in extra reading -- there are no special format conventions for figuring out what an exception means here.) Extra reading:
@mr-c, @camillescott, @luizirber - any comments on this strategy? I can apply it to all input streams easily enough. |
The approach and the code looks good to me. |
On Thu, May 29, 2014 at 7:39 PM, C. Titus Brown notifications@github.com
** Yes, this causes problems when multiple pull requests are being updated
I've added a Makefile target in this branch that automates the diff-cover |
The HTML diff-cover report is available at http://athyra.ged.msu.edu/~mcrusoe/diff-cover.html if you have problems running it locally. |
OK, I see, so yes, I need run the coverage on my own. We'll have to document all of this for the hackathon, I think. |
(I've forgotten how to log into Jenkins, if I ever knew; but it seems like the coverage report should be publicly available, no?) |
Hallelujah!! Quick, @mr-c, merge it before it breaks again :) |
except IOError, e: | ||
print str(e) | ||
|
||
def test_hashbits_file_type_check(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests/test_hashbits.py:682:1: E302 expected 2 blank lines, found 1
On Fri, May 30, 2014 at 3:32 AM, C. Titus Brown notifications@github.com
|
On Fri, May 30, 2014 at 3:34 AM, C. Titus Brown notifications@github.com
|
I'm going to fix the spacing error & squash this down to a handful of commits instead of 55 |
initial stab at exception handling around file operations
I switched to a matrix-based authorization scheme and now non-logged-in Jenkins issue is at https://issues.jenkins-ci.org/browse/JENKINS-23254 On Fri, May 30, 2014 at 11:34 AM, Michael Crusoe michael.crusoe@gmail.com
|
Thanks, @mr-c, for all your work on this! Question -- should the squashing be part of our standard dev workflow? I'm -0 on it as a general thing (because I'm scared of git rebase) but +0 on it being your call. Either way it should be mentioned as an option in our dev docs (perhaps added as part of #440). |
Personally I For this PR it was too messy for me to clean up. shrug It is a strong preference but I haven't come up with a sure-fire way to use it. I'm going to punt on this for now. |
ht.add_tag('A' * 32) | ||
ht.add_tag('G' * 32) | ||
ht.save_tagset(outfile) | ||
ht.save_tagset('/tmp/goodversion-k32.tagset') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I don't think this line should be in the test.
No description provided.