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

[FEATURE] Add verbose option #157

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

Irallia
Copy link
Collaborator

@Irallia Irallia commented Sep 16, 2021

Resolves partly #20
We add a verbose option here, without different values, just as a flag.

@Irallia Irallia self-assigned this Sep 16, 2021
@Irallia Irallia linked an issue Sep 16, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #157 (e8e2001) into master (547ce22) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head e8e2001 differs from pull request most recent head 3fd4a4d. Consider uploading reports for the commit 3fd4a4d to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
+ Coverage   94.93%   94.97%   +0.03%     
==========================================
  Files          18       18              
  Lines         731      736       +5     
==========================================
+ Hits          694      699       +5     
  Misses         37       37              
Impacted Files Coverage Δ
src/iGenVar.cpp 88.52% <100.00%> (+0.09%) ⬆️
...ules/clustering/hierarchical_clustering_method.cpp 98.91% <100.00%> (+0.01%) ⬆️
...ules/sv_detection_methods/analyze_cigar_method.cpp 100.00% <100.00%> (ø)
...sv_detection_methods/analyze_split_read_method.cpp 95.16% <100.00%> (+0.07%) ⬆️

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 547ce22...3fd4a4d. Read the comment docs.

@Irallia Irallia requested review from a team and eaasna and removed request for a team September 16, 2021 12:36
Copy link
Contributor

@eaasna eaasna left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@joergi-w joergi-w left a comment

Choose a reason for hiding this comment

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

I'm not sure, if I should agree or disagree with this... So I share my thoughts:

As you see, the verbose variable is needed in every corner of the program and you have to change basically each and every function signature of the software. In my opinion, this is THE situation to use a public global variable. Your PR would shrink to a few lines, the future maintenance would be simpler, and you would avoid passing the boolean by copy(!) to each function. On the other hand I know that it is controversially discussed whether global variables should be used at all... Find some arguments here and here.

src/iGenVar.cpp Outdated
@@ -49,6 +49,9 @@ void initialize_argument_parser(seqan3::argument_parser & parser, cmd_arguments
parser.add_option(args.threads, 't', "threads",
"Specify the number of decompression threads used for reading BAM files.",
seqan3::option_spec::standard);
parser.add_flag(args.verbose, 'v', "verbose",
"If you set this flag to true, we provide additional details about what iGenVar does. The detailed "
"output is printed in the standard output.");
Copy link
Member

Choose a reason for hiding this comment

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

Not true, you use debug_stream, which prints to stderr.
And stderr is good, because otherwise the output would be intertwined with the vcf output (which goes to stdout).

Choose a reason for hiding this comment

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

Instead of If you set this flag to true, just If you set this flag, because the call is ./program --verbose without true as a parameter.

Copy link
Member

Choose a reason for hiding this comment

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

Good point! 😏

@@ -48,6 +48,10 @@ std::string const help_page_part_1
" -t, --threads (signed 16 bit integer)\n"
" Specify the number of decompression threads used for reading BAM\n"
" files. Default: 1.\n"
" -v, --verbose\n"
" If you set this flag to true, we provide additional details about\n"
" what iGenVar does. The detailed output is printed in the standard\n"
Copy link
Member

Choose a reason for hiding this comment

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

please adapt

Copy link
Member

@joergi-w joergi-w left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Please check the two unresolved comments about the argument parser description of the -v flag.

Signed-off-by: Lydia Buntrock <lydia.buntrock@fu-berlin.de>
@Irallia
Copy link
Collaborator Author

Irallia commented Sep 17, 2021

I should not work too late, then I always miss something 😅
Have now adjusted everything, I hope now nothing is missing anymore.

@Irallia Irallia merged commit 7ea10ef into seqan:master Sep 17, 2021
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.

None yet

4 participants