merge_machine/abstract_project.py
def read_full_config(self, exclude_modules=['INIT'], exclude_files=['run_info.json']):
        '''
        Put all json files in a single dictionnary (for export)
        '''
        all_dirs = [x for x in os.listdir(self.path_to()) if os.path.isdir(self.path_to(x))]
        
        full_config = dict()
        
        for module in all_dirs:
            all_json_files = [x for x in os.listdir(self.path_to(module)) \
                if (x[-5:]=='.json') and (x not in exclude_files) and (module not in exclude_modules)]
            for file_name in all_json_files:
                file_path = self.path_to(module, file_name)
                with open(file_path) as f:
                    config = json.load(f)
                    if module not in full_config:
                        full_config[module] = {file_name: config}
                    else:
                        full_config[module][file_name] = config
        return full_config

        Put all json files in a single dictionnary (for export)
        
Put all json files in a single dictionnary (for export)
Put all json files in a single dictionnary ( for export )
def read_full_config(self, exclude_modules=['INIT'], exclude_files=['run_info.json']):
        all_dirs = [x for x in os.listdir(self.path_to()) if os.path.isdir(self.path_to(x))]
        full_config = dict()
        for module in all_dirs:
            all_json_files = [x for x in os.listdir(self.path_to(module)) \
                if (x[-5:]=='.json') and (x not in exclude_files) and (module not in exclude_modules)]
            for file_name in all_json_files:
                file_path = self.path_to(module, file_name)
                with open(file_path) as f:
                    config = json.load(f)
                    if module not in full_config:
                        full_config[module] = {file_name: config}
                    else:
                        full_config[module][file_name] = config
        return full_config
def read_full_config ( self , exclude_modules = [ 'INIT' ] , exclude_files = [ 'run_info.json' ] ) : all_dirs = [ x for x in os . listdir ( self . path_to ( ) ) if os . path . isdir ( self . path_to ( x ) ) ] full_config = dict ( ) for module in all_dirs : all_json_files = [ x for x in os . listdir ( self . path_to ( module ) ) if ( x [ - 5 : ] == '.json' ) and ( x not in exclude_files ) and ( module not in exclude_modules ) ] for file_name in all_json_files : file_path = self . path_to ( module , file_name ) with open ( file_path ) as f : config = json . load ( f ) if module not in full_config : full_config [ module ] = { file_name : config } else : full_config [ module ] [ file_name ] = config return full_config
Put all json files in a single dictionnary (for export)
Put all json files in a single dictionnary ( for export )
'''
        Put all json files in a single dictionnary (for export)
        '''
self
exclude_modules
exclude_files