Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(16)  |  Derive(0)  |  Import(0)

src/p/y/pyon-HEAD/prototype/sci_data/constructor_apis.py   pyon(Download)
            return
        serializer = IonObjectSerializer()
        definition = serializer.serialize(definition)
        tree = DefinitionTree.traverse(definition,definition['data_stream_id'])
        return tree

src/p/y/pyon-HEAD/pyon/core/test/test_object.py   pyon(Download)
        io_serializer = IonObjectSerializer()
        obj = IonObject('SampleResource', {'num': 9, 'other_field': 'test value'})
        obj_dict = io_serializer.serialize(obj,True)
        self.assertEquals(obj_dict['persisted_version'], 1)
        # verify that the simulated previous version does not have new_attribute
 
        # simulate update
        obj_dict = io_serializer.serialize(obj,True)
        # verify that version is updated
        self.assertEquals(obj_dict['persisted_version'], 2)
        # simulate creating a version 2 of SampleResource that has "new_attribute"
        obj = IonObject('SampleResource_V2', {'num': 9, 'other_field': 'test value','new_attribute': {'key':'value'}})
        obj_dict = io_serializer.serialize(obj,True)
        # verify that version is 2
        self.assertEquals(obj_dict['persisted_version'], 2)
 
        # simulate update
        obj_dict = io_serializer.serialize(obj,True)
        # verify that version is updated
        self.assertEquals(obj_dict['persisted_version'], 3)
    def test_event_version(self):
 
        io_serializer = IonObjectSerializer()
        obj = IonObject('SampleEvent', {'num': 9, 'other_field': 'test value'})
        obj_dict = io_serializer.serialize(obj,True)

src/p/y/pyon-HEAD/pyon/core/test/test_objperf.py   pyon(Download)
        def time_serialize(test_obj, name="?", has_ion=False):
            with time_it(name + ", serialize"):
                os = _io_serializer.serialize(test_obj)
 
            with time_it(name + ", deserialize"):