fiat icon indicating copy to clipboard operation
fiat copied to clipboard

redundant apts[:,i]-apts[:,i] expressions

Open chrisrichardson opened this issue 11 years ago • 3 comments
trafficstars

Original report by Nico Schlömer (Bitbucket: nschloe, GitHub: nschloe).


Lines like https://bitbucket.org/fenics-project/fiat/src/550063505522529f9a6c3875007a3c0277d819f0/FIAT/newdubiner.py?at=master#cl-145

results[0,:] = 1.0 + apts[:,0]-apts[:,0]+apts[:,1]-apts[:,1]+apts[:,2]-apts[:,2]

look buggy

0 == apts[:,0]-apts[:,0] + apts[:,1]-apts[:,1] + apts[:,2]-apts[:,2]

There are more of the same kind, e.g., https://bitbucket.org/fenics-project/fiat/src/550063505522529f9a6c3875007a3c0277d819f0/FIAT/expansions.py?at=master#cl-143.

chrisrichardson avatar Jun 13 '14 16:06 chrisrichardson

Original comment by Miklós Homolya (Bitbucket: miklos1, GitHub: miklos1).


This is unfortunately, but unsurprisingly causing flake8 errors. However, if we want to enable flake8 in the continuous integration system, then the code must be made flake8 clean, otherwise the build will constantly be red. I'm wondering which of these options is better:

  1. Remove offending code. Since the code is already broken, it is safe to assume that currently no one uses it.
  2. Fix the problematic code. This would be nice, however, it would take time and effort, while no one seems to need it at the moment.
  3. Comment out broken code. This could make sense if we expected that someone would need this functionality in the future, and that the current broken code is a good basis for producing working code.
  4. Give up enabling flake8 in CI.

Edit: @David_Ham has attempted to fix some of these in https://github.com/firedrakeproject/fiat/pull/3.

chrisrichardson avatar Jun 27 '16 14:06 chrisrichardson

Original comment by Garth N. Wells (Bitbucket: garth-wells, GitHub: garth-wells).


I suggest removing it.

chrisrichardson avatar Jun 27 '16 14:06 chrisrichardson

Original comment by Miklós Homolya (Bitbucket: miklos1, GitHub: miklos1).


Offending code was removed in pull request #11.

chrisrichardson avatar Jun 29 '16 17:06 chrisrichardson