vahuynh / GENIE3

Machine learning-based approach for the inference of gene regulatory networks from expression data.
68 stars 32 forks source link

SyntaxWarning when importing with Python 3.9 #9

Closed agitter closed 2 years ago

agitter commented 2 years ago

In Python 3.9.7 from GENIE3 import * gives

GENIE3.py:70: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if regulators is not 'all':
GENIE3.py:81: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if maxcount is not 'all' and not isinstance(maxcount,int):
GENIE3.py:218: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if regulators is not 'all':
GENIE3.py:229: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if tree_method is not 'RF' and tree_method is not 'ET':
GENIE3.py:229: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if tree_method is not 'RF' and tree_method is not 'ET':
GENIE3.py:232: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if K is not 'sqrt' and K is not 'all' and not isinstance(K,int):
GENIE3.py:232: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if K is not 'sqrt' and K is not 'all' and not isinstance(K,int):

This was using commit 8bc2299b7dd0b6b595696675385507403026862b from this repository. This blog post suggests that the SyntaxWarning was added in Python 3.8.

vahuynh commented 2 years ago

Thank you for pointing that out. It's fixed in commit https://github.com/vahuynh/GENIE3/commit/856416bacd93a76328dfdaf7df7a33070306a1ea.

agitter commented 2 years ago

Thanks for the quick response and great software.