• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python baseneo.BaseNeo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

    def __init__(self, channel_names=None, channel_indexes=None, name=None,
                 description=None, file_origin=None, **annotations):
        """Initialize a new RecordingChannelGroup."""
        # Inherited initialization
        # Sets universally recommended attributes, and places all others
        # in annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        # Defaults
        if channel_indexes is None:
            channel_indexes = np.array([])
        if channel_names is None:
            channel_names = np.array([])

        # Store recommended attributes
        self.channel_names = channel_names
        self.channel_indexes = channel_indexes

        # Initialize containers for child objects
        self.analogsignalarrays = []
        self.units = []
        # Many to many relationship
        self.recordingchannels = []

        self.block = None
开发者ID:dengemann,项目名称:python-neo,代码行数:26,代码来源:recordingchannelgroup.py


示例2: __init__

 def __init__(self, times=None, durations=None, labels=None, units=None,
              name=None, description=None, file_origin=None, **annotations):
     '''
     Initialize a new :class:`Epoch` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
开发者ID:SummitKwan,项目名称:python-neo,代码行数:7,代码来源:epoch.py


示例3: __init__

 def __init__(self, signal, units=None, dtype=None, copy=True,
              t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
              name=None, file_origin=None, description=None,
              channel_index=None, **annotations):
     '''
     Initializes a newly constructed :class:`AnalogSignalArray` instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
开发者ID:bal47,项目名称:python-neo,代码行数:9,代码来源:analogsignalarray.py


示例4: __init__

 def __init__(self, time, label, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Event."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     self.time = time
     self.label = label
     
     self.segment =None
开发者ID:tkf,项目名称:neo,代码行数:9,代码来源:event.py


示例5: __init__

 def __init__(self, times, signal, units=None, time_units=None, dtype=None,
              copy=True, name=None, file_origin=None, description=None,
              **annotations):
     '''
     Initializes a newly constructed :class:`IrregularlySampledSignal`
     instance.
     '''
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
开发者ID:Silmathoron,项目名称:python-neo,代码行数:9,代码来源:irregularlysampledsignal.py


示例6: __init__

    def __init__(self, times=np.array([]) * pq.s,
                 labels=np.array([], dtype='S'), name=None, description=None,
                 file_origin=None, **annotations):
        """Initialize a new EventArray."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.times = times
        self.labels = labels

        self.segment = None
开发者ID:dengemann,项目名称:python-neo,代码行数:10,代码来源:eventarray.py


示例7: __init__

    def __init__(self, time, label, name=None, description=None,
                 file_origin=None, **annotations):
        '''
        Initialize a new :class:`Event` instance.
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
        self.time = time
        self.label = label

        self.segment = None
开发者ID:ChrisNolan1992,项目名称:python-neo,代码行数:11,代码来源:event.py


示例8: __init__

 def __init__(self, name=None, description=None, file_origin=None, 
                             channel_indexes = None, **annotations):
     """Initialize a new neuronal Unit (spike source)"""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.channel_indexes = channel_indexes
     
     self.spiketrains = [ ]
     self.spikes = [ ]
     
     self.recordingchannelgroup = None
开发者ID:tkf,项目名称:neo,代码行数:12,代码来源:unit.py


示例9: __init__

 def __init__(self, times, values,
               name=None, description=None,
              file_origin=None, **annotations):
     """Initalize a new IrregularlySampledSignal."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.times = times
     self.values = values
     
     self.segment = None
     self.recordingchannel = None
开发者ID:tkf,项目名称:neo,代码行数:12,代码来源:irregularlysampledsignal.py


示例10: __init__

    def __init__(self, name=None, description=None, file_origin=None,
                 file_datetime=None, rec_datetime=None, index=None,
                 **annotations):
        """Initalize a new Block."""
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.file_datetime = file_datetime
        self.rec_datetime = rec_datetime
        self.index = index

        self.segments = []
        self.recordingchannelgroups = []
开发者ID:michaelfsp,项目名称:python-neo,代码行数:13,代码来源:block.py


示例11: __init__

    def __init__(self, times, t_stop, units=None,  dtype=np.float,
                 copy=True, sampling_rate=1.0 * pq.Hz, t_start=0.0 * pq.s,
                 waveforms=None, left_sweep=None, name=None, file_origin=None,
                 description=None, **annotations):
        """Initializes newly constructed SpikeTrain."""
        # This method is only called when constructing a new SpikeTrain,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
开发者ID:dengemann,项目名称:python-neo,代码行数:14,代码来源:spiketrain.py


示例12: __init__

    def __init__(self, times=None, labels=None, name=None, description=None, file_origin=None, **annotations):
        """
        Initialize a new :class:`EventArray` instance.
        """
        BaseNeo.__init__(self, name=name, file_origin=file_origin, description=description, **annotations)
        if times is None:
            times = np.array([]) * pq.s
        if labels is None:
            labels = np.array([], dtype="S")

        self.times = times
        self.labels = labels

        self.segment = None
开发者ID:bal47,项目名称:python-neo,代码行数:14,代码来源:eventarray.py


示例13: __init__

    def __init__(self, array_annotations=None, **annotations):
        # this for py27 str vs py3 str in neo attributes ompatibility
        annotations = check_annotations(annotations)
        if 'file_origin' not in annotations:
            # the str is to make compatible with neo_py27 where attribute
            # used to be str so raw bytes
            annotations['file_origin'] = str(self._rawio.source_name())

        # this mock the array annotaions to avoid inherits DataObject
        self.array_annotations = ArrayDict(self.shape[-1])
        if array_annotations is not None:
            self.array_annotations.update(array_annotations)

        BaseNeo.__init__(self, **annotations)
开发者ID:INM-6,项目名称:python-neo,代码行数:14,代码来源:proxyobjects.py


示例14: __init__

    def __init__(self, name=None, description=None, file_origin=None,
                 channel_indexes=None, **annotations):
        '''
        Initialize a new :clas:`Unit` instance (spike source)
        '''
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)

        self.channel_indexes = channel_indexes

        self.spiketrains = []
        self.spikes = []

        self.recordingchannelgroup = None
开发者ID:leaandre,项目名称:python-neo,代码行数:14,代码来源:unit.py


示例15: __init__

 def __init__(self, time=0*pq.s, waveform=None, sampling_rate=None,
              left_sweep=None, name=None, description=None,
              file_origin=None, **annotations):
     """Initialize a new Spike."""
     BaseNeo.__init__(self, name=name, file_origin=file_origin,
                      description=description, **annotations)
     
     self.time = time
     
     self.waveform = waveform
     self.left_sweep = left_sweep
     self.sampling_rate = sampling_rate
     
     self.segment = None
     self.unit = None
开发者ID:tkf,项目名称:neo,代码行数:15,代码来源:spike.py


示例16: __init__

    def __init__(self, name=None, description=None, file_origin=None, array_annotations=None,
                 **annotations):
        """
        This method is called by each data object and initializes the newly created object by
        adding array annotations and calling __init__ of the super class, where more annotations
        and attributes are processed.
        """

        if not hasattr(self, 'array_annotations') or not self.array_annotations:
            self.array_annotations = ArrayDict(self._get_arr_ann_length())
        if array_annotations is not None:
            self.array_annotate(**array_annotations)

        BaseNeo.__init__(self, name=name, description=description, file_origin=file_origin,
                         **annotations)
开发者ID:INM-6,项目名称:python-neo,代码行数:15,代码来源:dataobject.py


示例17: __init__

    def __init__(self, signal, units=None, dtype=None, copy=True,
                 t_start=0 * pq.s, sampling_rate=None, sampling_period=None,
                 name=None, file_origin=None, description=None,
                 channel_index=None, **annotations):
        '''
        Initializes a newly constructed :class:`BaseAnalogSignal` instance.
        '''
        # This method is only called when constructing a new BaseAnalogSignal,
        # not when slicing or viewing. We use the same call signature
        # as __new__ for documentation purposes. Anything not in the call
        # signature is stored in annotations.

        # Calls parent __init__, which grabs universally recommended
        # attributes and sets up self.annotations
        BaseNeo.__init__(self, name=name, file_origin=file_origin,
                         description=description, **annotations)
开发者ID:leaandre,项目名称:python-neo,代码行数:16,代码来源:analogsignal.py


示例18: setUp

 def setUp(self):
     self.name1 = 'a base 1'
     self.name2 = 'a base 2'
     self.description1 = 'this is a test 1'
     self.description2 = 'this is a test 2'
     self.base1 = BaseNeo(name=self.name1, description=self.description1)
     self.base2 = BaseNeo(name=self.name2, description=self.description2)
开发者ID:CINPLA,项目名称:python-neo,代码行数:7,代码来源:test_base.py


示例19: test_annotate

    def test_annotate(self):
        '''test to make sure annotation works properly'''
        base = BaseNeo()
        base.annotate(test1=1, test2=1)
        result1 = {'test1': 1, 'test2': 1}

        self.assertDictEqual(result1, base.annotations)

        base.annotate(test3=2, test4=3)
        result2 = {'test3': 2, 'test4': 3}
        result2a = dict(list(result1.items()) + list(result2.items()))

        self.assertDictContainsSubset(result1, base.annotations)
        self.assertDictContainsSubset(result2, base.annotations)
        self.assertDictEqual(result2a, base.annotations)

        base.annotate(test1=5, test2=8)
        result3 = {'test1': 5, 'test2': 8}
        result3a = dict(list(result3.items()) + list(result2.items()))

        self.assertDictContainsSubset(result2, base.annotations)
        self.assertDictContainsSubset(result3, base.annotations)
        self.assertDictEqual(result3a, base.annotations)

        self.assertNotEqual(base.annotations['test1'], result1['test1'])
        self.assertNotEqual(base.annotations['test2'], result1['test2'])
开发者ID:CINPLA,项目名称:python-neo,代码行数:26,代码来源:test_base.py


示例20: test__children

    def test__children(self):
        base = BaseNeo()

        self.assertEqual(base._container_child_objects, ())
        self.assertEqual(base._data_child_objects, ())
        self.assertEqual(base._single_parent_objects, ())
        self.assertEqual(base._multi_child_objects, ())
        self.assertEqual(base._multi_parent_objects, ())
        self.assertEqual(base._child_properties, ())

        self.assertEqual(base._single_child_objects, ())

        self.assertEqual(base._container_child_containers, ())
        self.assertEqual(base._data_child_containers, ())
        self.assertEqual(base._single_child_containers, ())
        self.assertEqual(base._single_parent_containers, ())
        self.assertEqual(base._multi_child_containers, ())
        self.assertEqual(base._multi_parent_containers, ())

        self.assertEqual(base._child_objects, ())
        self.assertEqual(base._child_containers, ())
        self.assertEqual(base._parent_objects, ())
        self.assertEqual(base._parent_containers, ())

        self.assertEqual(base.children, ())
        self.assertEqual(base.parents, ())

        base.create_many_to_one_relationship()
        base.create_many_to_many_relationship()
        base.create_relationship()
开发者ID:NeuroArchive,项目名称:python-neo,代码行数:30,代码来源:test_base.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python epoch.Epoch类代码示例发布时间:2022-05-27
下一篇:
Python analogsignal.AnalogSignal类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap