当前位置: 首页>>代码示例>>Python>>正文


Python controller.setup_logging函数代码示例

本文整理汇总了Python中mozaik.controller.setup_logging函数的典型用法代码示例。如果您正苦于以下问题:Python setup_logging函数的具体用法?Python setup_logging怎么用?Python setup_logging使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setup_logging函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: exportToElphy

def exportToElphy(data_store_location,elphy_export_location,sheets=None,threshold=None):
    import os.path
    if not os.path.isdir(elphy_export_location):
       if os.path.exists(elphy_export_location):
          raise ValueError("The elphy export path is not a directory")
       else:
          os.makedirs(elphy_export_location)
              
    setup_logging()
    data_store = PickledDataStore(load=True,parameters=ParameterSet({'root_directory':data_store_location, 'store_stimuli' : False}))
    ps = MP.parameter_value_list([MP.MozaikParametrized.idd(s) for s in data_store.get_stimuli()],'name')
    for i,sn in enumerate(ps):
        if sheets == None: sheets = data_store.sheets() 
        
        for shn in sheets:
            dsv = param_filter_query(data_store,st_name = sn,sheet_name = shn)
            if dsv.get_stimuli() == []: continue
            varying_parameters = MP.varying_parameters([MP.MozaikParametrized.idd(s) for s in dsv.get_stimuli()])
            
            segments,stimuli = MP.colapse(dsv.get_segments(),[MP.MozaikParametrized.idd(s) for s in dsv.get_stimuli()],parameter_list=['trial'],allow_non_identical_objects=True)
            j = 0 
            for segs,st in zip(segments,stimuli):
                # just make sure all segments are fully loaded, in future this should probably soreted out such that this line can be deleted
                for s in segs: s.load_full()
                
                # create file name:
                filename = "name=" + sn + "#" + "sheet_name=" + shn 
                for pn in varying_parameters:
                    if pn != "trial":
                        filename += "#" + str(pn) + "=" + str(getattr(MP.MozaikParametrized.idd(st),pn)) 
                path = os.path.join(elphy_export_location,filename+".dat")
                
                # if the threshold is defined add spikes into Vms
                if threshold != None:
                    for seg in segs : addSpikes(seg,threshold)
                    
                createFileFromSegmentList( segs, path)
                print "Finished saving file %d/%d for sheet %s and %d-th stimulus" % (j+1,len(segments),shn,i)
                # release segments from memory
                for s in segs: s.release()
                j = j + 1
        print "Finished saving %d/%d stimulus" % (i+1,len(ps))
开发者ID:JoelChavas,项目名称:mozaik-contrib,代码行数:42,代码来源:elphy_export.py

示例2: setup_logging

print sys.argv
import matplotlib
matplotlib.use('Agg')
import os
from mozaik.controller import setup_logging
import mozaik
from mozaik.storage.datastore import Hdf5DataStore,PickledDataStore
from mozaik.tools.mozaik_parametrized import colapse, colapse_to_dictionary, MozaikParametrized
from mozaik.analysis.technical import NeuronAnnotationsToPerNeuronValues
from parameters import ParameterSet
import numpy
from mozaik.storage import queries
from mozaik.controller import Global
Global.root_directory = sys.argv[1]+'/'

setup_logging()

data_store = PickledDataStore(load=True,parameters=ParameterSet({'root_directory':sys.argv[1],'store_stimuli' : False}),replace=True)

NeuronAnnotationsToPerNeuronValues(data_store,ParameterSet({})).analyse()
analog_ids = queries.param_filter_query(data_store,sheet_name="V1_Exc_L4").get_segments()[0].get_stored_esyn_ids()


dsv = queries.param_filter_query(data_store,st_name='FlashedBar')
for ads in dsv.get_analysis_result():
    sid = MozaikParametrized.idd(ads.stimulus_id)
    sid.x=0
    ads.stimulus_id = str(sid)
for seg in dsv.get_segments():    
    sid = MozaikParametrized.idd(seg.annotations['stimulus'])
    sid.x=0
开发者ID:antolikjan,项目名称:mozaik-contrib,代码行数:31,代码来源:export_to_morgan.py


注:本文中的mozaik.controller.setup_logging函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。