MAINT: Removed suitable unused variables shown in LGTM#19102
MAINT: Removed suitable unused variables shown in LGTM#19102mattip merged 10 commits intonumpy:mainfrom
Conversation
numpy/f2py/crackfortran.py
Outdated
| if v[0] == '(' and v[-1] == ')': | ||
| # FIXME, unused l looks like potential bug | ||
| l = markoutercomma(v[1:-1]).split('@,@') | ||
| pass |
There was a problem hiding this comment.
Does this reflect a deeper problem? Should the result of markeroutercomma be used somewhere?
I think this should be left for a future clean-up PR.
There was a problem hiding this comment.
This looks like an unfinished implementation. In short term, replace the block under elif iscomplex(...): with
outmess(f'get_parameters[TODO]: implement evaluation of complex expression {v}')
|
Unless one of the f2py people can approve that the unused function call results are indeed not needed, I would suggest removing them for now. @pearu, @melissawm thoughts? |
|
sure, I'll follow up with a new commit shortly. |
| conf = c() | ||
| conf.verbosity = 2 | ||
| # FIXME: r not used | ||
| r = conf.get_info() |
There was a problem hiding this comment.
I suspect this has side effects based on the verbosity settings above, so the conf.get_info call is still needed
There was a problem hiding this comment.
sure, I'll reflect that change in a new commit.
pearu
left a comment
There was a problem hiding this comment.
My review covers only the crackfortran.py part.
| (m.group('this'), ll[:i])) | ||
| ll = ll + ','.join(groupcache[groupcounter]['args']) | ||
| if i < 0: | ||
| i = 0 |
There was a problem hiding this comment.
hey, I commited your reviewed changes. Can you tell if you are satisfied ?
The azure lint test seems to fail, reason being outmess(f'get_parameters[TODO]: implement evaluation of complex expression {v}'), Can you check?
There was a problem hiding this comment.
That's a "line too long" error. You'll need to split the line, for instance:
outmess('get_parameters[TODO]:'
f' implement evaluation of complex expression {v}')
(untested).
There was a problem hiding this comment.
The removal looks to be gone, wasn't it valid?
numpy/f2py/crackfortran.py
Outdated
| if v[0] == '(' and v[-1] == ')': | ||
| # FIXME, unused l looks like potential bug | ||
| l = markoutercomma(v[1:-1]).split('@,@') | ||
| pass |
There was a problem hiding this comment.
This looks like an unfinished implementation. In short term, replace the block under elif iscomplex(...): with
outmess(f'get_parameters[TODO]: implement evaluation of complex expression {v}')
… in crackfortran.py after review
… added in previous commit
…py - fixed Azure linter 'line too long' error
…ved '_linalgRealType(t)' function from linalg.py
|
There test failure is unrelated. |
numpy/f2py/crackfortran.py
Outdated
| # FIXME, unused l looks like potential bug | ||
| l = markoutercomma(v[1:-1]).split('@,@') | ||
| outmess(f'get_parameters[TODO]:' | ||
| f'implement evaluation of complex expression {v}') |
There was a problem hiding this comment.
Indentation is off, should align under first string.
numpy/distutils/system_info.py
Outdated
| # FIXME: r not used | ||
| # we don't need the result, but we want | ||
| # the side effect of printing diagnostics | ||
| r = conf.get_info() |
There was a problem hiding this comment.
| r = conf.get_info() | |
| conf.get_info() |
…les in system_info.py
|
can anyone review changes ? |
numpy/f2py/crackfortran.py
Outdated
| if v[0] == '(' and v[-1] == ')': | ||
| # FIXME, unused l looks like potential bug | ||
| l = markoutercomma(v[1:-1]).split('@,@') | ||
| outmess(f'get_parameters[TODO]:' |
There was a problem hiding this comment.
| outmess(f'get_parameters[TODO]:' | |
| outmess(f'get_parameters[TODO]: ' |
Else this will print TODO]:implement with no space
numpy/f2py/crackfortran.py
Outdated
| def analyzeargs(block): | ||
| setmesstext(block) | ||
| implicitrules, attrrules = buildimplicitrules(block) | ||
| implicitrules = buildimplicitrules(block)[0] |
There was a problem hiding this comment.
| implicitrules = buildimplicitrules(block)[0] | |
| implicitrules, _ = buildimplicitrules(block) |
Is probably slightly clearer
this seems to be coming from |
|
Everything besides the f2py seems pretty simple, and I guess Pearu is happy with that. @charris happy to merge? |
|
Thanks @default-303 |
Fixes most of the unused variable linting errors shown in LGTM.
partially closes #19077