-
Notifications
You must be signed in to change notification settings - Fork 592
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
Add documentation and args check for SVInterval #5157
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5157 +/- ##
===============================================
+ Coverage 86.739% 86.767% +0.029%
- Complexity 29467 29948 +481
===============================================
Files 1818 1818
Lines 136389 137607 +1218
Branches 15121 15430 +309
===============================================
+ Hits 118302 119398 +1096
- Misses 12647 12746 +99
- Partials 5440 5463 +23
|
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.
I don't think this is a good idea.
-
The code is completely indifferent to the origin (1-based or 0-based): all methods work correctly with any consistent definition. Currently, the clients can decide what convention to use.
-
Even negative values for start are conceivably meaningful and do not cause any of the methods to return incorrect results.
-
I have code that uses negative values of the contig to encode "opposite strand". (It's not currently checked in, but it's very convenient.)
I'd really like to keep this class simple and wide open. Otherwise, I think we'll be fighting lots of random exceptions that don't really signal any error condition.
Then what about the two methods EDIT |
28efdce
to
cd07feb
Compare
@tedsharpe I've removed the args checking after our discussion, and added more documentation. |
Here's an idea. It may be too much work, for now, and I'm fine with this code as it stands, but perhaps others are not. Anyway, the idea is this: The constructor gets one extra argument: A lambda that serves as a validation function of the form
It either throws an exception or returns silently. |
@tedsharpe not sure if this is what you meant. |
I like this. Not sure the "ultimate" solution is necessary, but it's certainly reasonable. |
…argument validator
fb2af7b
to
c63a072
Compare
Going to risk it and take the "I like this" as approval 😏 |
@tedsharpe
not sure if the args checking would significantly affect performance.