Skip to content

Conversation

@magicDGS
Copy link
Contributor

@codecov-io
Copy link

codecov-io commented Feb 10, 2017

Codecov Report

Merging #41 into master will decrease coverage by -0.07%.
The diff coverage is 40%.

@@             Coverage Diff             @@
##             master     #41      +/-   ##
===========================================
- Coverage     71.47%   71.4%   -0.07%     
  Complexity      500     500              
===========================================
  Files            21      21              
  Lines          2040    2039       -1     
  Branches        421     420       -1     
===========================================
- Hits           1458    1456       -2     
  Misses          405     405              
- Partials        177     178       +1
Impacted Files Coverage Δ Complexity Δ
...e/barclay/argparser/CommandLineArgumentParser.java 81.37% <40%> (-0.21%) 166 <ø> (ø)

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 5ad7418...dfc3196. Read the comment docs.

@magicDGS
Copy link
Contributor Author

Could you please have a look to this @cmnbroad? It is a very simple fix for a bug that is preventing me to update my dependencies to the latest GATK/Barclay versions... Thank you in advance.

@cmnbroad
Copy link
Collaborator

Hi @magicDGS Yes, will take a look tomorrow.

@magicDGS
Copy link
Contributor Author

Thank you very much @cmnbroad!

Copy link
Collaborator

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

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

A few comments to clean up the code a bit (checkArgumentRange should really have been an argumentDefinition method, but I'll make that change in a separate PR when I do the argdef refactoring).

logger.warn("Argument --{} has value {}, but maximum recommended is {}",
argumentDefinition.getLongName(), argumentDoubleValue, argumentDefinition.maxRecommendedValue);
}
// if it does not have any recommended value, it does not log anything as expected
Copy link
Collaborator

Choose a reason for hiding this comment

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

-> // if there is no recommended value, do not log anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the comment and added an exception, because now it should not happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, this should be the comment. I misunderstood where it is....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

public boolean hasBoundedRange() {
return this.minValue != Double.NEGATIVE_INFINITY || this.maxValue != Double.POSITIVE_INFINITY;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this could be private for now. Also, now that this method exists, we should use it in the other places where we do the same check (i.e., in the argdef constructor). Likewise, we should add a hasRecommendedRange and use that at the appropriate call sites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// Integer without boundaries and null should be allowed
@Argument(doc = "Integer with null value allowed", optional = true)
public Integer nullInteger = null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Its confusing to have this argument, and the corresponding test, live inside the "WithBoundariesArguments" class and test. It should live somewhere else, maybe in its own test if there is no current test thats appropriate. We should also add a similar test case for a Double (with null) arg.


// Check hard limits first, if specified
if (isOutOfRange(argumentDefinition.minValue, argumentDefinition.maxValue, argumentDoubleValue)) {
if (argumentDefinition.hasBoundedRange() && isOutOfRange(argumentDefinition.minValue, argumentDefinition.maxValue, argumentDoubleValue)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add a hasRecommendedRange method, similar to hasBoundedRange, and use that below where we check the recommended range.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not necessary for the logging path, because if there is no range there are no logging. Anyway, I included the check and added an exception (should never reach).

@magicDGS magicDGS force-pushed the dgs_fix_unbounded_null branch from faf867d to dfc3196 Compare February 17, 2017 17:48
@magicDGS
Copy link
Contributor Author

I addressed your comments in the last commit. Thank you very much @cmnbroad -- back to you

@magicDGS
Copy link
Contributor Author

I think that this is ready to go, @cmnbroad. It is important for me to update dependencies with the new changes in some of my projects. Thank you in advance!

@magicDGS
Copy link
Contributor Author

Thanks for this!

@magicDGS magicDGS deleted the dgs_fix_unbounded_null branch February 28, 2017 09:45
@magicDGS magicDGS restored the dgs_fix_unbounded_null branch June 27, 2018 13:49
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