From 9f0011837d60755e14d899e7fc86b38d68dddfd4 Mon Sep 17 00:00:00 2001 From: Chuck Atkins <chuck.atkins@kitware.com> Date: Tue, 28 Mar 2017 22:06:19 -0400 Subject: [PATCH] Fix flake8 config --- bindings/python/test_hello.py | 52 +++++++++++++++++++---------------- flake8.cfg | 7 +++-- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/bindings/python/test_hello.py b/bindings/python/test_hello.py index a383b573f..c12bb2e4c 100644 --- a/bindings/python/test_hello.py +++ b/bindings/python/test_hello.py @@ -7,38 +7,42 @@ from ADIOSPy import * import numpy as np # Create ADIOS and verify MPI Comm is passed correctly -adios = ADIOSPy( MPI.COMM_WORLD, True ) #Pass communicator and debug flag is True +# Pass communicator and debug flag is True +adios = ADIOSPy(MPI.COMM_WORLD, True) rank = MPI.COMM_WORLD.Get_rank() -size = MPI.COMM_WORLD.Get_size() +size = MPI.COMM_WORLD.Get_size() # User data -myArray = np.array( [1,2,3,4]) +myArray = np.array([1, 2, 3, 4]) -if( rank % 2 == 1 ): # odd ranks only - oddRankArray = np.array( [11.,12.,13.,14.] ) - +if(rank % 2 == 1): # odd ranks only + oddRankArray = np.array([11., 12., 13., 14.]) -# ADIOS Define Variables -ioArray = adios.DefineVariable( "ioArray", [myArray.size], [], [] ) -if( rank % 2 == 1 ): # odd ranks only - ioOddRankArray = adios.DefineVariable( "ioMyFloats", [oddRankArray.size], [], [] ) - +# ADIOS Define Variables +ioArray = adios.DefineVariable("ioArray", [myArray.size], [], []) -#Setup method and print summary +if(rank % 2 == 1): # odd ranks only + ioOddRankArray = adios.DefineVariable( + "ioMyFloats", [oddRankArray.size], [], []) + + +# Setup method and print summary ioSettings = adios.DeclareMethod("adiosSettings") -ioSettings.SetParameters( profile_units = 'mus' ) -ioSettings.AddTransport( 'File', have_metadata_file = 'no', profile_units = 'mus' ) # POSIX is default, just checking +ioSettings.SetParameters(profile_units='mus') +# POSIX is default, just checking +ioSettings.AddTransport('File', have_metadata_file='no', profile_units='mus') + +# Start Engine +# Open files using N-to-N method, None means no new MPI communicator +bpFileWriter = adios.Open("file.bp", "w", ioSettings, None) +bpFileWriter.Write(ioArray, myArray) -#Start Engine -bpFileWriter = adios.Open( "file.bp", "w", ioSettings, None ) # Open files using N-to-N method, None means no new MPI communicator -bpFileWriter.Write( ioArray, myArray ) +if(rank % 2 == 1): + bpFileWriter.Write(ioOddRankArray, oddRankArray) -if( rank % 2 == 1 ): - bpFileWriter.Write( ioOddRankArray, oddRankArray ) - -bpFileWriter.Close( ) +bpFileWriter.Close() -if( rank == 0 ): - print "Done writing " + str( size ) + " bp files" - ioSettings.PrintAll( ) # just prints a summary of Method/Transport parameters +if(rank == 0): + print "Done writing " + str(size) + " bp files" + ioSettings.PrintAll() diff --git a/flake8.cfg b/flake8.cfg index 94cbae63c..a3e81f96b 100644 --- a/flake8.cfg +++ b/flake8.cfg @@ -1,4 +1,5 @@ [flake8] -max-line-length: 80 -max-complexity: 14 -format: pylint +max-line-length = 80 +max-complexity = 14 +format = pylint +ignore = F403,F405,F999 -- GitLab