biocore / qurro

Visualize differentially ranked features (taxa, metabolites, ...) and their log-ratios across samples
https://biocore.github.io/qurro
BSD 3-Clause "New" or "Revised" License
31 stars 10 forks source link

"Assert" various properties of the input #50

Open fedarko opened 5 years ago

fedarko commented 5 years ago

There are definitely more of these that I'm not thinking of. Each of these assertions should be accompanied by a test (#2) to ensure that they trigger properly in invalid cases.

I imagine a lot of the QIIME 2 niceness will reduce the amount of times we run into these sort of problems, but the more of these we can anticipate the stronger this codebase will be. (Plus we can't rely on Q2 for the code that's shared between the standalone and Q2 versions of rankratioviz.)

fedarko commented 5 years ago

Yeah so apparently assert shouldn't be used to check user input? Per here and here. It looks like "optimized" code won't even keep assertions, which is not desirable at all.

So uhhh it's probably best to go replace assertions with if statements that raise user-readable error messages.