Beispiel #1
0
    def test_loading_as_new(self):
        filename = make_temp_dir('asnew.h5')
        traj = Trajectory(name='TestPartial', filename=filename, add_time=True)

        traj.f_add_parameter('x', 3)
        traj.f_add_parameter('y', 2)

        traj.f_explore({'x': [12,3,44], 'y':[1,23,4]})

        traj.f_store()

        traj = load_trajectory(name=traj.v_name, filename=filename)

        with self.assertRaises(TypeError):
            traj.f_shrink()

        traj = load_trajectory(name=traj.v_name, filename=filename, as_new=True,
                               new_name='TestTraj', add_time=False)

        self.assertTrue(traj.v_name == 'TestTraj')

        self.assertEqual(len(traj), 3)

        self.assertEqual(len(traj._explored_parameters), 2)

        traj.f_shrink()

        self.assertTrue(len(traj) == 1)
Beispiel #2
0
    def test_loading_as_new(self):
        filename = make_temp_dir('asnew.h5')
        traj = Trajectory(name='TestPartial', filename=filename)

        traj.f_add_parameter('x', 3)
        traj.f_add_parameter('y', 2)

        traj.f_explore({'x': [12,3,44], 'y':[1,23,4]})

        traj.f_store()

        traj = load_trajectory(name=traj.v_name, filename=filename)

        with self.assertRaises(TypeError):
            traj.f_shrink()

        traj = load_trajectory(name=traj.v_name, filename=filename, as_new=True,
                               new_name='TestTraj', add_time=False)

        self.assertTrue(traj.v_name == 'TestTraj')

        self.assertTrue(len(traj) == 3)

        traj.f_shrink()

        self.assertTrue(len(traj) == 1)
Beispiel #3
0
    def test_links_according_to_run(self):

        traj = Trajectory()

        traj.f_add_parameter('test.hi', 44)
        traj.f_explore({'hi': [1, 2, 3]})

        traj.f_add_parameter_group('test.test.test2')
        traj.f_add_parameter_group('test2')
        traj.test2.f_add_link('test', traj.test)

        traj.v_idx = 1
Beispiel #4
0
    def test_links_according_to_run(self):

        traj = Trajectory()

        traj.f_add_parameter('test.hi', 44)
        traj.f_explore({'hi': [1,2,3]})

        traj.f_add_parameter_group('test.test.test2')
        traj.f_add_parameter_group('test2')
        traj.test2.f_add_link('test', traj.test)

        traj.v_idx = 1
Beispiel #5
0
    def test_wildcard_search(self):

        traj = Trajectory(name='Testwildcard',
                          filename=make_temp_dir('wilcard.hdf5'),
                          add_time=True)

        traj.f_add_parameter('expl', 2)
        traj.f_explore({'expl': [1, 2, 3, 4]})

        traj.f_add_result('wc2test.$.hhh', 333)
        traj.f_add_leaf('results.wctest.run_00000000.jjj', 42)
        traj.f_add_result('results.wctest.run_00000001.jjj', 43)
        traj.f_add_result('results.wctest.%s.jjj' % traj.f_wildcard('$', -1),
                          43)

        traj.v_crun = 1

        self.assertTrue(traj.results.wctest['$'].jjj == 43)
        self.assertTrue(traj.results.wc2test.crun.hhh == 333)

        traj.f_store()

        get_root_logger().info('Removing child1')

        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('Doing auto-load')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest['$'].jjj == 43)
        self.assertTrue(traj.results.wc2test.crun.hhh == 333)

        get_root_logger().info('Removing child2')

        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('auto-loading')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest[-1].jjj == 43)
        self.assertTrue(traj.results.wc2test[-1].hhh == 333)

        get_root_logger().info('Removing child3')
        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('auto-loading')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest[1].jjj == 43)
        self.assertTrue(traj.results.wc2test[-1].hhh == 333)

        get_root_logger().info('Done with wildcard test')
Beispiel #6
0
    def test_loading_explored_parameters(self):

        filename = make_temp_dir('load_explored.hdf5')
        traj = Trajectory(filename=filename, overwrite_file=True, add_time=False)
        traj.par.x = Parameter('x', 42, comment='answer')
        traj.f_explore({'x':[1,2,3,4]})
        traj.f_store()
        name = traj.v_name

        traj = Trajectory(filename=filename, add_time=False)
        traj.f_load()
        x = traj.f_get('x')
        self.assertIs(x, traj._explored_parameters['parameters.x'])
Beispiel #7
0
 def test_file_renaming(self):
     traj_name = 'test'
     traj = Trajectory('test', add_time=False)
     traj.f_add_parameter('x', 42)
     traj.f_explore({'x': [1,2,3]})
     rename_string = '$traj_$set_$run'
     solution_1 = 'test_run_set_ALL_run_ALL'
     solution_2 = 'test_run_set_00000_run_00000000'
     renaming_1 = rename_log_file(rename_string, traj)
     self.assertEqual(renaming_1, solution_1)
     traj.v_idx = 0
     renaming_2 = rename_log_file(rename_string, traj)
     self.assertEqual(renaming_2, solution_2)
Beispiel #8
0
    def test_loading_explored_parameters(self):

        filename = make_temp_dir('load_explored.hdf5')
        traj = Trajectory(filename=filename, overwrite_file=True, add_time=False)
        traj.par.x = Parameter('x', 42, comment='answer')
        traj.f_explore({'x':[1,2,3,4]})
        traj.f_store()
        name = traj.v_name

        traj = Trajectory(filename=filename, add_time=False)
        traj.f_load()
        x = traj.f_get('x')
        self.assertIs(x, traj._explored_parameters['parameters.x'])
Beispiel #9
0
 def test_file_renaming(self):
     traj_name = 'test'
     traj = Trajectory('test', add_time=False)
     traj.f_add_parameter('x', 42)
     traj.f_explore({'x': [1,2,3]})
     rename_string = '$traj_$set_$run'
     solution_1 = 'test_run_set_ALL_run_ALL'
     solution_2 = 'test_run_set_00000_run_00000000'
     renaming_1 = rename_log_file(rename_string, traj)
     self.assertEqual(renaming_1, solution_1)
     traj.v_idx = 0
     renaming_2 = rename_log_file(rename_string, traj)
     self.assertEqual(renaming_2, solution_2)
Beispiel #10
0
    def test_find_in_all_runs_with_links(self):

        traj = Trajectory()

        traj.f_add_parameter('FloatParam')
        traj.par.FloatParam = 4.0
        self.explore_dict = {'FloatParam': [1.0, 1.1, 1.2, 1.3]}
        traj.f_explore(self.explore_dict)

        self.assertTrue(len(traj) == 4)

        traj.f_add_result('results.runs.run_00000000.sub.resulttest', 42)
        traj.f_add_result('results.runs.run_00000001.sub.resulttest', 43)
        traj.f_add_result('results.runs.run_00000002.sub.resulttest', 44)

        traj.f_add_result('results.runs.run_00000002.sub.resulttest2', 42)
        traj.f_add_result('results.runs.run_00000003.sub.resulttest2', 43)

        traj.f_add_derived_parameter(
            'derived_parameters.runs.run_00000002.testing', 44)

        res_dict = traj.f_get_from_runs('resulttest', fast_access=True)

        self.assertTrue(len(res_dict) == 3)
        self.assertTrue(res_dict['run_00000001'] == 43)
        self.assertTrue('run_00000003' not in res_dict)

        res_dict = traj.f_get_from_runs(name='sub.resulttest2',
                                        use_indices=True)

        self.assertTrue(len(res_dict) == 2)
        self.assertTrue(res_dict[3] is traj.f_get('run_00000003.resulttest2'))
        self.assertTrue(1 not in res_dict)

        traj.res.runs.r_0.f_add_link('resulttest2',
                                     traj.r_1.f_get('resulttest'))

        res_dict = traj.f_get_from_runs(name='resulttest2', use_indices=True)

        self.assertTrue(len(res_dict) == 3)
        self.assertTrue(res_dict[0] is traj.f_get('run_00000001.resulttest'))
        self.assertTrue(1 not in res_dict)

        res_dict = traj.f_get_from_runs(name='resulttest2',
                                        use_indices=True,
                                        with_links=False)

        self.assertTrue(len(res_dict) == 2)
        self.assertTrue(0 not in res_dict)
        self.assertTrue(1 not in res_dict)
Beispiel #11
0
    def test_wildcard_search(self):

        traj = Trajectory(name='Testwildcard', filename=make_temp_dir('wilcard.hdf5'),
                          add_time=True)

        traj.f_add_parameter('expl', 2)
        traj.f_explore({'expl':[1,2,3,4]})

        traj.f_add_result('wc2test.$.hhh', 333)
        traj.f_add_leaf('results.wctest.run_00000000.jjj', 42)
        traj.f_add_result('results.wctest.run_00000001.jjj', 43)
        traj.f_add_result('results.wctest.%s.jjj' % traj.f_wildcard('$', -1), 43)

        traj.v_crun = 1

        self.assertTrue(traj.results.wctest['$'].jjj==43)
        self.assertTrue(traj.results.wc2test.crun.hhh==333)

        traj.f_store()

        get_root_logger().info('Removing child1')

        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('Doing auto-load')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest['$'].jjj==43)
        self.assertTrue(traj.results.wc2test.crun.hhh==333)

        get_root_logger().info('Removing child2')

        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('auto-loading')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest[-1].jjj==43)
        self.assertTrue(traj.results.wc2test[-1].hhh==333)

        get_root_logger().info('Removing child3')
        traj.f_remove_child('results', recursive=True)

        get_root_logger().info('auto-loading')
        traj.v_auto_load = True

        self.assertTrue(traj.results.wctest[1].jjj==43)
        self.assertTrue(traj.results.wc2test[-1].hhh==333)

        get_root_logger().info('Done with wildcard test')
Beispiel #12
0
    def test_no_run_information_loading(self):
        filename = make_temp_dir('testnoruninfo.hdf5')
        traj = Trajectory(name='TestDelete',
                          filename=filename,
                          add_time=True)

        length = 100000
        traj.par.x = Parameter('', 42)
        traj.f_explore({'x': range(length)})

        traj.f_store()

        traj = load_trajectory(index=-1, filename=filename, with_run_information=False)
        self.assertEqual(len(traj), length)
        self.assertEqual(len(traj._run_information), 1)
Beispiel #13
0
    def test_no_run_information_loading(self):
        filename = make_temp_dir('testnoruninfo.hdf5')
        traj = Trajectory(name='TestDelete',
                          filename=filename)

        length = 100000
        traj.v_lazy_adding = True
        traj.par.x = 42
        traj.f_explore({'x': range(length)})

        traj.f_store()

        traj = load_trajectory(index=-1, filename=filename, with_run_information=False)
        self.assertEqual(len(traj), length)
        self.assertEqual(len(traj._run_information), 1)
Beispiel #14
0
    def test_find_in_all_runs_with_links(self):

        traj = Trajectory()

        traj.f_add_parameter('FloatParam')
        traj.par.FloatParam=4.0
        self.explore_dict = {'FloatParam':[1.0,1.1,1.2,1.3]}
        traj.f_explore(self.explore_dict)

        self.assertTrue(len(traj) == 4)

        traj.f_add_result('results.runs.run_00000000.sub.resulttest', 42)
        traj.f_add_result('results.runs.run_00000001.sub.resulttest', 43)
        traj.f_add_result('results.runs.run_00000002.sub.resulttest', 44)

        traj.f_add_result('results.runs.run_00000002.sub.resulttest2', 42)
        traj.f_add_result('results.runs.run_00000003.sub.resulttest2', 43)

        traj.f_add_derived_parameter('derived_parameters.runs.run_00000002.testing', 44)

        res_dict = traj.f_get_from_runs('resulttest', fast_access=True)

        self.assertTrue(len(res_dict)==3)
        self.assertTrue(res_dict['run_00000001']==43)
        self.assertTrue('run_00000003' not in res_dict)

        res_dict = traj.f_get_from_runs(name='sub.resulttest2', use_indices=True)

        self.assertTrue(len(res_dict)==2)
        self.assertTrue(res_dict[3] is traj.f_get('run_00000003.resulttest2'))
        self.assertTrue(1 not in res_dict)

        traj.res.runs.r_0.f_add_link('resulttest2', traj.r_1.f_get('resulttest'))

        res_dict = traj.f_get_from_runs(name='resulttest2', use_indices=True)

        self.assertTrue(len(res_dict)==3)
        self.assertTrue(res_dict[0] is traj.f_get('run_00000001.resulttest'))
        self.assertTrue(1 not in res_dict)

        res_dict = traj.f_get_from_runs(name='resulttest2', use_indices=True, with_links=False)

        self.assertTrue(len(res_dict)==2)
        self.assertTrue(0 not in res_dict)
        self.assertTrue(1 not in res_dict)
Beispiel #15
0
    def test_get_all_not_links(self):

        traj = Trajectory()

        traj.f_add_parameter('test.hi', 44)
        traj.f_explore({'hi': [1, 2, 3]})

        traj.f_add_parameter_group('test.test.test2')
        traj.f_add_parameter_group('test2')
        traj.test2.f_add_link('test', traj.test)

        nodes = traj.f_get_all('par.test')

        self.assertTrue(len(nodes) == 2)

        nodes = traj.f_get_all('par.test', shortcuts=False)

        self.assertTrue(len(nodes) == 1)

        traj.f_set_crun(0)

        traj.f_add_group('f.$.h')
        traj.f_add_group('f.$.g.h')
        traj.f_add_group('f.$.i')
        traj.crun.i.f_add_link('h', traj.crun.h)

        nodes = traj.f_get_all('$.h')

        self.assertTrue(len(nodes) == 2)

        nodes = traj.f_get_all('h')

        self.assertTrue(len(nodes) == 2)

        traj.v_idx = -1

        nodes = traj.f_get_all('h')

        self.assertTrue(len(nodes) == 2)
Beispiel #16
0
    def test_get_all_not_links(self):

        traj = Trajectory()

        traj.f_add_parameter('test.hi', 44)
        traj.f_explore({'hi': [1,2,3]})

        traj.f_add_parameter_group('test.test.test2')
        traj.f_add_parameter_group('test2')
        traj.test2.f_add_link('test', traj.test)

        nodes = traj.f_get_all('par.test')

        self.assertTrue(len(nodes) == 2)

        nodes = traj.f_get_all('par.test', shortcuts=False)

        self.assertTrue(len(nodes) == 1)

        traj.f_set_crun(0)

        traj.f_add_group('f.$.h')
        traj.f_add_group('f.$.g.h')
        traj.f_add_group('f.$.i')
        traj.crun.i.f_add_link('h', traj.crun.h)

        nodes = traj.f_get_all('$.h')

        self.assertTrue(len(nodes)==2)

        nodes = traj.f_get_all('h')

        self.assertTrue(len(nodes)==2)

        traj.v_idx = -1

        nodes = traj.f_get_all('h')

        self.assertTrue(len(nodes)==2)
Beispiel #17
0
def main():
    """Main function to protect the *entry point* of the program."""

    # Load settings from file
    settings_file = 'pypet_settings.pkl'
    settings = load_obj(settings_file)
    # Print settings dictionary
    print('\nSettings dictionary:')
    for key, value in settings.items():
        print(key, ' : ', value)
    print('\nParameters to explore:')
    for key, value in settings.items():
        if isinstance(value, list):
            print(key, ' : ', value)

    # Create new folder to store results
    traj_dir = os.getcwd()
    # Read output path (if provided)
    if len(sys.argv) > 1:
        # Add trailing slash if missing
        dir_provided = os.path.join(sys.argv[1], '')
        # Check if provided directory exists
        if os.path.isdir(dir_provided):
            # Convert to full path
            traj_dir = os.path.abspath(dir_provided)
        else:
            print(
                'WARNING: Output path not found, current directory will be used instead'
            )
    else:
        print(
            'WARNING: Output path not provided, current directory will be used instead'
        )
    # Add time stamp (the final '' is to make sure there is a trailing slash)
    traj_dir = os.path.join(traj_dir,
                            datetime.now().strftime("%Y_%m_%d_%Hh%Mm%Ss"), '')
    # Create directory with time stamp
    os.makedirs(traj_dir)
    # Change current directory to the one containing the trajectory files
    os.chdir(traj_dir)
    print('Trajectory and results will be stored in: {0}'.format(traj_dir))

    # Create new pypet Trajectory object
    traj_filename = 'traj.hdf5'
    traj_fullpath = os.path.join(traj_dir, traj_filename)
    traj = Trajectory(filename=traj_fullpath)

    # -------------------------------------------------------------------
    # Add config parameters (those that DO NOT influence the final result of the experiment)
    traj.f_add_config('debug', False, comment='Activate debug mode')
    #    #traj.f_add_config('max_mem_frac', 0.7, comment='Fraction of global GPU memory to use')

    # Set up trajectory parameters
    param_to_explore = {}
    for key, val in settings.items():
        if isinstance(val, list):
            param_to_explore[key] = val
            traj.f_add_parameter(key, val[0])
        else:
            traj.f_add_parameter(key, val)

    # Define parameter combinations to explore (a trajectory in
    # the parameter space). The second argument, the tuple, specifies the order
    #  of the cartesian product.
    # The variable on the right most side changes fastest and defines the
    # 'inner for-loop' of the cartesian product
    explore_dict = cartesian_product(param_to_explore,
                                     tuple(param_to_explore.keys()))

    print(explore_dict)
    traj.f_explore(explore_dict)

    # Store trajectory parameters to disk
    pypet_utils.print_traj_leaves(traj,
                                  'parameters',
                                  file=os.path.join(traj_dir,
                                                    'traj_parameters.txt'))

    # Store trajectory
    traj.f_store()

    # Define PBS script
    bash_lines = '\n'.join([
        '#! /bin/bash',
        '#PBS -P InfoDynFuncStruct',
        '#PBS -l select=1:ncpus=1:mem=1GB',
        #'#PBS -l select=1:ncpus=1:ngpus=1:mem=1GB',
        '#PBS -M [email protected]',
        '#PBS -m abe',
        'module load java',
        'module load python/3.5.1',
        'module load cuda/8.0.44',
        'source /project/RDS-FEI-InfoDynFuncStruct-RW/Leo/idtxl_env/bin/activate',
        'cd ${traj_dir}',
        'python ${python_script_path} ${traj_dir} ${traj_filename} ${file_prefix} $PBS_ARRAY_INDEX'
    ])

    # Save PBS script file (automatically generated)
    bash_script_name = 'run_python_script.pbs'
    job_script_path = os.path.join(traj_dir, bash_script_name)
    with open(job_script_path, 'w', newline='\n') as bash_file:
        bash_file.writelines(bash_lines)

    # Run job array
    job_walltime_hours = 0
    job_walltime_minutes = 5
    #after_job_array_ends = 1573895
    job_settings = {
        'N': 'run_traj',
        'l': 'walltime={0}:{1}:00'.format(job_walltime_hours,
                                          job_walltime_minutes),
        #'W': 'depend=afteranyarray:{0}[]'.format(after_job_array_ends),
        'q': 'defaultQ'
    }
    if len(traj.f_get_run_names()) > 1:
        job_settings['J'] = '{0}-{1}'.format(0,
                                             len(traj.f_get_run_names()) - 1)

    job_args = {
        'python_script_path':
        '/project/RDS-FEI-InfoDynFuncStruct-RW/Leo/inference/hpc_pypet_single_run.py',
        'traj_dir': traj_dir,
        'traj_filename': traj_filename,
        'file_prefix': 'none'
    }
    run_job_array(job_script_path, job_settings, job_args)
Beispiel #18
0
    def test_delete_whole_subtrees(self):
        filename = make_temp_dir('testdeltree.hdf5')
        traj = Trajectory(name='TestDelete',
                          filename=filename, large_overview_tables=True,
                          add_time=True)

        res = traj.f_add_result('mytest.yourtest.test', a='b', c='d')
        dpar = traj.f_add_derived_parameter('mmm.gr.dpdp', 666)


        res = traj.f_add_result('hhh.ll', a='b', c='d')
        res = traj.f_add_derived_parameter('hhh.gg', 555)

        traj.f_store()

        with pt.open_file(filename) as fh:
            daroot = fh.root._f_get_child(traj.v_name)
            dpar_table = daroot.overview.derived_parameters_overview
            self.assertTrue(len(dpar_table) == 2)
            res_table = daroot.overview.results_overview
            self.assertTrue((len(res_table)) == 2)

        with self.assertRaises(TypeError):
            traj.f_remove_item(traj.yourtest)

        with self.assertRaises(TypeError):
            traj.f_delete_item(traj.yourtest)

        traj.f_remove_item(traj.yourtest, recursive=True)

        self.assertTrue('mytest' in traj)
        self.assertTrue('yourtest' not in traj)

        traj.f_load(load_data=2)

        self.assertTrue('yourtest.test' in traj)

        traj.f_delete_item(traj.yourtest, recursive=True, remove_from_trajectory=True)
        traj.f_delete_item(traj.mmm, recursive=True, remove_from_trajectory=True)

        traj.f_load(load_data=2)

        self.assertTrue('yourtest.test' not in traj)
        self.assertTrue('yourtest' not in traj)

        with pt.open_file(filename) as fh:
            daroot = fh.root._f_get_child(traj.v_name)
            dpar_table = daroot.overview.derived_parameters_overview
            self.assertTrue(len(dpar_table) == 2)
            res_table = daroot.overview.results_overview
            self.assertTrue((len(res_table)) == 2)

        traj.f_add_parameter('ggg', 43)
        traj.f_add_parameter('hhh.mmm', 45)
        traj.f_add_parameter('jjj', 55)
        traj.f_add_parameter('hhh.nnn', 55555)

        traj.f_explore({'ggg':[1,2,3]})

        traj.f_store()

        with pt.open_file(filename) as fh:
            daroot = fh.root._f_get_child(traj.v_name)
            par_table = daroot.overview.parameters_overview
            self.assertTrue(len(par_table) == 4)

        traj.f_delete_item('par.hhh', recursive=True, remove_from_trajectory=True)

        traj.f_add_parameter('saddsdfdsfd', 111)
        traj.f_store()

        with pt.open_file(filename) as fh:
            daroot = fh.root._f_get_child(traj.v_name)
            par_table = daroot.overview.parameters_overview
            self.assertTrue(len(par_table) == 5)
Beispiel #19
0
    def test_delete_whole_subtrees(self):
        filename = make_temp_dir('testdeltree.hdf5')
        traj = Trajectory(name='TestDelete',
                          filename=filename, large_overview_tables=True)

        res = traj.f_add_result('mytest.yourtest.test', a='b', c='d')
        dpar = traj.f_add_derived_parameter('mmm.gr.dpdp', 666)


        res = traj.f_add_result('hhh.ll', a='b', c='d')
        res = traj.f_add_derived_parameter('hhh.gg', 555)

        traj.f_store()

        with ptcompat.open_file(filename) as fh:
            daroot = ptcompat.get_child(fh.root, traj.v_name)
            dpar_table = daroot.overview.derived_parameters_overview
            self.assertTrue(len(dpar_table) == 2)
            res_table = daroot.overview.results_overview
            self.assertTrue((len(res_table)) == 2)

        with self.assertRaises(TypeError):
            traj.f_remove_item(traj.yourtest)

        with self.assertRaises(TypeError):
            traj.f_delete_item(traj.yourtest)

        traj.f_remove_item(traj.yourtest, recursive=True)

        self.assertTrue('mytest' in traj)
        self.assertTrue('yourtest' not in traj)

        traj.f_load(load_data=2)

        self.assertTrue('yourtest.test' in traj)

        traj.f_delete_item(traj.yourtest, recursive=True, remove_from_trajectory=True)
        traj.f_delete_item(traj.mmm, recursive=True, remove_from_trajectory=True)

        traj.f_load(load_data=2)

        self.assertTrue('yourtest.test' not in traj)
        self.assertTrue('yourtest' not in traj)

        with ptcompat.open_file(filename) as fh:
            daroot = ptcompat.get_child(fh.root, traj.v_name)
            dpar_table = daroot.overview.derived_parameters_overview
            self.assertTrue(len(dpar_table) == 2)
            res_table = daroot.overview.results_overview
            self.assertTrue((len(res_table)) == 2)

        traj.f_add_parameter('ggg', 43)
        traj.f_add_parameter('hhh.mmm', 45)
        traj.f_add_parameter('jjj', 55)
        traj.f_add_parameter('hhh.nnn', 55555)

        traj.f_explore({'ggg':[1,2,3]})

        traj.f_store()

        with ptcompat.open_file(filename) as fh:
            daroot = ptcompat.get_child(fh.root, traj.v_name)
            par_table = daroot.overview.parameters_overview
            self.assertTrue(len(par_table) == 4)

        traj.f_delete_item('par.hhh', recursive=True, remove_from_trajectory=True)

        traj.f_add_parameter('saddsdfdsfd', 111)
        traj.f_store()

        with ptcompat.open_file(filename) as fh:
            daroot = ptcompat.get_child(fh.root, traj.v_name)
            par_table = daroot.overview.parameters_overview
            self.assertTrue(len(par_table) == 5)

        # with self.assertRaises(TypeError):
        #     # We cannot delete something containing an explored parameter
        #     traj.f_delete_item('par', recursive=True)

        with self.assertRaises(TypeError):
            traj.f_delete_item('ggg')