usnistgov / fipy

FiPy is a Finite Volume PDE solver written in Python
http://pages.nist.gov/fipy/en/latest
Other
504 stars 148 forks source link

Python 3.8 #729

Open wd15 opened 4 years ago

wd15 commented 4 years ago
Python 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 08:20:52) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fipy
/home/wd15/git/fipy/fipy/variables/variable.py:649: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if v.shape is not ():
/home/wd15/git/fipy/fipy/variables/meshVariable.py:118: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if valueShape is not () and valueShape[-1] == self._globalNumberOfElements:
/home/wd15/git/fipy/fipy/variables/meshVariable.py:523: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  and otherShape is not ()
/home/wd15/git/fipy/fipy/meshes/abstractMesh.py:1148: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if arr.dtype.name is 'bool':
/home/wd15/git/fipy/fipy/meshes/builders/utilityClasses.py:62: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if numerix.getShape(d) is not ():
/home/wd15/git/fipy/fipy/terms/abstractConvectionTerm.py:155: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if (coeffShape is ()) or (coeffShape[0] != var.mesh.dim):
>>> 
guyer commented 4 years ago

Strange, I don't get these errors warnings on macOS.

wd15 commented 4 years ago

I'll try and investigate

guyer commented 4 years ago

From my reading of the 3.8 CHANGELOG, I should be getting these warnings, too. I think I recall futurize insisting on changing some similar things when we migrated to Py3k. It's easy enough to fix these, but it's hard to know I've done it right when it doesn't show up in the first place.

faxik commented 4 years ago

I did see the above in configuration as in https://github.com/usnistgov/fipy/issues/730#issuecomment-629451010

I also saw some differences between Anaconda and system Python on Ubuntu 20.04. I still didn't gather enough to open a detailed bug, but in case you're looking at it this info might be relevant.