lib/transient.py
def import_files(self, files, append=False, key_parameter=None, description=None):
        """imports any series of data files. Files can be:
               - string of full path of a single scan
               - list of full paths of a single scan
               - folder from which all files will be imported
           - append : if true, appends new scans to object, if false overwrites.
        """
        if not append:
            self.transients = []  # clear scans in memory
            # check if 'files' is single file (str), list of files ([str,str,...]) or folder containing files.
        if isinstance(files, str):
            self.transients.append(Transient(key_parameter=key_parameter, description=description))
            self.transients[-1].import_file(files)
            print('Imported file ' + files)
        elif isinstance(files, list) or isinstance(files, tuple):
            for i in range(len(files)):
                self.transients.append(Transient(key_parameter=key_parameter, description=description))
                self.transients[-1].import_file(files[i])
            print('Imported files form list')
        elif os.path.isdir(files):
            folderlist = os.listdir(files)
            for i in range(len(folderlist)):
                fullpath = files + '//' + folderlist[i]
                self.transients.append(Transient(key_parameter=key_parameter, description=description))
                self.transients[-1].import_file(fullpath)
                print('Imported files form folder')
        self.import_metadata_from_transients()
        # self.key_parameter = self.get_dependence_parameter()
        # self.sort_scan_list_by_parameter()  # todo: uncomment when get dependence parmater is fixed

        # %% data analysis
imports any series of data files. Files can be:
               - string of full path of a single scan
               - list of full paths of a single scan
               - folder from which all files will be imported
           - append : if true, appends new scans to object, if false overwrites.
        
imports any series of data files. Files can be:
string of full path of a single scan
list of full paths of a single scan
folder from which all files will be imported
append : if true, appends new scans to object, if false overwrites.
imports any series of data files . Files can be : string of full path of a single scan list of full paths of a single scan folder from which all files will be imported append : if true appends new scans to object if false overwrites .
def import_files(self, files, append=False, key_parameter=None, description=None):
        if not append:
            self.transients = []  
        if isinstance(files, str):
            self.transients.append(Transient(key_parameter=key_parameter, description=description))
            self.transients[-1].import_file(files)
            print('Imported file ' + files)
        elif isinstance(files, list) or isinstance(files, tuple):
            for i in range(len(files)):
                self.transients.append(Transient(key_parameter=key_parameter, description=description))
                self.transients[-1].import_file(files[i])
            print('Imported files form list')
        elif os.path.isdir(files):
            folderlist = os.listdir(files)
            for i in range(len(folderlist)):
                fullpath = files + '//' + folderlist[i]
                self.transients.append(Transient(key_parameter=key_parameter, description=description))
                self.transients[-1].import_file(fullpath)
                print('Imported files form folder')
        self.import_metadata_from_transients()
def import_files ( self , files , append = False , key_parameter = None , description = None ) : if not append : self . transients = [ ] if isinstance ( files , str ) : self . transients . append ( Transient ( key_parameter = key_parameter , description = description ) ) self . transients [ - 1 ] . import_file ( files ) print ( 'Imported file ' + files ) elif isinstance ( files , list ) or isinstance ( files , tuple ) : for i in range ( len ( files ) ) : self . transients . append ( Transient ( key_parameter = key_parameter , description = description ) ) self . transients [ - 1 ] . import_file ( files [ i ] ) print ( 'Imported files form list' ) elif os . path . isdir ( files ) : folderlist = os . listdir ( files ) for i in range ( len ( folderlist ) ) : fullpath = files + '//' + folderlist [ i ] self . transients . append ( Transient ( key_parameter = key_parameter , description = description ) ) self . transients [ - 1 ] . import_file ( fullpath ) print ( 'Imported files form folder' ) self . import_metadata_from_transients ( )
imports any series of data files.
imports any series of data files .
"""imports any series of data files. Files can be:
               - string of full path of a single scan
               - list of full paths of a single scan
               - folder from which all files will be imported
           - append : if true, appends new scans to object, if false overwrites.
        """ # clear scans in memory # check if 'files' is single file (str), list of files ([str,str,...]) or folder containing files. # self.key_parameter = self.get_dependence_parameter() # self.sort_scan_list_by_parameter()  # todo: uncomment when get dependence parmater is fixed # %% data analysis
self
files
append
key_parameter
description