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

Add metric builder and sorter #826

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add metric builder and sorter #826

wants to merge 12 commits into from

Conversation

nh13
Copy link
Member

@nh13 nh13 commented Apr 20, 2022

Added a new class MetricSorter that's useful when we want to sort metrics but cannot hold them all in memory. Leverages Sorter.

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2022

Codecov Report

Merging #826 (b0b942e) into main (57a72b4) will decrease coverage by 0.14%.
The diff coverage is 72.50%.

❗ Current head b0b942e differs from pull request most recent head 45b68d6. Consider uploading reports for the commit 45b68d6 to get more accurate results

@@            Coverage Diff             @@
##             main     #826      +/-   ##
==========================================
- Coverage   95.67%   95.53%   -0.15%     
==========================================
  Files         125      127       +2     
  Lines        7234     7251      +17     
  Branches      489      501      +12     
==========================================
+ Hits         6921     6927       +6     
- Misses        313      324      +11     
Flag Coverage Δ
unittests 95.53% <72.50%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../scala/com/fulcrumgenomics/util/MetricSorter.scala 0.00% <0.00%> (ø)
...scala/com/fulcrumgenomics/util/MetricBuilder.scala 79.31% <79.31%> (ø)
...c/main/scala/com/fulcrumgenomics/util/Metric.scala 95.08% <100.00%> (-1.08%) ⬇️

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 57a72b4...45b68d6. Read the comment docs.

@nh13 nh13 changed the title Add metrics sorter Add metric builder and sorter Apr 20, 2022
* @param lineNumber optionally, the line number when building a metric from a line in a file
* @return
*/
def fromLine(line: String, delim: String = Metric.DelimiterAsString, lineNumber: Option[Int] = None): T = {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: need to have different names for each of the from* methods because I want lineNumber to default to None, and I can't have multiple functions with the same name AND each with default values.

@nh13
Copy link
Member Author

nh13 commented Apr 21, 2022

Relies on fulcrumgenomics/commons#82

* @return a new instance of type [[T]]
*/
def fromArgMap(argMap: Map[String, String], lineNumber: Option[Int] = None): T = {
reflectiveBuilder.reset() // reset the arguments to their initial values
Copy link
Member Author

Choose a reason for hiding this comment

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

@nh13 nh13 requested a review from tfenne April 21, 2022 23:17
@nh13 nh13 marked this pull request as ready for review April 21, 2022 23:17
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.

3 participants