-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Convert itkgroup Doxygen script to Python. #5157
Convert itkgroup Doxygen script to Python. #5157
Conversation
We do not process doxygen on VXL.
The conversion was mostly done with git Copilot. The the following command was used for comparison the prior version:
|
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.
If this works the same as before, this is good! More people are fluent in Python than Perl.
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.
Use argparse
with a separate method to parse input arguments? This parser method could host the documentation for the file, or else, we could document the file before the first import e.g.
(....)
"""
Docstring.
"""
import argparse
(...)
def _build_arg_parser():
p = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawTextHelpFormatter
)
p.add_argument("filename", type=str, help="Input path.")
return p
def main():
parser = _build_arg_parser()
args = parser.parse_args()
(...)
if __name__ == "__main__":
main()
Unless the ITK style is the one you adopted.
b51939b
to
c693441
Compare
I'll update to use a proper Python DocString for the file. This is an improvement to modernize the scripts in a utility function. I do not find the additional effort to refactor the arguments worth the needed time. |
c693441
to
bbffe4f
Compare
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 believe it would be informative to add a commit body message; will let other maintainers to merge.
Thanks for doing this Brad !!
1090d31
into
InsightSoftwareConsortium:master
Relates to: #3654
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.