following "prospector -t pep8 -t pyflakes -t dodgy -t profile-validator -t pep257"
This commit is contained in:
parent
e55d0ae3ca
commit
80dc23d93d
|
@ -62,12 +62,12 @@ parser.set_defaults(pole = (0.0,0.0,1.0),
|
|||
|
||||
(options, filenames) = parser.parse_args()
|
||||
|
||||
input = [options.eulers != None,
|
||||
options.a != None and \
|
||||
options.b != None and \
|
||||
options.c != None,
|
||||
options.matrix != None,
|
||||
options.quaternion != None,
|
||||
input = [options.eulers is not None,
|
||||
options.a is not None and \
|
||||
options.b is not None and \
|
||||
options.c is not None,
|
||||
options.matrix is not None,
|
||||
options.quaternion is not None,
|
||||
]
|
||||
|
||||
if np.sum(input) != 1: parser.error('needs exactly one input format.')
|
||||
|
|
|
@ -39,14 +39,14 @@ parser.set_defaults(offset = 0,
|
|||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.label == None:
|
||||
if options.label is None:
|
||||
parser.error('no data columns specified.')
|
||||
if options.map == None:
|
||||
if options.map is None:
|
||||
parser.error('no mapping column given.')
|
||||
|
||||
# ------------------------------------------ process mapping ASCIItable ---------------------------
|
||||
|
||||
if options.asciitable != None and os.path.isfile(options.asciitable):
|
||||
if options.asciitable is not None and os.path.isfile(options.asciitable):
|
||||
|
||||
mappedTable = damask.ASCIItable(name = options.asciitable,
|
||||
buffered = False, readonly = True)
|
||||
|
|
|
@ -43,7 +43,7 @@ parser.set_defaults(norm = 'frobenius',
|
|||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.label == None:
|
||||
if options.label is None:
|
||||
parser.error('no data column specified.')
|
||||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
|
|
@ -74,12 +74,12 @@ options.output = map(lambda x: x.lower(), options.output)
|
|||
if options.output == [] or (not set(options.output).issubset(set(outputChoices))):
|
||||
parser.error('output must be chosen from {}.'.format(', '.join(outputChoices)))
|
||||
|
||||
input = [options.eulers != None,
|
||||
options.a != None and \
|
||||
options.b != None and \
|
||||
options.c != None,
|
||||
options.matrix != None,
|
||||
options.quaternion != None,
|
||||
input = [options.eulers is not None,
|
||||
options.a is not None and \
|
||||
options.b is not None and \
|
||||
options.c is not None,
|
||||
options.matrix is not None,
|
||||
options.quaternion is not None,
|
||||
]
|
||||
|
||||
if np.sum(input) != 1: parser.error('needs exactly one input format.')
|
||||
|
|
|
@ -62,12 +62,12 @@ parser.set_defaults(pole = (1.0,0.0,0.0),
|
|||
|
||||
(options, filenames) = parser.parse_args()
|
||||
|
||||
input = [options.eulers != None,
|
||||
options.a != None and \
|
||||
options.b != None and \
|
||||
options.c != None,
|
||||
options.matrix != None,
|
||||
options.quaternion != None,
|
||||
input = [options.eulers is not None,
|
||||
options.a is not None and \
|
||||
options.b is not None and \
|
||||
options.c is not None,
|
||||
options.matrix is not None,
|
||||
options.quaternion is not None,
|
||||
]
|
||||
|
||||
if np.sum(input) != 1: parser.error('needs exactly one input format.')
|
||||
|
@ -133,7 +133,7 @@ for name in filenames:
|
|||
rotatedPole = o.quaternion*pole # rotate pole according to crystal orientation
|
||||
(x,y) = rotatedPole[0:2]/(1.+abs(pole[2])) # stereographic projection
|
||||
|
||||
table.data_append([np.sqrt(x*x+y*y),np.arctan2(y,x)] if options.polar else [x,y]) # cartesian coordinates
|
||||
table.data_append([np.sqrt(x*x+y*y),np.arctan2(y,x)] if options.polar else [x,y]) # cartesian coordinates
|
||||
|
||||
outputAlive = table.data_write() # output processed line
|
||||
|
||||
|
|
|
@ -26,14 +26,14 @@ parser.set_defaults(frame = None)
|
|||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.frame == None:
|
||||
if options.frame is None:
|
||||
parser.error('no data column specified...')
|
||||
|
||||
datainfo = {'len':4,
|
||||
'label':[]
|
||||
}
|
||||
|
||||
if options.frame != None: datainfo['label'] += options.frame
|
||||
if options.frame is not None: datainfo['label'] += options.frame
|
||||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ slipdirection = { \
|
|||
}
|
||||
|
||||
def applyEulers(phi1,Phi,phi2,x):
|
||||
""" transform x given in crystal coordinates to xbar returned in lab coordinates for Euler angles phi1,Phi,phi2 """
|
||||
"""transform x given in crystal coordinates to xbar returned in lab coordinates for Euler angles phi1,Phi,phi2"""
|
||||
|
||||
eulerRot = [[ math.cos(phi1)*math.cos(phi2) - math.cos(Phi)*math.sin(phi1)*math.sin(phi2),
|
||||
-math.cos(phi1)*math.sin(phi2) - math.cos(Phi)*math.cos(phi2)*math.sin(phi1),
|
||||
|
@ -285,8 +285,8 @@ datainfo = {
|
|||
datainfo['vector']['label'] += [options.eulers]
|
||||
|
||||
toRadians = math.pi/180.0 if options.degrees else 1.0 # rescale degrees to radians
|
||||
|
||||
if options.lattice=='hex': # Convert 4 Miller indices notation of hex to orthogonal 3 Miller indices notation
|
||||
# Convert 4 Miller indices notation of hex to orthogonal 3 Miller indices notation
|
||||
if options.lattice=='hex':
|
||||
for i in range(Nslipsystems[options.lattice]):
|
||||
slipnormal[options.lattice][i][0]=slipnormal_temp[i][0]
|
||||
slipnormal[options.lattice][i][1]=(slipnormal_temp[i][0]+2.0*slipnormal_temp[i][1])/math.sqrt(3.0)
|
||||
|
|
|
@ -25,7 +25,7 @@ parser.add_option('-t','--tensor',
|
|||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.tensor == None:
|
||||
if options.tensor is None:
|
||||
parser.error('no data column specified.')
|
||||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
|
|
@ -10,7 +10,7 @@ scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
|||
scriptID = ' '.join([scriptName,damask.version])
|
||||
|
||||
def operator(stretch,strain,eigenvalues):
|
||||
''' Albrecht Bertram: Elasticity and Plasticity of Large Deformations An Introduction (3rd Edition, 2012), p. 102 '''
|
||||
"""Albrecht Bertram: Elasticity and Plasticity of Large Deformations An Introduction (3rd Edition, 2012), p. 102"""
|
||||
return {
|
||||
'V#ln': np.log(eigenvalues) ,
|
||||
'U#ln': np.log(eigenvalues) ,
|
||||
|
@ -75,7 +75,7 @@ if options.logarithmic: strains.append('ln')
|
|||
if options.biot: strains.append('Biot')
|
||||
if options.green: strains.append('Green')
|
||||
|
||||
if options.defgrad == None:
|
||||
if options.defgrad is None:
|
||||
parser.error('no data column specified.')
|
||||
|
||||
# --- loop over input files -------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue