def _check_update_montage(info, montage, path=None, update_ch_names=False):
 if (montage is not None):
  if (not isinstance(montage, (string_types, Montage))):
   err = ('Montage must be str, None, or instance of Montage. %s was provided' % type(montage))
   raise TypeError(err)
  if (montage is not None):
   if isinstance(montage, string_types):
    montage = read_montage(montage, path=path)
   _set_montage(info, montage, update_ch_names=update_ch_names)
   missing_positions = []
   exclude = (FIFF.FIFFV_EOG_CH, FIFF.FIFFV_MISC_CH, FIFF.FIFFV_STIM_CH)
   for ch in info['chs']:
    if (not (ch['kind'] in exclude)):
     if (np.unique(ch['loc']).size == 1):
      missing_positions.append(ch['ch_name'])
   if missing_positions:
    raise KeyError(('The following positions are missing from the montage definitions: %s. If those channels lack positions because they are EOG channels use the eog parameter.' % str(missing_positions)))

def _check_update_montage ( info , montage , path = None , update_ch_names = False ) : if ( montage is not None ) : if ( not isinstance ( montage , ( string_types , Montage ) ) ) : err = ( 'Montage must be str, None, or instance of Montage. %s was provided' % type ( montage ) ) raise TypeError ( err ) if ( montage is not None ) : if isinstance ( montage , string_types ) : montage = read_montage ( montage , path = path ) _set_montage ( info , montage , update_ch_names = update_ch_names ) missing_positions = [ ] exclude = ( FIFF . FIFFV_EOG_CH , FIFF . FIFFV_MISC_CH , FIFF . FIFFV_STIM_CH ) for ch in info [ 'chs' ] : if ( not ( ch [ 'kind' ] in exclude ) ) : if ( np . unique ( ch [ 'loc' ] ) . size == 1 ) : missing_positions . append ( ch [ 'ch_name' ] ) if missing_positions : raise KeyError ( ( 'The following positions are missing from the montage definitions: %s. If those channels lack positions because they are EOG channels use the eog parameter.' % str ( missing_positions ) ) )
help eeg readers to add montage .