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

Fix range type #801

Merged
merged 9 commits into from
Dec 2, 2020
Merged

Fix range type #801

merged 9 commits into from
Dec 2, 2020

Conversation

mashehu
Copy link
Contributor

@mashehu mashehu commented Nov 28, 2020

Fixes #738.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated

@codecov
Copy link

codecov bot commented Nov 28, 2020

Codecov Report

Merging #801 (27add0b) into dev (ae2d7e7) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #801      +/-   ##
==========================================
- Coverage   82.88%   82.79%   -0.10%     
==========================================
  Files          13       13              
  Lines        2717     2702      -15     
==========================================
- Hits         2252     2237      -15     
  Misses        465      465              
Impacted Files Coverage Δ
nf_core/schema.py 88.23% <ø> (ø)
nf_core/launch.py 69.12% <100.00%> (-1.26%) ⬇️

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 ae2d7e7...27add0b. Read the comment docs.

except ValueError:
return "Must be a number"

question["validate"] = validate_range
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need some logic here to only use this validation if we have a min and a max? Otherwise it will just always overwrite the regular number validation function above..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, that is true. How about if I completely replace the number validation function with the range validation (or add the min, max check to the number validation, which is the same at the end)? Because it does the same as the number validation, if there is no min or max.

Copy link
Member

@ewels ewels Nov 29, 2020

Choose a reason for hiding this comment

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

Yup 👍🏻 Might be worth trying to add some new tests for this too? (Still not looking in depth, sorry if they are there already).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is already a test case for ranges in test_launch.py, if that is what you mean.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! 👍🏻

@ewels ewels merged commit 2e85a67 into nf-core:dev Dec 2, 2020
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.

2 participants