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 support for nclist. #211
Conversation
Codecov Report
@@ Coverage Diff @@
## master #211 +/- ##
==========================================
+ Coverage 87.23% 88.74% +1.50%
==========================================
Files 78 76 -2
Lines 6347 6292 -55
Branches 511 436 -75
==========================================
+ Hits 5537 5584 +47
+ Misses 299 272 -27
+ Partials 511 436 -75
Continue to review full report at Codecov.
|
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.
Sorry for my late reply 🙏 and thank you for your PR!!
784db13
to
7b6b0c2
Compare
Thank you for pointing. I fixed them. |
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.
LGTM 👍 👍 Thank you for the update!
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.
Thanks for adding this useful feature! 🙏 Added a comment.
src/cljam/util/intervals.clj
Outdated
(when-let [target-intervals | ||
(->> (subseq nclist >= start) | ||
(map second) | ||
(take-while #(<= (:start (first %)) end)))] | ||
(mapcat #(cons (first %) | ||
(find-nclist-overlap-intervals (second %) | ||
start end)) | ||
target-intervals))) |
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.
Although it wouldn't cause a real problem, the conditional of this when-let
will always be evaluated to a truthy value since take-while
always returns a non-nil value. You can rewrite this as:
(some->> (subseq nclist >= start)
(map second)
(take-while #(<= (:start (first %)) end))
seq
(mapcat #(cons (first %)
(find-nclist-overlap-intervals (second %)
start end))))
Or simply:
(->> (subseq nclist >= start)
(map second)
(take-while #(<= (:start (first %)) end))
(mapcat #(cons (first %)
(find-nclist-overlap-intervals (second %)
start end))))
I removed unnecessary when-let. |
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.
LGTM 👍 Thanks again for working on this feature!
This pr adds support for Nested Containment List (NCList).