-
Notifications
You must be signed in to change notification settings - Fork 372
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 documentation generation for metrics classes. #1782
Conversation
@derekca Can you verify that the result is what you're looking for (I included sample screen shots, but I can give you the actual files if you want to look at them). Once we have that, we can move forward with the rest of the code review. |
<h2>Overview</h2> | ||
${description} | ||
|
||
<#-- Create the argument summary --> |
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.
These are not arguments, their metrics....
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.
Fixed.
<#list arguments.all as arg> | ||
<@argumentDetails arg=arg/> | ||
</#list> | ||
</#if> |
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.
This if block and the comment are irrelevant and should be removed..
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.
Fixed.
final Map<String, String> metricsField = new HashMap(); | ||
metricsField.put(METRICS_MAP_NAME_KEY, fd.name()); | ||
metricsField.put(METRICS_MAP_SUMMARY_KEY, fd.getRawCommentText()); | ||
metricsFields.add(metricsField); |
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.
Hm. Reviewing you own code days later is interesting. metricsFields
-> metricsList
and metricsField
-> metricsFields
.
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.
Fixed.
@cmnbroad I'm not familiar enough with how the backend works, but what you're describing here is basically what we had in mind. I think that it should help us in migrating over the bulk of the information that we need onto the GATK repo. |
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. One very minor question.
@@ -43,6 +43,9 @@ private HelpConstants() {} | |||
public final static String DOC_CAT_GENOTYPING_ARRAYS_MANIPULATION = "Genotyping Arrays Manipulation"; | |||
public final static String DOC_CAT_GENOTYPING_ARRAYS_MANIPULATION_SUMMARY = "Tools that manipulate data generated by Genotyping arrays"; | |||
|
|||
public final static String DOC_CAT_METRICS = "Metrics"; | |||
public final static String DOC_CAT_METRICS_SUMMARY = "Metrics "; |
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.
Is the trailing space on "Metrics " intentional?
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.
Oh, that space is entirely unnecessary. Fixed.
Not sure exactly what this refers to. Is the plan to restart the publishing of the Picard doc along with Picard releases (I assume we're still not doing that), or to just continue to publish the output of the GATK doc build ? In order for the metrics doc to be produced by the GATK doc build, a separate PR (a subset of this one) will be required in GATK to enable these there. Once this is merged, I'll add that PR to GATK. |
Basically, we will be shutting down the Picard site. There is no set date for the site to be shut down, but it will happen as soon as we finish migrating all the information from that site into GATK documentation as part of this ticket. So, any new Picard documentation or updates should go directly to the GATK docs, and not to the site.
Yes, exactly. The GATK docs will continue to get built, but now they can pull the [missing] Picard metrics information as well.
Okay, if that makes the most sense, then let's do that! |
Oh I see derekca - that sounds good. I'll need to rebase this now since its out-of-date and then we can merge it so I can make the GATK PR. |
f88ed99
to
fbf97d8
Compare
@cmnbroad is this PR ready to merge? |
final FieldDoc[] fieldDocs = currentWorkUnit.getClassDoc().fields(false); | ||
for (final FieldDoc fd : fieldDocs) { | ||
if (fd.isPublic()) { | ||
final Map<String, String> metricsFields = new HashMap(); |
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.
The stricter GATK build complains about this raw type. Fixed.
I updated one line due to fix usage of a raw generic type that was detected by the GATK build when I made the GATK pr to reflect these changes. This is ready once tests pass. |
@derekca @gbrandt6 @droazen @lbergelson FYI.
This implements documentation generation for metrics classes. It uses the existing
@DocumentedFeature
annotation, along with a custom doc template (which is easier than overloading the existing template), and a few lines of custom doclet code that selects that template for metrics classes and displays all public fields (in all super classes in the class hierarchy of the annotated metrics class) in a table.There are two commits; one with the core code, and one that add the annotations to the various metrics classes. A separate sweep should probably be done to add metrics-specific summaries (using the
@DocumentedFeature
summary
attribute) for each class, and also some of the metrics source classes seem to have no documentation at all.Alternative implementations would be:
@DocumentedFeature
, and interpret it to mean "document all for non-@argument fields in a table", or@Argument
, but that would require field-level annotation of each metric variable in each classBut the solution in this PR requires no Barclay changes, and given that the behavior seems pretty specific to metrics, I think its the simplest solution - its basically all custom code in Picard that specializes/overrides the default Barclay doclet. The one caveat is that if we want the GATK doc build to pick up the metrics doc as well, we'll need to propagate the new template and the few lines of custom doclet code to the GATK repo, since GATK uses it's own custom doclet and templates.
Below is some sample output (I don't have all the correct style sheets locally so these are not quite "publish-ready).
Index Page: (note that only AlignmentSummaryMetrics has a n actual summary, because its the only one I wrote - as mentioned above, all of the classes need to have a short summary line to be added):
Detail Page: