wtsi-hgi / Automated-Enhancer-Gene-SCRAMBLEr

A tool to help automate the Genome Scramble project
MIT License
0 stars 1 forks source link

Rename true/false conditions #6

Closed KMace closed 1 year ago

KMace commented 1 year ago

https://github.com/wtsi-hgi/Automated-Enhancer-Gene-SCRAMBLEr/blob/5da1fbc6d244dbede92c624d6d2bc0d420354147/find_metrics.py#L77

(This is a super pedantic point, I learnt it myself 5 mins ago, but) the best (i.e. fastest/safest/most robust) way of checking if x is true or false is by writing if x and if not x, respectively. So, in your case, this should be rewritten to if not di.INTERFERRING_GENE_OVERLAPS, and all other instances of not evaluating true/false conditions in this way should be replaced.

Source: https://docs.python.org/2/library/stdtypes.html#truth-value-testing Source: https://stackoverflow.com/questions/37103705/what-is-the-correct-way-to-check-for-false