fulcrumgenomics / prymer

Python Primer Design Library
https://prymer.readthedocs.io/en/latest/
MIT License
8 stars 0 forks source link

Error messages are not always propagated through `primer3_error` #15

Open msto opened 1 month ago

msto commented 1 month ago

primer3_error() fails to propagate errors when the logged error includes an equals sign.

When this occurs, the line is stored in primer3_results rather than error_lines.

Could we add stricter validation/parsing of the primer3 output, so underlying error messages are visible?

# contents of `primer3_results`
{'/Users/msto/.miniforge-x86/envs/gia_primer_design/bin/primer3_core:libprimer3.cc:5745, assertion (len >': ' 3) failed'}

# corresponding logged line
/Users/msto/.miniforge-x86/envs/gia_primer_design/bin/primer3_core:libprimer3.cc:5745, assertion (len >= 3) failed

https://github.com/fulcrumgenomics/prymer/blob/8d332df27d1a467dd66369cc2e16183f033ab8d2/prymer/primer3/primer3.py#L402-L412

https://github.com/fulcrumgenomics/prymer/blob/8d332df27d1a467dd66369cc2e16183f033ab8d2/prymer/primer3/primer3.py#L423-L435

clintval commented 1 month ago

I agree! From the Zen of Python:

Errors should never pass silently.

I would like a way to see all logs from Primer3, perhaps by using the logging module and having the important logs set to INFO/WARNING and all the rest DEBUG.

clintval commented 1 month ago

Sister issue for bwa: