fiat
fiat copied to clipboard
redundant apts[:,i]-apts[:,i] expressions
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.
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:
- Remove offending code. Since the code is already broken, it is safe to assume that currently no one uses it.
- 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.
- 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.
- Give up enabling
flake8in CI.
Edit: @David_Ham has attempted to fix some of these in https://github.com/firedrakeproject/fiat/pull/3.
Original comment by Garth N. Wells (Bitbucket: garth-wells, GitHub: garth-wells).
I suggest removing it.