scidash / neuronunit

A package for data-driven validation of neuron and ion channel models using SciUnit
http://neuronunit.scidash.org
38 stars 24 forks source link

Not all of prospectors (pylints) warnings about import statements are helpful. #161

Closed russelljjarvis closed 6 years ago

russelljjarvis commented 6 years ago

Many examples of import statements that are indirectly functional follow.

The most concrete example is the new imports we just wrote:

neuronunit/models/backends/__init__.py
  Line: 4
    pyflakes: F401 / '.jNeuroML.jNeuroMLBackend' imported but unused (col 1)
  Line: 5
    pyflakes: F401 / '.neuron.NEURONBackend' imported but unused (col 1)
  Line: 6
    pyflakes: F401 / '.pyNN.pyNNBackend' imported but unused (col 1)

I know that they need to be used, in other files, but pylint is naively looking for evidence of usage in the init.py file itself.

Generally prospector is okay, if you don't take 'unused imports' too seriously.

Use example is below:

!pwd
!prospector 

/home/jovyan/neuronunit/ Messages

. Line: None pylint: failure / Tool pylint failed to run (exception was raised)

neuronunit/init.py Line: 7 pyflakes: F401 / 'sciunit' imported but unused (col 5)

neuronunit/bbp.py Line: 5 pyflakes: F401 / 'sys' imported but unused (col 1) Line: 6 pyflakes: F401 / 'shelve' imported but unused (col 1) Line: 10 pyflakes: F401 / 'numpy as np' imported but unused (col 1) Line: 13 pyflakes: F401 / 'quantities as pq' imported but unused (col 1) Line: 20 pyflakes: F401 / 'urllib.parse.urlencode' imported but unused (col 5) Line: 21 pyflakes: F401 / 'urllib.request.urlopen' imported but unused (col 5)

neuronunit/models/init.py Line: 6 pyflakes: F401 / 'inspect' imported but unused (col 1) Line: 8 pyflakes: F401 / 'random' imported but unused (col 1) Line: 183 pyflakes: F811 / redefinition of unused 'inject_square_current' from line 121 (col 5)

neuronunit/models/backends.py Line: 2 pyflakes: F401 / 'sys' imported but unused (col 1) Line: 4 pyflakes: F401 / 'platform' imported but unused (col 1) Line: 5 pyflakes: F401 / 're' imported but unused (col 1) Line: 6 pyflakes: F401 / 'copy' imported but unused (col 1) Line: 9 pyflakes: F401 / 'importlib' imported but unused (col 1) Line: 11 pyflakes: F401 / 'subprocess' imported but unused (col 1) Line: 13 pyflakes: F401 / 'neuronunit.capabilities as cap' imported but unused (col 1) Line: 14 pyflakes: F401 / 'quantities.nA' imported but unused (col 1) Line: 16 pyflakes: F401 / 'quantities.ms' imported but unused (col 1) pyflakes: F811 / redefinition of unused 'ms' from line 14 (col 1) Line: 17 pyflakes: F401 / 'neo.core.AnalogSignal' imported but unused (col 1) Line: 18 pyflakes: F401 / 'neuronunit.capabilities.spike_functions as sf' imported but unused (col 1) Line: 19 pyflakes: F401 / 'sciunit' imported but unused (col 1) Line: 20 pyflakes: F401 / 'sciunit.utils.import_module_from_path' imported but unused (col 1) Line: 22 pyflakes: F401 / 'neuron' imported but unused (col 5) Line: 23 pyflakes: F401 / 'neuron.h' imported but unused (col 5)

neuronunit/models/backends/init.py Line: 4 pyflakes: F401 / '.jNeuroML.jNeuroMLBackend' imported but unused (col 1) Line: 5 pyflakes: F401 / '.neuron.NEURONBackend' imported but unused (col 1) Line: 6 pyflakes: F401 / '.pyNN.pyNNBackend' imported but unused (col 1)

rgerkin commented 6 years ago

We can just ignore them.