def simple_calculations(traj, arg1, simple_kwarg):

        if traj.v_idx == 0:
            # to shuffle runs
            time.sleep(0.1)

        rootlogger = get_root_logger()

        if not 'runs' in traj.res:
            traj.res.f_add_result_group('runs')

        rootlogger.info('>>>>>Starting Simple Calculations')
        my_dict = {}

        my_dict2={}
        param_dict=traj.parameters.f_to_dict(fast_access=True,short_names=False)
        for key in sorted(param_dict.keys())[0:5]:
            val = param_dict[key]
            if 'trial' in key:
                continue
            newkey = key.replace('.','_')
            my_dict[newkey] = str(val)
            my_dict2[newkey] = [str(val)+' juhu!']

        my_dict['__FLOAT'] = 44.0
        my_dict['__INT'] = 66
        my_dict['__NPINT'] = np.int_(55)
        my_dict['__INTaRRAy'] = np.array([1,2,3])
        my_dict['__FLOATaRRAy'] = np.array([1.0,2.0,41.0])
        my_dict['__FLOATaRRAy_nested'] = np.array([np.array([1.0,2.0,41.0]),np.array([1.0,2.0,41.0])])
        my_dict['__STRaRRAy'] = np.array(['sds','aea','sf'])
        my_dict['__LONG'] = compat.long_type(4266)
        my_dict['__UNICODE'] = u'sdfdsf'
        my_dict['__BYTES'] = b'zweiundvierzig'
        my_dict['__NUMPY_UNICODE'] = np.array([u'$%&ddss'])
        my_dict['__NUMPY_BYTES'] = np.array([b'zweiundvierzig'])

        keys = sorted(to_dict_wo_config(traj).keys())
        for idx,key in enumerate(keys[0:5]):
            keys[idx] = key.replace('.', '_')

        listy=traj.f_add_result_group('List', comment='Im a result group')
        traj.f_add_result_group('Iwiiremainempty.yo', comment='Empty group!')
        traj.Iwiiremainempty.f_store_child('yo')

        traj.Iwiiremainempty.f_add_link('kkk',listy )
        listy.f_add_link('hhh', traj.Iwiiremainempty)

        if not traj.Iwiiremainempty.kkk.v_full_name == traj.List.v_full_name:
            raise RuntimeError()

        if not traj.Iwiiremainempty.kkk.v_full_name == traj.List.hhh.kkk.v_full_name:
            raise RuntimeError()

        traj.f_add_result('runs.' + traj.v_crun + '.ggg', 5555, comment='ladida')
        traj.res.runs.f_add_result(traj.v_crun + '.ggjg', 5555, comment='didili')
        traj.res.runs.f_add_result('hhg', 5555, comment='jjjj')

        traj.res.f_add_result(name='lll', comment='duh', data=444)

        x = traj.res.f_add_result(name='nested', comment='duh')

        x['nested0.nested1.nested2.nested3'] =  44

        traj.res.f_add_result(name='test.$set.$', comment='duh', data=444)

        try:
            traj.f_add_config('teeeeest', 12)
            raise RuntimeError()
        except __HOLE__:
            pass

        # if not traj.f_contains('results.runs.' + traj.v_crun + '.ggjg', shortcuts=False):
        #     raise RuntimeError()
        # if not traj.f_contains('results.runs.' + traj.v_crun + '.ggg', shortcuts=False):
        #     raise RuntimeError()
        if not traj.f_contains('results.runs.' + traj.v_crun + '.hhg', shortcuts=False):
            raise RuntimeError()

        traj.f_add_result('List.Of.Keys', dict1=my_dict, dict2=my_dict2, comment='Test')
        traj.List.f_store_child('Of', recursive=True)
        traj.f_add_result('DictsNFrame', keys=keys, comment='A dict!')
        traj.f_add_result('ResMatrix',np.array([1.2,2.3]), comment='ResMatrix')

        traj.f_add_result('empty.stuff', (), [], {}, np.array([]), comment='empty stuff')
        #traj.f_add_derived_parameter('All.To.String', str(traj.f_to_dict(fast_access=True,short_names=False)))

        myframe = pd.DataFrame(data ={'TC1':[1,2,3],'TC2':['Waaa','',''],'TC3':[1.2,42.2,77]})

        myseries = myframe['TC1']

        mypanel = pd.Panel({'Item1' : pd.DataFrame(np.ones((4, 3))),'Item2' : pd.DataFrame(np.ones((4, 2)))})

        # p4d = pd.Panel4D(np.random.randn(2, 2, 5, 4),
        #     labels=['Label1','Label2'],
        #    items=['Item1', 'Item2'],
        #    major_axis=pd.date_range('1/1/2000', periods=5),
        #   minor_axis=['A', 'B', 'C', 'D'])


        traj.f_add_result('myseries', myseries, comment='dd')
        traj.f_store_item('myseries')
        traj.f_add_result('mypanel', mypanel, comment='dd')
        #traj.f_add_result('mypanel4d', p4d, comment='dd')

        traj.f_get('DictsNFrame').f_set(myframe)

        traj.f_add_result('IStore.SimpleThings',1.0,3,np.float32(5.0),
                          'Iamstring',
                          (1,2,3), [4,5,6],
                          zwei=2).v_comment='test'
        traj.f_add_derived_parameter('super.mega',33, comment='It is huuuuge!')
        traj.super.f_set_annotations(AgainATestAnnotations='I am a string!111elf')

        traj.f_add_result(PickleResult,'pickling.result.proto1', my_dict2, protocol=1, comment='p1')
        traj.f_add_result(PickleResult,'pickling.result.proto2', my_dict2, protocol=2, comment='p2')
        traj.f_add_result(PickleResult,'pickling.result.proto0', my_dict2, protocol=0, comment='p0')

        traj.f_add_result(SparseResult, 'sparse.csc', traj.csc_mat, 42).v_comment='sdsa'
        traj.f_add_result(SparseResult, 'sparse.bsr', traj.bsr_mat, 52).v_comment='sdsa'
        traj.f_add_result(SparseResult, 'sparse.csr', traj.csr_mat, 62).v_comment='sdsa'
        traj.f_add_result(SparseResult, 'sparse.dia', traj.dia_mat, 72).v_comment='sdsa'

        traj.sparse.v_comment = 'I contain sparse data!'

        myobjtab = ObjectTable(data={'strings':['a','abc','qwertt'], 'ints':[1,2,3]})

        traj.f_add_result('object.table', myobjtab, comment='k').v_annotations.f_set(test=42)
        traj.object.f_set_annotations(test2=42.42)

        traj.f_add_result('$.here', 77, comment='huhu')
        traj.f_add_result('tor.hot.$', dollah=77, comment='duh!')
        traj.f_add_result('tor.hot.rrr.$.j', 77, comment='duh!')
        traj.f_add_result('tor.hot.rrr.crun.jjj', 777, comment='duh**2!')

        #traj.f_add_result('PickleTerror', result_type=PickleResult, test=traj.SimpleThings)
        rootlogger.info('<<<<<<Finished Simple Calculations')

        # let's see if the traj can also always be returned
        if isinstance(traj.v_storage_service, LockWrapper):
            traj.v_storage_service.pickle_lock = False
        return 42, traj
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/tests/testutils/data.py/simple_calculations