afeinstein20 / stella

For characterizing flares with convolutional neural networks
https://adina.feinste.in/stella
MIT License
26 stars 18 forks source link

SyntaxWarning in python 3.8 #4

Closed smoh closed 4 years ago

smoh commented 4 years ago

Hello,

Importing the library in python 3.8 will generate these SyntaxWarnings

....stella/metrics.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="? if mode is 'ensemble':
....stella/metrics.py:55: SyntaxWarning: "is" with a literal. Did you mean "=="? if self.mode is 'cross_val':
....stella/metrics.py:59: SyntaxWarning: "is" with a literal. Did you mean "=="? elif self.mode is 'ensemble':
....stella/metrics.py:82: SyntaxWarning: "is" with a literal. Did you mean "=="? if self.mode is 'cross_val':
....stella/metrics.py:86: SyntaxWarning: "is" with a literal. Did you mean "=="? if self.mode is 'ensemble':
....stella/metrics.py:131: SyntaxWarning: "is" with a literal. Did you mean "=="? if data_set is 'validation':
....stella/metrics.py:133: SyntaxWarning: "is" with a literal. Did you mean "=="? elif data_set is 'test':

I think you do mean to compare equality not identity so may want to fix these.

afeinstein20 commented 4 years ago

Hi @smoh ! Thanks for pointing this out :) I've gone ahead and made these fixes. The version on GitHub should get rid of this warning.

~ Adina