def _dup_coil_set(coils, coord_frame, t):
 if ((t is not None) and (coord_frame != t['from'])):
  raise RuntimeError('transformation frame does not match the coil set')
 coils = deepcopy(coils)
 if (t is not None):
  coord_frame = t['to']
  for coil in coils:
   for key in ('ex', 'ey', 'ez'):
    if (key in coil):
     coil[key] = apply_trans(t['trans'], coil[key], False)
   coil['r0'] = apply_trans(t['trans'], coil['r0'])
   coil['rmag'] = apply_trans(t['trans'], coil['rmag'])
   coil['cosmag'] = apply_trans(t['trans'], coil['cosmag'], False)
   coil['coord_frame'] = t['to']
 return (coils, coord_frame)

def _dup_coil_set ( coils , coord_frame , t ) : if ( ( t is not None ) and ( coord_frame != t [ 'from' ] ) ) : raise RuntimeError ( 'transformation frame does not match the coil set' ) coils = deepcopy ( coils ) if ( t is not None ) : coord_frame = t [ 'to' ] for coil in coils : for key in ( 'ex' , 'ey' , 'ez' ) : if ( key in coil ) : coil [ key ] = apply_trans ( t [ 'trans' ] , coil [ key ] , False ) coil [ 'r0' ] = apply_trans ( t [ 'trans' ] , coil [ 'r0' ] ) coil [ 'rmag' ] = apply_trans ( t [ 'trans' ] , coil [ 'rmag' ] ) coil [ 'cosmag' ] = apply_trans ( t [ 'trans' ] , coil [ 'cosmag' ] , False ) coil [ 'coord_frame' ] = t [ 'to' ] return ( coils , coord_frame )
make a duplicate .