nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
745 stars 529 forks source link

pep8 violations Nov2017 #2306

Closed djarecka closed 6 years ago

djarecka commented 6 years ago

I'm closing an old issue #597 and providing a new list of files that returns errors and warnings with flake8.

Below is the output of

for f in `find . -name "*.py" ! -name "test_auto*"`; do count=`flake8 $f | wc -l`; if [ $count -gt 0 ]; then echo -n "    $count    "; echo $f; fi; done | sort -r

for py3. note that I removed auto tests that should be changed in checkspecs.py:

         361    ./nipype/workflows/smri/freesurfer/autorecon3.py
         354    ./nipype/interfaces/brainsuite/brainsuite.py
         313    ./nipype/interfaces/ants/segmentation.py
         296    ./nipype/interfaces/ants/registration.py
         289    ./nipype/interfaces/mipav/developer.py
         279    ./nipype/interfaces/semtools/diffusion/gtract.py
         249    ./nipype/interfaces/camino/dti.py
         221    ./nipype/interfaces/freesurfer/utils.py
         204    ./nipype/workflows/smri/freesurfer/recon.py
         203    ./nipype/workflows/smri/freesurfer/autorecon2.py
         185    ./nipype/interfaces/semtools/utilities/brains.py
         183    ./nipype/interfaces/afni/utils.py
         181    ./nipype/workflows/dmri/mrtrix/connectivity_mapping.py
         171    ./nipype/interfaces/semtools/segmentation/specialized.py
         153    ./nipype/interfaces/freesurfer/preprocess.py
         150    ./nipype/workflows/dmri/camino/connectivity_mapping.py
         145    ./nipype/interfaces/afni/preprocess.py
         140    ./nipype/interfaces/cmtk/cmtk.py
         136    ./nipype/workflows/fmri/fsl/preprocess.py
         136    ./examples/dmri_connectivity.py
         135    ./nipype/interfaces/slicer/legacy/registration.py
         135    ./nipype/interfaces/freesurfer/model.py
         133    ./examples/dmri_connectivity_advanced.py
         130    ./nipype/workflows/smri/ants/antsRegistrationBuildTemplate.py
         124    ./nipype/interfaces/io.py
         124    ./nipype/algorithms/tests/test_moments.py
         119    ./nipype/interfaces/slicer/registration/specialized.py
         119    ./nipype/interfaces/slicer/diffusion/diffusion.py
         119    ./nipype/interfaces/semtools/diffusion/diffusion.py
         114    ./nipype/interfaces/semtools/registration/specialized.py
         109    ./nipype/workflows/dmri/fsl/epi.py
         107    ./nipype/workflows/smri/freesurfer/autorecon1.py
         106    ./nipype/interfaces/fsl/__init__.py
          99    ./nipype/interfaces/mrtrix/tensors.py
          97    ./nipype/workflows/smri/ants/ANTSBuildTemplate.py
          95    ./nipype/interfaces/freesurfer/__init__.py
          91    ./nipype/interfaces/camino/odf.py
          91    ./nipype/interfaces/camino/convert.py
          89    ./nipype/interfaces/semtools/filtering/featuredetection.py
          87    ./nipype/interfaces/semtools/registration/brainsfit.py
          82    ./nipype/workflows/dmri/connectivity/group_connectivity.py
          81    ./nipype/interfaces/cmtk/nx.py
          80    ./nipype/interfaces/slicer/registration/brainsfit.py
          79    ./nipype/pipeline/engine/workflows.py
          77    ./nipype/algorithms/confounds.py
          75    ./nipype/interfaces/minc/minc.py
          74    ./nipype/interfaces/ants/resampling.py
          73    ./nipype/interfaces/afni/__init__.py
          73    ./examples/fmri_ants_openfmri.py
          71    ./nipype/interfaces/mrtrix/tracking.py
          71    ./nipype/interfaces/mrtrix/preprocess.py
          71    ./nipype/interfaces/base.py
          67    ./nipype/interfaces/tests/test_io.py
          66    ./nipype/pipeline/engine/tests/test_engine.py
          63    ./nipype/interfaces/slicer/surface.py
          62    ./nipype/pipeline/engine/nodes.py
          61    ./nipype/interfaces/slicer/segmentation/specialized.py
          59    ./examples/rsfmri_vol_surface_preprocessing_nipy.py
          58    ./nipype/interfaces/ants/tests/test_resampling.py
          56    ./nipype/interfaces/fsl/fix.py
          56    ./examples/fmri_spm_face.py
          55    ./nipype/interfaces/tests/test_base.py
          54    ./nipype/utils/draw_gantt_chart.py
          54    ./nipype/interfaces/fsl/model.py
          53    ./nipype/workflows/smri/freesurfer/utils.py
          53    ./nipype/interfaces/fsl/tests/test_maths.py
          53    ./examples/fmri_spm_dartel.py
          50    ./nipype/interfaces/slicer/generate_classes.py
          49    ./nipype/workflows/dmri/fsl/tests/test_tbss.py
          48    ./nipype/interfaces/ants/legacy.py
          47    ./nipype/algorithms/tests/test_modelgen.py
          45    ./examples/rsfmri_vol_surface_preprocessing.py
          45    ./examples/fmri_spm_auditory.py
          44    ./nipype/interfaces/slicer/filtering/arithmetic.py
          43    ./nipype/interfaces/semtools/diffusion/tractography/ukftractography.py
          42    ./nipype/interfaces/camino/calib.py
          42    ./doc/conf.py
          41    ./examples/dmri_mrtrix_dti.py
          40    ./nipype/workflows/fmri/spm/preprocess.py
          40    ./nipype/interfaces/petpvc.py
          40    ./nipype/algorithms/tests/test_compcor.py
          40    ./nipype/algorithms/modelgen.py
          40    ./examples/smri_antsregistration_build_template.py
          39    ./nipype/workflows/dmri/camino/diffusion.py
          39    ./nipype/interfaces/semtools/brains/utilities.py
          39    ./nipype/interfaces/diffusion_toolkit/dti.py
          38    ./nipype/workflows/dmri/fsl/tbss.py
          38    ./nipype/pipeline/engine/utils.py
          38    ./nipype/interfaces/meshfix.py
          36    ./nipype/workflows/dmri/connectivity/nx.py
          36    ./nipype/utils/nipype2boutiques.py
          36    ./nipype/pipeline/plugins/sge.py
          36    ./nipype/interfaces/slicer/filtering/denoising.py
          36    ./nipype/interfaces/diffusion_toolkit/odf.py
          36    ./examples/fmri_freesurfer_smooth.py
          36    ./examples/dmri_group_connectivity_mrtrix.py
          36    ./examples/dmri_camino_dti.py
          35    ./nipype/workflows/smri/freesurfer/ba_maps.py
          34    ./nipype/workflows/dmri/mrtrix/group_connectivity.py
          34    ./nipype/interfaces/traits_extension.py
          34    ./nipype/interfaces/camino/__init__.py
          33    ./nipype/interfaces/spm/__init__.py
          33    ./nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py
          33    ./nipype/interfaces/fsl/tests/test_preprocess.py
          33    ./nipype/interfaces/dcm2nii.py
          32    ./nipype/interfaces/semtools/diffusion/__init__.py
          32    ./nipype/interfaces/semtools/brains/segmentation.py
          32    ./examples/fmri_spm_nested.py
          31    ./nipype/pipeline/engine/tests/test_utils.py
          31    ./nipype/interfaces/freesurfer/tests/test_preprocess.py
          31    ./examples/fmri_spm.py
          30    ./nipype/interfaces/spm/model.py
          30    ./nipype/interfaces/minc/__init__.py
          30    ./nipype/interfaces/cmtk/parcellation.py
          29    ./examples/workshop_dartmouth_2010.py
          29    ./examples/dmri_group_connectivity_camino.py
          28    ./nipype/utils/provenance.py
          28    ./nipype/pipeline/engine/tests/test_join.py
          28    ./nipype/external/cloghandler.py
          27    ./nipype/sphinxext/plot_workflow.py
          27    ./nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py
          27    ./nipype/algorithms/rapidart.py
          27    ./nipype/algorithms/misc.py
          26    ./nipype/interfaces/nipy/model.py
          26    ./nipype/interfaces/mrtrix/convert.py
          26    ./nipype/interfaces/mrtrix/__init__.py
          26    ./nipype/interfaces/dynamic_slicer.py
          26    ./nipype/__init__.py
          25    ./nipype/workflows/dmri/camino/group_connectivity.py
          25    ./nipype/utils/tests/test_cmd.py
          25    ./nipype/interfaces/utility/base.py
          25    ./nipype/interfaces/slicer/filtering/morphology.py
          25    ./nipype/interfaces/semtools/filtering/denoising.py
          25    ./nipype/interfaces/semtools/diffusion/tractography/fibertrack.py
          25    ./nipype/interfaces/nilearn.py
          25    ./nipype/interfaces/fsl/tests/test_dti.py
          25    ./nipype/interfaces/freesurfer/tests/test_utils.py
          25    ./nipype/interfaces/ants/__init__.py
          25    ./nipype/algorithms/metrics.py
          25    ./examples/smri_ants_build_template.py
          24    ./nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py
          24    ./nipype/interfaces/slicer/converters.py
          23    ./nipype/workflows/dmri/mrtrix/diffusion.py
          23    ./nipype/interfaces/slicer/legacy/filtering.py
          23    ./nipype/interfaces/slicer/filtering/__init__.py
          23    ./nipype/interfaces/semtools/registration/brainsresample.py
          23    ./nipype/interfaces/cmtk/convert.py
          23    ./examples/fmri_fsl.py
          22    ./nipype/interfaces/slicer/registration/brainsresample.py
          22    ./nipype/interfaces/slicer/__init__.py
          22    ./nipype/interfaces/fsl/preprocess.py
          21    ./nipype/workflows/dmri/fsl/__init__.py
          21    ./nipype/interfaces/semtools/utilities/__init__.py
          21    ./nipype/interfaces/fsl/utils.py
          21    ./nipype/interfaces/fsl/tests/test_utils.py
          21    ./nipype/interfaces/ants/utils.py
          20    ./nipype/interfaces/spm/preprocess.py
          20    ./nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py
          20    ./nipype/interfaces/slicer/legacy/diffusion/denoising.py
          20    ./nipype/interfaces/slicer/filtering/histogrammatching.py
          20    ./nipype/interfaces/semtools/filtering/__init__.py
          20    ./nipype/interfaces/mipav/__init__.py
          20    ./nipype/interfaces/freesurfer/registration.py
          20    ./nipype/interfaces/cmtk/nbs.py
          20    ./nipype/interfaces/afni/model.py
          20    ./examples/fmri_nipy_glm.py
          20    ./examples/fmri_fsl_reuse.py
          19    ./nipype/pipeline/plugins/__init__.py
          19    ./nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py
          19    ./nipype/interfaces/slicer/filtering/extractskeleton.py
          19    ./nipype/interfaces/semtools/brains/classify.py
          19    ./nipype/interfaces/semtools/__init__.py
          19    ./nipype/interfaces/nipy/preprocess.py
          19    ./nipype/interfaces/fsl/aroma.py
          18    ./nipype/interfaces/slicer/quantification/changequantification.py
          18    ./nipype/interfaces/semtools/converters.py
          18    ./nipype/interfaces/ants/visualization.py
          17    ./nipype/pipeline/plugins/slurmgraph.py
          17    ./nipype/pipeline/plugins/sgegraph.py
          17    ./nipype/interfaces/slicer/legacy/segmentation.py
          17    ./nipype/interfaces/semtools/legacy/registration.py
          17    ./nipype/interfaces/dipy/reconstruction.py
          17    ./nipype/interfaces/camino/connectivity.py
          17    ./examples/fmri_fsl_feeds.py
          16    ./nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py
          16    ./nipype/interfaces/slicer/filtering/thresholdscalarvolume.py
          16    ./nipype/interfaces/afni/svm.py
          15    ./tools/checkspecs.py
          15    ./nipype/interfaces/tests/test_nilearn.py
          15    ./nipype/interfaces/matlab.py
          15    ./nipype/interfaces/brainsuite/__init__.py
          15    ./nipype/interfaces/ants/tests/test_spec_JointFusion.py
          14    ./nipype/utils/tests/test_filemanip.py
          14    ./nipype/utils/misc.py
          14    ./nipype/interfaces/slicer/filtering/imagelabelcombine.py
          14    ./nipype/interfaces/slicer/filtering/checkerboardfilter.py
          14    ./nipype/interfaces/semtools/registration/brainsresize.py
          14    ./nipype/interfaces/nitime/analysis.py
          14    ./nipype/interfaces/mrtrix3/__init__.py
          14    ./nipype/interfaces/mipav/generate_classes.py
          14    ./nipype/interfaces/fsl/possum.py
          13    ./nipype/testing/fixtures.py
          13    ./nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py
          13    ./nipype/pipeline/plugins/multiproc.py
          13    ./nipype/interfaces/slicer/legacy/__init__.py
          13    ./doc/sphinxext/numpy_ext/numpydoc.py
          12    ./tools/make_examples.py
          12    ./nipype/workflows/fmri/fsl/estimate.py
          12    ./nipype/pipeline/plugins/tests/test_tools.py
          12    ./nipype/pipeline/engine/tests/test_workflows.py
          12    ./nipype/interfaces/slicer/utilities.py
          12    ./nipype/interfaces/semtools/testing/landmarkscompare.py
          12    ./nipype/interfaces/niftyseg/__init__.py
          12    ./nipype/interfaces/elastix/utils.py
          11    ./tools/github.py
          11    ./nipype/pipeline/plugins/ipython.py
          11    ./nipype/pipeline/plugins/base.py
          11    ./nipype/interfaces/slicer/legacy/converters.py
          11    ./nipype/interfaces/semtools/testing/generateaveragelmkfile.py
          11    ./nipype/interfaces/semtools/testing/featuredetection.py
          11    ./nipype/interfaces/semtools/diffusion/maxcurvature.py
          11    ./nipype/interfaces/fsl/dti.py
          11    ./nipype/interfaces/elastix/registration.py
          11    ./nipype/interfaces/dipy/__init__.py
          11    ./nipype/interfaces/camino2trackvis/convert.py
          11    ./nipype/interfaces/camino/utils.py
          10    ./nipype/workflows/rsfmri/fsl/resting.py
          10    ./nipype/workflows/dmri/fsl/utils.py
          10    ./nipype/pipeline/plugins/pbs.py
          10    ./nipype/interfaces/utility/tests/test_wrappers.py
          10    ./nipype/interfaces/tests/test_resource_monitor.py
          10    ./nipype/interfaces/tests/test_matlab.py
          10    ./nipype/interfaces/spm/tests/test_utils.py
          10    ./nipype/interfaces/spm/tests/test_base.py
          10    ./nipype/interfaces/slicer/diffusion/__init__.py
          10    ./nipype/interfaces/semtools/featurecreator.py
          10    ./nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py
          10    ./nipype/interfaces/niftyreg/__init__.py
          10    ./nipype/interfaces/fsl/tests/test_model.py
          10    ./nipype/interfaces/fsl/tests/test_base.py
          10    ./nipype/interfaces/fsl/tests/test_FILMGLS.py
          10    ./nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py
          10    ./examples/test_spm.py
          10    ./examples/tessellation_tutorial.py
          10    ./examples/frontiers_paper/smoothing_comparison.py
          10    ./doc/sphinxext/numpy_ext/docscrape.py
           9    ./nipype/utils/tests/test_provenance.py
           9    ./nipype/interfaces/vista/vista.py
           9    ./nipype/interfaces/utility/wrappers.py
           9    ./nipype/interfaces/utility/tests/test_base.py
           9    ./nipype/interfaces/semtools/segmentation/__init__.py
           9    ./nipype/interfaces/cmtk/__init__.py
           9    ./nipype/interfaces/__init__.py
           9    ./examples/smri_ants_registration.py
           9    ./examples/dmri_fsl_dti.py
           9    ./build_docs.py
           8    ./setup.py
           8    ./nipype/workflows/fmri/fsl/__init__.py
           8    ./nipype/workflows/dmri/connectivity/__init__.py
           8    ./nipype/utils/nipype_cmd.py
           8    ./nipype/utils/config.py
           8    ./nipype/scripts/cli.py
           8    ./nipype/pkg_info.py
           8    ./nipype/pipeline/plugins/dagman.py
           8    ./nipype/interfaces/utility/__init__.py
           8    ./nipype/interfaces/spm/base.py
           8    ./nipype/interfaces/semtools/brains/__init__.py
           8    ./nipype/interfaces/mne/base.py
           8    ./nipype/interfaces/diffusion_toolkit/postproc.py
           8    ./nipype/interfaces/diffusion_toolkit/__init__.py
           8    ./nipype/interfaces/afni/base.py
           7    ./nipype/workflows/smri/freesurfer/__init__.py
           7    ./nipype/utils/tests/test_functions.py
           7    ./nipype/utils/filemanip.py
           7    ./nipype/pipeline/plugins/tests/test_callback.py
           7    ./nipype/pipeline/plugins/slurm.py
           7    ./nipype/pipeline/plugins/lsf.py
           7    ./nipype/pipeline/engine/base.py
           7    ./nipype/interfaces/spm/tests/test_preprocess.py
           7    ./nipype/interfaces/slicer/registration/__init__.py
           7    ./nipype/interfaces/semtools/registration/__init__.py
           7    ./nipype/interfaces/fsl/tests/test_Level1Design_functions.py
           7    ./nipype/interfaces/dcmstack.py
           7    ./nipype/external/portalocker.py
           7    ./nipype/external/fsl_imglob.py
           7    ./nipype/algorithms/tests/test_confounds.py
           7    ./doc/sphinxext/ipython_console_highlighting.py
           7    ./doc/sphinxext/autosummary_generate.py
           6    ./nipype/workflows/dmri/fsl/tests/test_epi.py
           6    ./nipype/workflows/dmri/fsl/tests/test_dti.py
           6    ./nipype/utils/tests/test_config.py
           6    ./nipype/testing/decorators.py
           6    ./nipype/interfaces/utility/csv.py
           6    ./nipype/interfaces/tests/test_bids.py
           6    ./nipype/interfaces/nipy/__init__.py
           6    ./nipype/interfaces/fsl/epi.py
           6    ./nipype/interfaces/freesurfer/longitudinal.py
           6    ./nipype/interfaces/bru2nii.py
           6    ./nipype/info.py
           6    ./nipype/caching/memory.py
           6    ./nipype/algorithms/tests/test_errormap.py
           6    ./nipype/algorithms/mesh.py
           6    ./nipype/algorithms/icc.py
           6    ./examples/fmri_slicer_coregistration.py
           6    ./examples/dmri_tbss_nki.py
           6    ./examples/dmri_preprocessing.py
           6    ./examples/dmri_dtk_odf.py
           6    ./examples/dmri_dtk_dti.py
           5    ./nipype/workflows/rsfmri/fsl/tests/test_resting.py
           5    ./nipype/workflows/misc/utils.py
           5    ./nipype/workflows/dmri/__init__.py
           5    ./nipype/utils/tests/test_misc.py
           5    ./nipype/utils/profiler.py
           5    ./nipype/utils/logger.py
           5    ./nipype/utils/__init__.py
           5    ./nipype/scripts/crash_files.py
           5    ./nipype/pipeline/engine/__init__.py
           5    ./nipype/pipeline/__init__.py
           5    ./nipype/interfaces/slicer/segmentation/__init__.py
           5    ./nipype/interfaces/niftyseg/maths.py
           5    ./nipype/interfaces/minc/base.py
           5    ./nipype/interfaces/elastix/__init__.py
           5    ./nipype/interfaces/dipy/simulate.py
           5    ./nipype/algorithms/tests/test_misc.py
           5    ./examples/smri_cbs_skullstripping.py
           5    ./examples/frontiers_paper/workflow_from_scratch.py
           4    ./tools/toollib.py
           4    ./tools/run_examples.py
           4    ./tools/gitwash_dumper.py
           4    ./nipype/workflows/smri/__init__.py
           4    ./nipype/workflows/dmri/fsl/dti.py
           4    ./nipype/testing/__init__.py
           4    ./nipype/scripts/utils.py
           4    ./nipype/pipeline/plugins/ipythonx.py
           4    ./nipype/interfaces/spm/utils.py
           4    ./nipype/interfaces/semtools/diffusion/tractography/__init__.py
           4    ./nipype/interfaces/nipy/utils.py
           4    ./nipype/interfaces/niftyfit/__init__.py
           4    ./nipype/interfaces/fsl/tests/test_epi.py
           4    ./nipype/interfaces/freesurfer/base.py
           4    ./nipype/interfaces/cmtk/tests/test_nbs.py
           4    ./nipype/algorithms/tests/test_tsnr.py
           4    ./nipype/algorithms/tests/test_rapidart.py
           4    ./nipype/algorithms/tests/test_normalize_tpms.py
           3    ./nipype/workflows/smri/niftyreg/__init__.py
           3    ./nipype/workflows/smri/ants/__init__.py
           3    ./nipype/workflows/fmri/spm/__init__.py
           3    ./nipype/workflows/fmri/__init__.py
           3    ./nipype/workflows/dmri/mrtrix/__init__.py
           3    ./nipype/workflows/dmri/camino/__init__.py
           3    ./nipype/utils/functions.py
           3    ./nipype/testing/utils.py
           3    ./nipype/testing/tests/test_utils.py
           3    ./nipype/scripts/instance.py
           3    ./nipype/pipeline/plugins/tests/test_base.py
           3    ./nipype/pipeline/plugins/oar.py
           3    ./nipype/interfaces/slicer/quantification/__init__.py
           3    ./nipype/interfaces/semtools/testing/__init__.py
           3    ./nipype/interfaces/nitime/__init__.py
           3    ./nipype/interfaces/minc/testdata.py
           3    ./nipype/interfaces/fsl/maths.py
           3    ./nipype/interfaces/fsl/base.py
           3    ./nipype/interfaces/freesurfer/tests/test_model.py
           3    ./nipype/interfaces/dipy/tensors.py
           3    ./nipype/interfaces/ants/base.py
           3    ./nipype/conftest.py
           3    ./nipype/algorithms/tests/test_mesh_ops.py
           3    ./examples/howto_caching_example.py
           2    ./nipype/workflows/smri/niftyreg/groupwise.py
           2    ./nipype/workflows/rsfmri/__init__.py
           2    ./nipype/workflows/dmri/dipy/denoise.py
           2    ./nipype/utils/onetime.py
           2    ./nipype/utils/docparse.py
           2    ./nipype/tests/test_nipype.py
           2    ./nipype/pipeline/plugins/tests/test_somaflow.py
           2    ./nipype/pipeline/plugins/tests/test_pbs.py
           2    ./nipype/pipeline/plugins/tests/test_debug.py
           2    ./nipype/pipeline/plugins/somaflow.py
           2    ./nipype/pipeline/plugins/linear.py
           2    ./nipype/pipeline/plugins/condor.py
           2    ./nipype/interfaces/vtkbase.py
           2    ./nipype/interfaces/vista/__init__.py
           2    ./nipype/interfaces/setup.py
           2    ./nipype/interfaces/nitime/tests/test_nitime.py
           2    ./nipype/interfaces/niftyseg/stats.py
           2    ./nipype/interfaces/niftyseg/label_fusion.py
           2    ./nipype/interfaces/niftyseg/em.py
           2    ./nipype/interfaces/mrtrix3/utils.py
           2    ./nipype/interfaces/mrtrix3/connectivity.py
           2    ./nipype/interfaces/mrtrix3/base.py
           2    ./nipype/interfaces/dipy/tracks.py
           2    ./nipype/interfaces/dipy/setup.py
           2    ./nipype/interfaces/dipy/anisotropic_power.py
           2    ./nipype/interfaces/camino2trackvis/__init__.py
           2    ./nipype/interfaces/c3.py
           2    ./nipype/algorithms/tests/test_splitmerge.py
           2    ./nipype/algorithms/tests/test_overlap.py
           2    ./examples/smri_fsreconall.py
           1    ./tools/interfacedocgen.py
           1    ./tools/build_modref_templates.py
           1    ./tools/build_interface_docs.py
           1    ./tools/apigen.py
           1    ./nipype/workflows/smri/freesurfer/bem.py
           1    ./nipype/workflows/rsfmri/fsl/__init__.py
           1    ./nipype/workflows/graph/__init__.py
           1    ./nipype/workflows/fmri/fsl/tests/test_preprocess.py
           1    ./nipype/workflows/dmri/fsl/artifacts.py
           1    ./nipype/workflows/dmri/dipy/__init__.py
           1    ./nipype/workflows/data/__init__.py
           1    ./nipype/utils/tmpdirs.py
           1    ./nipype/utils/tests/test_docparse.py
           1    ./nipype/utils/spm_docs.py
           1    ./nipype/utils/matlabtools.py
           1    ./nipype/sphinxext/__init__.py
           1    ./nipype/scripts/__init__.py
           1    ./nipype/refs.py
           1    ./nipype/pipeline/plugins/tools.py
           1    ./nipype/pipeline/plugins/tests/test_linear.py
           1    ./nipype/pipeline/plugins/semaphore_singleton.py
           1    ./nipype/pipeline/plugins/pbsgraph.py
           1    ./nipype/pipeline/plugins/debug.py
           1    ./nipype/interfaces/spm/tests/test_model.py
           1    ./nipype/interfaces/slicer/legacy/diffusion/__init__.py
           1    ./nipype/interfaces/semtools/legacy/__init__.py
           1    ./nipype/interfaces/niftyseg/patchmatch.py
           1    ./nipype/interfaces/niftyseg/lesions.py
           1    ./nipype/interfaces/niftyseg/base.py
           1    ./nipype/interfaces/mrtrix3/tracking.py
           1    ./nipype/interfaces/mrtrix3/reconst.py
           1    ./nipype/interfaces/mrtrix3/preprocess.py
           1    ./nipype/interfaces/mne/__init__.py
           1    ./nipype/interfaces/freesurfer/tests/test_BBRegister.py
           1    ./nipype/interfaces/elastix/base.py
           1    ./nipype/interfaces/dipy/preprocess.py
           1    ./nipype/interfaces/dipy/base.py
           1    ./nipype/interfaces/diffusion_toolkit/base.py
           1    ./nipype/interfaces/bids_utils.py
           1    ./nipype/external/due.py
           1    ./nipype/caching/tests/test_memory.py
           1    ./nipype/caching/__init__.py
           1    ./nipype/algorithms/tests/test_icc_anova.py

Everyone is welcome to update the files from the list so we're closer to the pep8 standard.

Please leave a comment here if you believe that some error shouldn't/can't be corrected (I saw some old comments in #1264 , but not sure if they are still relevant.

mwaskom commented 6 years ago

Going forward should probably update to pycodestyle (which replaced the pep8 script) or even better, flake8 to get linting too.

effigies commented 6 years ago

:+1: to flake8. Not worth it until we lint the whole tree, but it's pretty easy to add a Travis row to run flake8 on all PRs.

mwaskom commented 6 years ago

Here's an idea of the most common problems:

10476 E124 closing bracket does not match visual indentation
10225 E501 line too long (82 > 79 characters)
10178 E122 continuation line missing indentation or outdented
8833  E128 continuation line under-indented for visual indent
1319  F401 'nipype' imported but unused
249   E402 module level import not at top of file
209   E231 missing whitespace after ','
148   E302 expected 2 blank lines, found 0
96    E127 continuation line over-indented for visual indent
95    F405 'skipif' may be undefined, or defined from star imports: numpy.testing.decorators
78    E303 too many blank lines (2)
64    E305 expected 2 blank lines after class or function definition, found 1
61    F841 local variable 'tblexer' is assigned to but never used
60    E701 multiple statements on one line (colon)
58    W391 blank line at end of file
58    F811 redefinition of unused 'fsl' from line 24
46    E265 block comment should start with '# '
44    E111 indentation is not a multiple of four
43    E261 at least two spaces before inline comment
40    E203 whitespace before ':'
31    E731 do not assign a lambda expression, use a def
22    F403 'from .diffusion import *' used; unable to detect undefined names
17    E711 comparison to None should be 'if cond is None:'
16    F821 undefined name 'freesurfer'
15    E502 the backslash is redundant between brackets
15    E221 multiple spaces before operator
14    E251 unexpected spaces around keyword / parameter equals
13    E225 missing whitespace around operator
11    E262 inline comment should start with '# '
11    E131 continuation line unaligned for hanging indent
9     E712 comparison to True should be 'if cond is True:' or 'if cond:'
7     E401 multiple imports on one line
6     W191 indentation contains tabs
5     E713 test for membership should be 'not in'
5     E272 multiple spaces before keyword
5     E211 whitespace before '('
5     E201 whitespace after '('
4     E301 expected 1 blank line, found 0
4     E202 whitespace before ')'
3     E228 missing whitespace around modulo operator
3     E222 multiple spaces after operator
2     E125 continuation line with same indent as next logical line
2     E101 indentation contains mixed spaces and tabs
1     W292 no newline at end of file
1     F402 import 'op' from line 52 shadowed by loop variable
1     E714 test for object identity should be 'is not'
1     E306 expected 1 blank line before a nested definition, found 0
1     E271 multiple spaces after keyword
1     E266 too many leading '#' for block comment
1     E129 visually indented line with same indent as next logical line
djarecka commented 6 years ago

updated the list to the flake8 output

miykael commented 6 years ago

@mwaskom's list also includes test_auto*.py files. To get the same list without those files, one can use the following command: flake8 -qq --filename=*py --exclude=test_auto* --statistics | sort -rh

The output for this command looks as follows:

10002   E501 line too long (82 > 79 characters)
1319    F401 'nipype' imported but unused
265     E402 module level import not at top of file
209     E231 missing whitespace after ','
176     E128 continuation line under-indented for visual indent
147     E302 expected 2 blank lines, found 1
96      E127 continuation line over-indented for visual indent
95      F999 MRIConvert may be undefined, or defined from star imports: interfaces.freesurfer
78      E303 too many blank lines (2)
72      F841 local variable 'pickfirst' is assigned to but never used
60      E701 multiple statements on one line (colon)
58      F811 redefinition of unused 'fsl' from line 24
52      E124 closing bracket does not match visual indentation
46      E265 block comment should start with '# '
44      E111 indentation is not a multiple of four
43      E261 at least two spaces before inline comment
40      E203 whitespace before ':'
31      E731 do not assign a lambda expression, use a def
23      W391 blank line at end of file
22      F403 'from interfaces.freesurfer import *' used; unable to detect undefined names
17      E711 comparison to None should be 'if cond is not None:'
16      F821 undefined name 'freesurfer'
15      E502 the backslash is redundant between brackets
15      E221 multiple spaces before operator
14      E251 unexpected spaces around keyword / parameter equals
13      E225 missing whitespace around operator
11      E262 inline comment should start with '# '
11      E131 continuation line unaligned for hanging indent
9       E712 comparison to True should be 'if cond is True:' or 'if cond:'
7       E401 multiple imports on one line
6       W191 indentation contains tabs
5       E713 test for membership should be 'not in'
5       E301 expected 1 blank line, found 0
5       E272 multiple spaces before keyword
5       E211 whitespace before '('
5       E201 whitespace after '{'
5       E122 continuation line missing indentation or outdented
4       E202 whitespace before ')'
3       W503 line break before binary operator
3       E228 missing whitespace around modulo operator
3       E222 multiple spaces after operator
2       E125 continuation line with same indent as next logical line
2       E101 indentation contains mixed spaces and tabs
1       W292 no newline at end of file
1       F402 import 'op' from line 52 shadowed by loop variable
1       E714 test for object identity should be 'is not'
1       E271 multiple spaces after keyword
1       E266 too many leading '#' for block comment
1       E129 visually indented line with same indent as next logical line
miykael commented 6 years ago

Is anybody already working on this? I'm happy to dig my teeth into this, but I don't want to interfere with somebody else. If I don't here from anybody in the next few days, than I will start cleaning out this list.

djarecka commented 6 years ago

do we want to keep the default 79 character per line or we want to allow longer lines?

miykael commented 6 years ago

I'm not sure if it makes sense to increase the default of 79 as it is an industry standard. But for completeness, the number of errors would decrease with characters per line as follows:

79  characters allowed per line = 9996 E501 errors
89  characters allowed per line = 5896 E501 errors
99  characters allowed per line = 4063 E501 errors
109 characters allowed per line = 2896 E501 errors

So, I think the issue is kind of persisting. I would rather first try to correct the E501 errors before changing the standard.

As for example in https://github.com/nipy/nipype/blob/master/nipype/interfaces/fsl/fix.py, this file goes up to 284 characters per line and has a total of nine E501.

miykael commented 6 years ago

I tried with https://github.com/nipy/nipype/pull/2358 to correct most PEP8 violations (except E501).

Here's a list of the violations that remain and the reason why they haven't been corrected yet:

Most of the following pyflakes/flake8 errors were not touched, as their handling often implies rather strong code changes/refactoring. For completness, here the name and number of the still open errors:

F401 (N=1347)   'nipype' imported but unused
F999 (N=89)     cd may be undefined, or defined from star imports: toollib
F811 (N=49)     redefinition of unused 'pd' from line 23
F841 (N=33)     local variable 'newfiles' is assigned to but never used
F403 (N=20)     'from toollib import *' used; unable to detect undefined names
F821 (N=16)     undefined name 'freesurfer'

I also didn't attack E402 (N=259) module level import not at top of file , as most of those issues are caused by standard_library.install_aliases() (example) or are coming from a workflow example, where the import often isn't at the beginning of the file.

I also didn't attack 30 errors of type E265 block comment should start with '# ', as they were all in the conf.py file, where this kind of format is prefered.

I also didn't correct 29 errors of the type E731 do not assign a lambda expression, use a def as their correction would mean code modification that are outside the scope of just style correction.

The file nipype/interfaces/freesurfer/tests/test_FSSurfaceCommand.py seems to be auto-generated, but the filename doesn't have the prefix test_auto_. Because of that, this file leads to the following 10 violations:

E122 (N=3) continuation line missing indentation or outdented
E124 (N=4) closing bracket does not match visual indentation
E128 (N=3) continuation line under-indented for visual indent

@effigies, is this file still auto-generated, or can I correct the errors manually?

djarecka commented 6 years ago

@miykael - i don't think test_FSSurfaceCommand.py is auto-generated. it looks like @effigies created this file based on the old auto-test, but it should be now changed manually

miykael commented 6 years ago

@djarecka - ok, great. I updated the file with https://github.com/nipy/nipype/pull/2358/commits/730c1a12eca6a4a49190eee3b549c38152396bd7 to correct the pep8 violations.

effigies commented 6 years ago

Ah, sorry, I missed this buried in the huge pile of notifications coming out of nipype. Yes that is a modified auto test. If there's a better way to organize things so that we don't run into this in the future, let me know. (And maybe it would be good to have in a doc on testing practices.)

djarecka commented 6 years ago

I'm closing this issue now. If there is something more to fix right now, please open a new issue.