partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
test
Trajectory._prepare_experiment
Called by the environment to make some initial configurations before performing the individual runs. Checks if all parameters marked for presetting were preset. If not raises a DefaultReplacementError. Locks all parameters. Removal of potential results of previous runs in case...
pypet/trajectory.py
def _prepare_experiment(self): """Called by the environment to make some initial configurations before performing the individual runs. Checks if all parameters marked for presetting were preset. If not raises a DefaultReplacementError. Locks all parameters. Removal of ...
def _prepare_experiment(self): """Called by the environment to make some initial configurations before performing the individual runs. Checks if all parameters marked for presetting were preset. If not raises a DefaultReplacementError. Locks all parameters. Removal of ...
[ "Called", "by", "the", "environment", "to", "make", "some", "initial", "configurations", "before", "performing", "the", "individual", "runs", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L788-L809
[ "def", "_prepare_experiment", "(", "self", ")", ":", "if", "len", "(", "self", ".", "_changed_default_parameters", ")", ":", "raise", "pex", ".", "PresettingError", "(", "'The following parameters were supposed to replace a '", "'default value, but it was never tried to '", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_from_runs
Searches for all occurrences of `name` in each run. Generates an ordered dictionary with the run names or indices as keys and found items as values. Example: >>> traj.f_get_from_runs(self, 'deep.universal_answer', use_indices=True, fast_access=True) OrderedDict([(0, 42), (1, 4...
pypet/trajectory.py
def f_get_from_runs(self, name, include_default_run=True, use_indices=False, fast_access=False, with_links = True, shortcuts=True, max_depth=None, auto_load=False): """Searches for all occurrences of `name` in each run. Generates an ordered dictionary wit...
def f_get_from_runs(self, name, include_default_run=True, use_indices=False, fast_access=False, with_links = True, shortcuts=True, max_depth=None, auto_load=False): """Searches for all occurrences of `name` in each run. Generates an ordered dictionary wit...
[ "Searches", "for", "all", "occurrences", "of", "name", "in", "each", "run", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L814-L938
[ "def", "f_get_from_runs", "(", "self", ",", "name", ",", "include_default_run", "=", "True", ",", "use_indices", "=", "False", ",", "fast_access", "=", "False", ",", "with_links", "=", "True", ",", "shortcuts", "=", "True", ",", "max_depth", "=", "None", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._is_completed
Private function such that it can still be called by the environment during a single run
pypet/trajectory.py
def _is_completed(self, name_or_id=None): """Private function such that it can still be called by the environment during a single run""" if name_or_id is None: return all( (runinfo['completed'] for runinfo in self._run_information.values())) else: ...
def _is_completed(self, name_or_id=None): """Private function such that it can still be called by the environment during a single run""" if name_or_id is None: return all( (runinfo['completed'] for runinfo in self._run_information.values())) else: ...
[ "Private", "function", "such", "that", "it", "can", "still", "be", "called", "by", "the", "environment", "during", "a", "single", "run" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L957-L965
[ "def", "_is_completed", "(", "self", ",", "name_or_id", "=", "None", ")", ":", "if", "name_or_id", "is", "None", ":", "return", "all", "(", "(", "runinfo", "[", "'completed'", "]", "for", "runinfo", "in", "self", ".", "_run_information", ".", "values", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_expand
Similar to :func:`~pypet.trajectory.Trajectory.f_explore`, but can be used to enlarge already completed trajectories. Please ensure before usage, that all explored parameters are loaded! :param build_dict: Dictionary containing the expansion :param fail_safe: ...
pypet/trajectory.py
def f_expand(self, build_dict, fail_safe=True): """Similar to :func:`~pypet.trajectory.Trajectory.f_explore`, but can be used to enlarge already completed trajectories. Please ensure before usage, that all explored parameters are loaded! :param build_dict: Dictionary conta...
def f_expand(self, build_dict, fail_safe=True): """Similar to :func:`~pypet.trajectory.Trajectory.f_explore`, but can be used to enlarge already completed trajectories. Please ensure before usage, that all explored parameters are loaded! :param build_dict: Dictionary conta...
[ "Similar", "to", ":", "func", ":", "~pypet", ".", "trajectory", ".", "Trajectory", ".", "f_explore", "but", "can", "be", "used", "to", "enlarge", "already", "completed", "trajectories", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L968-L1072
[ "def", "f_expand", "(", "self", ",", "build_dict", ",", "fail_safe", "=", "True", ")", ":", "if", "len", "(", "self", ".", "_explored_parameters", ")", "==", "0", ":", "self", ".", "_logger", ".", "info", "(", "'Your trajectory has not been explored, yet. '", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._remove_exploration
Called if trajectory is expanded, deletes all explored parameters from disk
pypet/trajectory.py
def _remove_exploration(self): """ Called if trajectory is expanded, deletes all explored parameters from disk """ for param in self._explored_parameters.values(): if param._stored: try: self.f_delete_item(param) except Exception: ...
def _remove_exploration(self): """ Called if trajectory is expanded, deletes all explored parameters from disk """ for param in self._explored_parameters.values(): if param._stored: try: self.f_delete_item(param) except Exception: ...
[ "Called", "if", "trajectory", "is", "expanded", "deletes", "all", "explored", "parameters", "from", "disk" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1084-L1092
[ "def", "_remove_exploration", "(", "self", ")", ":", "for", "param", "in", "self", ".", "_explored_parameters", ".", "values", "(", ")", ":", "if", "param", ".", "_stored", ":", "try", ":", "self", ".", "f_delete_item", "(", "param", ")", "except", "Exce...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_copy
Returns a *shallow* copy of a trajectory. :param copy_leaves: If leaves should be **shallow** copied or simply referred to by both trees. **Shallow** copying is established using the copy module. Accepts the setting ``'explored'`` to only copy explored parameters. ...
pypet/trajectory.py
def f_copy(self, copy_leaves=True, with_links=True): """Returns a *shallow* copy of a trajectory. :param copy_leaves: If leaves should be **shallow** copied or simply referred to by both trees. **Shallow** copying is established using the copy module. ...
def f_copy(self, copy_leaves=True, with_links=True): """Returns a *shallow* copy of a trajectory. :param copy_leaves: If leaves should be **shallow** copied or simply referred to by both trees. **Shallow** copying is established using the copy module. ...
[ "Returns", "a", "*", "shallow", "*", "copy", "of", "a", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1099-L1189
[ "def", "f_copy", "(", "self", ",", "copy_leaves", "=", "True", ",", "with_links", "=", "True", ")", ":", "new_traj", "=", "Trajectory", "(", "_copy_traj", "=", "True", ")", "new_traj", ".", "_length", "=", "self", ".", "_length", "new_traj", ".", "_name"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._copy_from
Pass a ``node`` to insert the full tree to the trajectory. Considers all links in the given node! Ignored nodes already found in the current trajectory. :param node: The node to insert :param copy_leaves: If leaves should be **shallow** copied or simply referred to by bot...
pypet/trajectory.py
def _copy_from(self, node, copy_leaves=True, overwrite=False, with_links=True): """Pass a ``node`` to insert the full tree to the trajectory. Considers all links in the given node! Ignored nodes already found in the c...
def _copy_from(self, node, copy_leaves=True, overwrite=False, with_links=True): """Pass a ``node`` to insert the full tree to the trajectory. Considers all links in the given node! Ignored nodes already found in the c...
[ "Pass", "a", "node", "to", "insert", "the", "full", "tree", "to", "the", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1191-L1303
[ "def", "_copy_from", "(", "self", ",", "node", ",", "copy_leaves", "=", "True", ",", "overwrite", "=", "False", ",", "with_links", "=", "True", ")", ":", "def", "_copy_skeleton", "(", "node_in", ",", "node_out", ")", ":", "\"\"\"Copies the skeleton of from `no...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_explore
Prepares the trajectory to explore the parameter space. To explore the parameter space you need to provide a dictionary with the names of the parameters to explore as keys and iterables specifying the exploration ranges as values. All iterables need to have the same length otherwise a ValueEr...
pypet/trajectory.py
def f_explore(self, build_dict): """Prepares the trajectory to explore the parameter space. To explore the parameter space you need to provide a dictionary with the names of the parameters to explore as keys and iterables specifying the exploration ranges as values. All iterables need...
def f_explore(self, build_dict): """Prepares the trajectory to explore the parameter space. To explore the parameter space you need to provide a dictionary with the names of the parameters to explore as keys and iterables specifying the exploration ranges as values. All iterables need...
[ "Prepares", "the", "trajectory", "to", "explore", "the", "parameter", "space", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1306-L1420
[ "def", "f_explore", "(", "self", ",", "build_dict", ")", ":", "for", "run_idx", "in", "range", "(", "len", "(", "self", ")", ")", ":", "if", "self", ".", "f_is_completed", "(", "run_idx", ")", ":", "raise", "TypeError", "(", "'You cannot explore a trajecto...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._update_run_information
Overwrites the run information of a particular run
pypet/trajectory.py
def _update_run_information(self, run_information_dict): """Overwrites the run information of a particular run""" idx = run_information_dict['idx'] name = run_information_dict['name'] self._run_information[name] = run_information_dict self._updated_run_information.add(idx)
def _update_run_information(self, run_information_dict): """Overwrites the run information of a particular run""" idx = run_information_dict['idx'] name = run_information_dict['name'] self._run_information[name] = run_information_dict self._updated_run_information.add(idx)
[ "Overwrites", "the", "run", "information", "of", "a", "particular", "run" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1422-L1427
[ "def", "_update_run_information", "(", "self", ",", "run_information_dict", ")", ":", "idx", "=", "run_information_dict", "[", "'idx'", "]", "name", "=", "run_information_dict", "[", "'name'", "]", "self", ".", "_run_information", "[", "name", "]", "=", "run_inf...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._add_run_info
Adds a new run to the `_run_information` dict.
pypet/trajectory.py
def _add_run_info(self, idx, name='', timestamp=42.0, finish_timestamp=1.337, runtime='forever and ever', time='>>Maybe time`s gone on strike', completed=0, parameter_summary='Not yet my friend!', short_environment_hexsha='N/A'): """Adds a new ru...
def _add_run_info(self, idx, name='', timestamp=42.0, finish_timestamp=1.337, runtime='forever and ever', time='>>Maybe time`s gone on strike', completed=0, parameter_summary='Not yet my friend!', short_environment_hexsha='N/A'): """Adds a new ru...
[ "Adds", "a", "new", "run", "to", "the", "_run_information", "dict", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1429-L1459
[ "def", "_add_run_info", "(", "self", ",", "idx", ",", "name", "=", "''", ",", "timestamp", "=", "42.0", ",", "finish_timestamp", "=", "1.337", ",", "runtime", "=", "'forever and ever'", ",", "time", "=", "'>>Maybe time`s gone on strike'", ",", "completed", "="...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_lock_parameters
Locks all non-empty parameters
pypet/trajectory.py
def f_lock_parameters(self): """Locks all non-empty parameters""" for par in self._parameters.values(): if not par.f_is_empty(): par.f_lock()
def f_lock_parameters(self): """Locks all non-empty parameters""" for par in self._parameters.values(): if not par.f_is_empty(): par.f_lock()
[ "Locks", "all", "non", "-", "empty", "parameters" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1462-L1466
[ "def", "f_lock_parameters", "(", "self", ")", ":", "for", "par", "in", "self", ".", "_parameters", ".", "values", "(", ")", ":", "if", "not", "par", ".", "f_is_empty", "(", ")", ":", "par", ".", "f_lock", "(", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_lock_derived_parameters
Locks all non-empty derived parameters
pypet/trajectory.py
def f_lock_derived_parameters(self): """Locks all non-empty derived parameters""" for par in self._derived_parameters.values(): if not par.f_is_empty(): par.f_lock()
def f_lock_derived_parameters(self): """Locks all non-empty derived parameters""" for par in self._derived_parameters.values(): if not par.f_is_empty(): par.f_lock()
[ "Locks", "all", "non", "-", "empty", "derived", "parameters" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1469-L1473
[ "def", "f_lock_derived_parameters", "(", "self", ")", ":", "for", "par", "in", "self", ".", "_derived_parameters", ".", "values", "(", ")", ":", "if", "not", "par", ".", "f_is_empty", "(", ")", ":", "par", ".", "f_lock", "(", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._finalize
Final rollback initiated by the environment Restores the trajectory as root of the tree, and stores meta data to disk. This updates the trajectory's information about single runs, i.e. if they've been completed, when they were started, etc.
pypet/trajectory.py
def _finalize(self, store_meta_data=True): """Final rollback initiated by the environment Restores the trajectory as root of the tree, and stores meta data to disk. This updates the trajectory's information about single runs, i.e. if they've been completed, when they were started, etc. ...
def _finalize(self, store_meta_data=True): """Final rollback initiated by the environment Restores the trajectory as root of the tree, and stores meta data to disk. This updates the trajectory's information about single runs, i.e. if they've been completed, when they were started, etc. ...
[ "Final", "rollback", "initiated", "by", "the", "environment" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1475-L1486
[ "def", "_finalize", "(", "self", ",", "store_meta_data", "=", "True", ")", ":", "self", ".", "_is_run", "=", "False", "self", ".", "f_set_crun", "(", "None", ")", "if", "store_meta_data", ":", "self", ".", "f_store", "(", "only_init", "=", "True", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_load_skeleton
Loads the full skeleton from the storage service. This needs to be done after a successful exploration in order to update the trajectory tree with all results and derived parameters from the individual single runs. This will only add empty results and derived parameters (i.e. the skeleton) ...
pypet/trajectory.py
def f_load_skeleton(self): """Loads the full skeleton from the storage service. This needs to be done after a successful exploration in order to update the trajectory tree with all results and derived parameters from the individual single runs. This will only add empty results and deriv...
def f_load_skeleton(self): """Loads the full skeleton from the storage service. This needs to be done after a successful exploration in order to update the trajectory tree with all results and derived parameters from the individual single runs. This will only add empty results and deriv...
[ "Loads", "the", "full", "skeleton", "from", "the", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1489-L1502
[ "def", "f_load_skeleton", "(", "self", ")", ":", "self", ".", "f_load", "(", "self", ".", "v_name", ",", "as_new", "=", "False", ",", "load_parameters", "=", "pypetconstants", ".", "LOAD_SKELETON", ",", "load_derived_parameters", "=", "pypetconstants", ".", "L...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_load
Loads a trajectory via the storage service. If you want to load individual results or parameters manually, you can take a look at :func:`~pypet.trajectory.Trajectory.f_load_items`. To only load subtrees check out :func:`~pypet.naturalnaming.NNGroupNode.f_load_child`. For `f_load` you...
pypet/trajectory.py
def f_load(self, name=None, index=None, as_new=False, load_parameters=pypetconstants.LOAD_DATA, load_derived_parameters=pypetconstants.LOAD_SKELETON, load_results=pypetconstants.LOAD_SKELETON, load_other_data=pypetconstants.LOAD_SKELETON, recursive=True, ...
def f_load(self, name=None, index=None, as_new=False, load_parameters=pypetconstants.LOAD_DATA, load_derived_parameters=pypetconstants.LOAD_SKELETON, load_results=pypetconstants.LOAD_SKELETON, load_other_data=pypetconstants.LOAD_SKELETON, recursive=True, ...
[ "Loads", "a", "trajectory", "via", "the", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1507-L1694
[ "def", "f_load", "(", "self", ",", "name", "=", "None", ",", "index", "=", "None", ",", "as_new", "=", "False", ",", "load_parameters", "=", "pypetconstants", ".", "LOAD_DATA", ",", "load_derived_parameters", "=", "pypetconstants", ".", "LOAD_SKELETON", ",", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._check_if_both_have_same_parameters
Checks if two trajectories live in the same space and can be merged.
pypet/trajectory.py
def _check_if_both_have_same_parameters(self, other_trajectory, ignore_data, consecutive_merge): """ Checks if two trajectories live in the same space and can be merged. """ if not isinstance(other_trajectory, Trajectory): raise TypeError('Can onl...
def _check_if_both_have_same_parameters(self, other_trajectory, ignore_data, consecutive_merge): """ Checks if two trajectories live in the same space and can be merged. """ if not isinstance(other_trajectory, Trajectory): raise TypeError('Can onl...
[ "Checks", "if", "two", "trajectories", "live", "in", "the", "same", "space", "and", "can", "be", "merged", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1696-L1784
[ "def", "_check_if_both_have_same_parameters", "(", "self", ",", "other_trajectory", ",", "ignore_data", ",", "consecutive_merge", ")", ":", "if", "not", "isinstance", "(", "other_trajectory", ",", "Trajectory", ")", ":", "raise", "TypeError", "(", "'Can only merge tra...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_backup
Backs up the trajectory with the given storage service. Arguments of ``kwargs`` are directly passed to the storage service, for the HDF5StorageService you can provide the following argument: :param backup_filename: Name of file where to store the backup. In case you u...
pypet/trajectory.py
def f_backup(self, **kwargs): """Backs up the trajectory with the given storage service. Arguments of ``kwargs`` are directly passed to the storage service, for the HDF5StorageService you can provide the following argument: :param backup_filename: Name of file where to sto...
def f_backup(self, **kwargs): """Backs up the trajectory with the given storage service. Arguments of ``kwargs`` are directly passed to the storage service, for the HDF5StorageService you can provide the following argument: :param backup_filename: Name of file where to sto...
[ "Backs", "up", "the", "trajectory", "with", "the", "given", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1787-L1804
[ "def", "f_backup", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_storage_service", ".", "store", "(", "pypetconstants", ".", "BACKUP", ",", "self", ",", "trajectory_name", "=", "self", ".", "v_name", ",", "*", "*", "kwargs", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._make_reversed_wildcards
Creates a full mapping from all wildcard translations to the corresponding wildcards
pypet/trajectory.py
def _make_reversed_wildcards(self, old_length=-1): """Creates a full mapping from all wildcard translations to the corresponding wildcards""" if len(self._reversed_wildcards) > 0: # We already created reversed wildcards, so we don't need to do all of them # again star...
def _make_reversed_wildcards(self, old_length=-1): """Creates a full mapping from all wildcard translations to the corresponding wildcards""" if len(self._reversed_wildcards) > 0: # We already created reversed wildcards, so we don't need to do all of them # again star...
[ "Creates", "a", "full", "mapping", "from", "all", "wildcard", "translations", "to", "the", "corresponding", "wildcards" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1806-L1819
[ "def", "_make_reversed_wildcards", "(", "self", ",", "old_length", "=", "-", "1", ")", ":", "if", "len", "(", "self", ".", "_reversed_wildcards", ")", ">", "0", ":", "# We already created reversed wildcards, so we don't need to do all of them", "# again", "start", "="...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_merge_many
Can be used to merge several `other_trajectories` into your current one. IMPORTANT `backup=True` only backs up the current trajectory not any of the `other_trajectories`. If you need a backup of these, do it manually. Parameters as for :func:`~pypet.trajectory.Trajectory.f_merge`.
pypet/trajectory.py
def f_merge_many(self, other_trajectories, ignore_data=(), move_data=False, delete_other_trajectory=False, keep_info=True, keep_other_trajectory_info=True, merge_config=True, backup=True): """Can be u...
def f_merge_many(self, other_trajectories, ignore_data=(), move_data=False, delete_other_trajectory=False, keep_info=True, keep_other_trajectory_info=True, merge_config=True, backup=True): """Can be u...
[ "Can", "be", "used", "to", "merge", "several", "other_trajectories", "into", "your", "current", "one", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1822-L1858
[ "def", "f_merge_many", "(", "self", ",", "other_trajectories", ",", "ignore_data", "=", "(", ")", ",", "move_data", "=", "False", ",", "delete_other_trajectory", "=", "False", ",", "keep_info", "=", "True", ",", "keep_other_trajectory_info", "=", "True", ",", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_merge
Merges another trajectory into the current trajectory. Both trajectories must live in the same space. This means both need to have the same parameters with similar types of values. Note that links are also merged. There are exceptions: Links found under a generic run group called `run_...
pypet/trajectory.py
def f_merge(self, other_trajectory, trial_parameter=None, remove_duplicates=False, ignore_data=(), backup=True, move_data=False, delete_other_trajectory=False, keep_info=True, keep_other_trajectory_info=True, ...
def f_merge(self, other_trajectory, trial_parameter=None, remove_duplicates=False, ignore_data=(), backup=True, move_data=False, delete_other_trajectory=False, keep_info=True, keep_other_trajectory_info=True, ...
[ "Merges", "another", "trajectory", "into", "the", "current", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L1865-L2178
[ "def", "f_merge", "(", "self", ",", "other_trajectory", ",", "trial_parameter", "=", "None", ",", "remove_duplicates", "=", "False", ",", "ignore_data", "=", "(", ")", ",", "backup", "=", "True", ",", "move_data", "=", "False", ",", "delete_other_trajectory", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_single_runs
Updates the `run_information` of the current trajectory.
pypet/trajectory.py
def _merge_single_runs(self, other_trajectory, used_runs): """ Updates the `run_information` of the current trajectory.""" count = len(self) # Variable to count the increasing new run indices and create # new run names run_indices = range(len(other_trajectory)) run_name_dict ...
def _merge_single_runs(self, other_trajectory, used_runs): """ Updates the `run_information` of the current trajectory.""" count = len(self) # Variable to count the increasing new run indices and create # new run names run_indices = range(len(other_trajectory)) run_name_dict ...
[ "Updates", "the", "run_information", "of", "the", "current", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2180-L2218
[ "def", "_merge_single_runs", "(", "self", ",", "other_trajectory", ",", "used_runs", ")", ":", "count", "=", "len", "(", "self", ")", "# Variable to count the increasing new run indices and create", "# new run names", "run_indices", "=", "range", "(", "len", "(", "oth...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._rename_full_name
Renames a full name based on the wildcards and a particular run
pypet/trajectory.py
def _rename_full_name(self, full_name, other_trajectory, used_runs=None, new_run_idx=None): """Renames a full name based on the wildcards and a particular run""" split_name = full_name.split('.') for idx, name in enumerate(split_name): if name in other_trajectory._reversed_wildcards:...
def _rename_full_name(self, full_name, other_trajectory, used_runs=None, new_run_idx=None): """Renames a full name based on the wildcards and a particular run""" split_name = full_name.split('.') for idx, name in enumerate(split_name): if name in other_trajectory._reversed_wildcards:...
[ "Renames", "a", "full", "name", "based", "on", "the", "wildcards", "and", "a", "particular", "run" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2220-L2243
[ "def", "_rename_full_name", "(", "self", ",", "full_name", ",", "other_trajectory", ",", "used_runs", "=", "None", ",", "new_run_idx", "=", "None", ")", ":", "split_name", "=", "full_name", ".", "split", "(", "'.'", ")", "for", "idx", ",", "name", "in", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_derived_parameters
Merges derived parameters that have the `run_ALL` in a name. Creates a new parameter with the name of the first new run and links to this parameter to avoid copying in all other runs.
pypet/trajectory.py
def _merge_derived_parameters(self, other_trajectory, used_runs, rename_dict, allowed_translations, ignore_data): """ Merges derived...
def _merge_derived_parameters(self, other_trajectory, used_runs, rename_dict, allowed_translations, ignore_data): """ Merges derived...
[ "Merges", "derived", "parameters", "that", "have", "the", "run_ALL", "in", "a", "name", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2245-L2324
[ "def", "_merge_derived_parameters", "(", "self", ",", "other_trajectory", ",", "used_runs", ",", "rename_dict", ",", "allowed_translations", ",", "ignore_data", ")", ":", "other_derived_parameters", "=", "other_trajectory", ".", "_derived_parameters", ".", "copy", "(", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_links
Merges all links
pypet/trajectory.py
def _merge_links(self, other_trajectory, used_runs, allowed_translations, ignore_data): """ Merges all links""" linked_items = other_trajectory._linked_by run_name_dummys = set([f(-1) for f in other_trajectory._wildcard_functions.values()]) if len(linked_items) > 0: self._log...
def _merge_links(self, other_trajectory, used_runs, allowed_translations, ignore_data): """ Merges all links""" linked_items = other_trajectory._linked_by run_name_dummys = set([f(-1) for f in other_trajectory._wildcard_functions.values()]) if len(linked_items) > 0: self._log...
[ "Merges", "all", "links" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2327-L2401
[ "def", "_merge_links", "(", "self", ",", "other_trajectory", ",", "used_runs", ",", "allowed_translations", ",", "ignore_data", ")", ":", "linked_items", "=", "other_trajectory", ".", "_linked_by", "run_name_dummys", "=", "set", "(", "[", "f", "(", "-", "1", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_config
Merges meta data about previous merges, git commits, and environment settings of the other trajectory into the current one.
pypet/trajectory.py
def _merge_config(self, other_trajectory): """Merges meta data about previous merges, git commits, and environment settings of the other trajectory into the current one. """ self._logger.info('Merging config!') # Merge git commit meta data if 'config.git' in other_traje...
def _merge_config(self, other_trajectory): """Merges meta data about previous merges, git commits, and environment settings of the other trajectory into the current one. """ self._logger.info('Merging config!') # Merge git commit meta data if 'config.git' in other_traje...
[ "Merges", "meta", "data", "about", "previous", "merges", "git", "commits", "and", "environment", "settings", "of", "the", "other", "trajectory", "into", "the", "current", "one", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2403-L2453
[ "def", "_merge_config", "(", "self", ",", "other_trajectory", ")", ":", "self", ".", "_logger", ".", "info", "(", "'Merging config!'", ")", "# Merge git commit meta data", "if", "'config.git'", "in", "other_trajectory", ":", "self", ".", "_logger", ".", "info", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_slowly
Merges trajectories by loading iteratively items of the other trajectory and store it into the current trajectory. :param rename_dict: Dictionary containing mappings from the old result names in the `other_trajectory` to the new names in the current trajectory.
pypet/trajectory.py
def _merge_slowly(self, other_trajectory, rename_dict): """Merges trajectories by loading iteratively items of the other trajectory and store it into the current trajectory. :param rename_dict: Dictionary containing mappings from the old result names in the `other_trajectory` ...
def _merge_slowly(self, other_trajectory, rename_dict): """Merges trajectories by loading iteratively items of the other trajectory and store it into the current trajectory. :param rename_dict: Dictionary containing mappings from the old result names in the `other_trajectory` ...
[ "Merges", "trajectories", "by", "loading", "iteratively", "items", "of", "the", "other", "trajectory", "and", "store", "it", "into", "the", "current", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2455-L2497
[ "def", "_merge_slowly", "(", "self", ",", "other_trajectory", ",", "rename_dict", ")", ":", "for", "other_key", "in", "rename_dict", ":", "new_key", "=", "rename_dict", "[", "other_key", "]", "other_instance", "=", "other_trajectory", ".", "f_get", "(", "other_k...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_results
Merges all results. :param rename_dict: Dictionary that is filled with the names of results in the `other_trajectory` as keys and the corresponding new names in the current trajectory as values. Note for results kept under trajectory run branch there is actually no need to ...
pypet/trajectory.py
def _merge_results(self, other_trajectory, rename_dict, used_runs, allowed_translations, ignore_data): """Merges all results. :param rename_dict: Dictionary that is filled with the names of results in the `other_trajectory` as keys and the corresponding n...
def _merge_results(self, other_trajectory, rename_dict, used_runs, allowed_translations, ignore_data): """Merges all results. :param rename_dict: Dictionary that is filled with the names of results in the `other_trajectory` as keys and the corresponding n...
[ "Merges", "all", "results", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2499-L2527
[ "def", "_merge_results", "(", "self", ",", "other_trajectory", ",", "rename_dict", ",", "used_runs", ",", "allowed_translations", ",", "ignore_data", ")", ":", "other_results", "=", "other_trajectory", ".", "_results", ".", "copy", "(", ")", "for", "result_name", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._merge_parameters
Merges parameters from the other trajectory into the current one. The explored parameters in the current trajectory are directly enlarged (in RAM), no storage service is needed here. Later on in `f_merge` the storage service will be requested to store the enlarge parameters to disk. No...
pypet/trajectory.py
def _merge_parameters(self, other_trajectory, remove_duplicates=False, trial_parameter_name=None, ignore_data=()): """Merges parameters from the other trajectory into the current one. The explored parameters in the current trajectory are directly enla...
def _merge_parameters(self, other_trajectory, remove_duplicates=False, trial_parameter_name=None, ignore_data=()): """Merges parameters from the other trajectory into the current one. The explored parameters in the current trajectory are directly enla...
[ "Merges", "parameters", "from", "the", "other", "trajectory", "into", "the", "current", "one", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2529-L2746
[ "def", "_merge_parameters", "(", "self", ",", "other_trajectory", ",", "remove_duplicates", "=", "False", ",", "trial_parameter_name", "=", "None", ",", "ignore_data", "=", "(", ")", ")", ":", "if", "trial_parameter_name", ":", "if", "remove_duplicates", ":", "s...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_migrate
Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to True if the trajectory has been stored with the new name at the new file before and you just want to "swi...
pypet/trajectory.py
def f_migrate(self, new_name=None, in_store=False, new_storage_service=None, **kwargs): """Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to T...
def f_migrate(self, new_name=None, in_store=False, new_storage_service=None, **kwargs): """Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to T...
[ "Can", "be", "called", "to", "rename", "and", "relocate", "the", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2749-L2787
[ "def", "f_migrate", "(", "self", ",", "new_name", "=", "None", ",", "in_store", "=", "False", ",", "new_storage_service", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "new_name", "is", "not", "None", ":", "self", ".", "_name", "=", "new_name",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_store
Stores the trajectory to disk and recursively all data in the tree. :param only_init: If you just want to initialise the store. If yes, only meta information about the trajectory is stored and none of the groups/leaves within the trajectory. Alternatively, you can pass `rec...
pypet/trajectory.py
def f_store(self, only_init=False, store_data=pypetconstants.STORE_DATA, max_depth=None): """ Stores the trajectory to disk and recursively all data in the tree. :param only_init: If you just want to initialise the store. If yes, only meta information about the ...
def f_store(self, only_init=False, store_data=pypetconstants.STORE_DATA, max_depth=None): """ Stores the trajectory to disk and recursively all data in the tree. :param only_init: If you just want to initialise the store. If yes, only meta information about the ...
[ "Stores", "the", "trajectory", "to", "disk", "and", "recursively", "all", "data", "in", "the", "tree", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2792-L2878
[ "def", "f_store", "(", "self", ",", "only_init", "=", "False", ",", "store_data", "=", "pypetconstants", ".", "STORE_DATA", ",", "max_depth", "=", "None", ")", ":", "if", "self", ".", "_is_run", ":", "if", "self", ".", "_new_nodes", "or", "self", ".", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_is_empty
Whether no results nor parameters have been added yet to the trajectory (ignores config).
pypet/trajectory.py
def f_is_empty(self): """ Whether no results nor parameters have been added yet to the trajectory (ignores config).""" return (len(self._parameters) == 0 and len(self._derived_parameters) == 0 and len(self._results) == 0 and len(self._other_leaves)...
def f_is_empty(self): """ Whether no results nor parameters have been added yet to the trajectory (ignores config).""" return (len(self._parameters) == 0 and len(self._derived_parameters) == 0 and len(self._results) == 0 and len(self._other_leaves)...
[ "Whether", "no", "results", "nor", "parameters", "have", "been", "added", "yet", "to", "the", "trajectory", "(", "ignores", "config", ")", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2882-L2888
[ "def", "f_is_empty", "(", "self", ")", ":", "return", "(", "len", "(", "self", ".", "_parameters", ")", "==", "0", "and", "len", "(", "self", ".", "_derived_parameters", ")", "==", "0", "and", "len", "(", "self", ".", "_results", ")", "==", "0", "a...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_restore_default
Restores the default value in all explored parameters and sets the v_idx property back to -1 and v_crun to None.
pypet/trajectory.py
def f_restore_default(self): """ Restores the default value in all explored parameters and sets the v_idx property back to -1 and v_crun to None.""" self._idx = -1 self._crun = None for param in self._explored_parameters.values(): if param is not None: ...
def f_restore_default(self): """ Restores the default value in all explored parameters and sets the v_idx property back to -1 and v_crun to None.""" self._idx = -1 self._crun = None for param in self._explored_parameters.values(): if param is not None: ...
[ "Restores", "the", "default", "value", "in", "all", "explored", "parameters", "and", "sets", "the", "v_idx", "property", "back", "to", "-", "1", "and", "v_crun", "to", "None", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2891-L2898
[ "def", "f_restore_default", "(", "self", ")", ":", "self", ".", "_idx", "=", "-", "1", "self", ".", "_crun", "=", "None", "for", "param", "in", "self", ".", "_explored_parameters", ".", "values", "(", ")", ":", "if", "param", "is", "not", "None", ":"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._set_explored_parameters_to_idx
Notifies the explored parameters what current point in the parameter space they should represent.
pypet/trajectory.py
def _set_explored_parameters_to_idx(self, idx): """ Notifies the explored parameters what current point in the parameter space they should represent. """ for param in self._explored_parameters.values(): if param is not None: param._set_parameter_access(idx)
def _set_explored_parameters_to_idx(self, idx): """ Notifies the explored parameters what current point in the parameter space they should represent. """ for param in self._explored_parameters.values(): if param is not None: param._set_parameter_access(idx)
[ "Notifies", "the", "explored", "parameters", "what", "current", "point", "in", "the", "parameter", "space", "they", "should", "represent", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2900-L2907
[ "def", "_set_explored_parameters_to_idx", "(", "self", ",", "idx", ")", ":", "for", "param", "in", "self", ".", "_explored_parameters", ".", "values", "(", ")", ":", "if", "param", "is", "not", "None", ":", "param", ".", "_set_parameter_access", "(", "idx", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._make_single_run
Modifies the trajectory for single runs executed by the environment
pypet/trajectory.py
def _make_single_run(self): """ Modifies the trajectory for single runs executed by the environment """ self._is_run = False # to be able to use f_set_crun self._new_nodes = OrderedDict() self._new_links = OrderedDict() self._is_run = True return self
def _make_single_run(self): """ Modifies the trajectory for single runs executed by the environment """ self._is_run = False # to be able to use f_set_crun self._new_nodes = OrderedDict() self._new_links = OrderedDict() self._is_run = True return self
[ "Modifies", "the", "trajectory", "for", "single", "runs", "executed", "by", "the", "environment" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2909-L2915
[ "def", "_make_single_run", "(", "self", ")", ":", "self", ".", "_is_run", "=", "False", "# to be able to use f_set_crun", "self", ".", "_new_nodes", "=", "OrderedDict", "(", ")", "self", ".", "_new_links", "=", "OrderedDict", "(", ")", "self", ".", "_is_run", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_run_names
Returns a list of run names. ONLY useful for a single run during multiprocessing if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. :param sort: Whether to get them sorted, will only require O(N) [and not O(N*log N)] since we use (sort ...
pypet/trajectory.py
def f_get_run_names(self, sort=True): """ Returns a list of run names. ONLY useful for a single run during multiprocessing if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. :param sort: Whether to get them sorted, will only require O(N) [a...
def f_get_run_names(self, sort=True): """ Returns a list of run names. ONLY useful for a single run during multiprocessing if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. :param sort: Whether to get them sorted, will only require O(N) [a...
[ "Returns", "a", "list", "of", "run", "names", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2917-L2932
[ "def", "f_get_run_names", "(", "self", ",", "sort", "=", "True", ")", ":", "if", "sort", ":", "return", "[", "self", ".", "f_idx_to_run", "(", "idx", ")", "for", "idx", "in", "range", "(", "len", "(", "self", ")", ")", "]", "else", ":", "return", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_run_information
Returns a dictionary containing information about a single run. ONLY useful during a single run if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. The information dictionaries have the following key, value pairings: * completed: Boolean, whether a ...
pypet/trajectory.py
def f_get_run_information(self, name_or_idx=None, copy=True): """ Returns a dictionary containing information about a single run. ONLY useful during a single run if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. The information dictionaries have the fo...
def f_get_run_information(self, name_or_idx=None, copy=True): """ Returns a dictionary containing information about a single run. ONLY useful during a single run if ``v_full_copy` was set to ``True``. Otherwise only the current run is available. The information dictionaries have the fo...
[ "Returns", "a", "dictionary", "containing", "information", "about", "a", "single", "run", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L2934-L3000
[ "def", "f_get_run_information", "(", "self", ",", "name_or_idx", "=", "None", ",", "copy", "=", "True", ")", ":", "if", "name_or_idx", "is", "None", ":", "if", "copy", ":", "return", "cp", ".", "deepcopy", "(", "self", ".", "_run_information", ")", "else...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_find_idx
Finds a single run index given a particular condition on parameters. ONLY useful for a single run if ``v_full_copy` was set to ``True``. Otherwise a TypeError is thrown. :param name_list: A list of parameter names the predicate applies to, if you have only a single par...
pypet/trajectory.py
def f_find_idx(self, name_list, predicate): """ Finds a single run index given a particular condition on parameters. ONLY useful for a single run if ``v_full_copy` was set to ``True``. Otherwise a TypeError is thrown. :param name_list: A list of parameter names the predica...
def f_find_idx(self, name_list, predicate): """ Finds a single run index given a particular condition on parameters. ONLY useful for a single run if ``v_full_copy` was set to ``True``. Otherwise a TypeError is thrown. :param name_list: A list of parameter names the predica...
[ "Finds", "a", "single", "run", "index", "given", "a", "particular", "condition", "on", "parameters", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3002-L3053
[ "def", "f_find_idx", "(", "self", ",", "name_list", ",", "predicate", ")", ":", "if", "self", ".", "_is_run", "and", "not", "self", ".", "v_full_copy", ":", "raise", "TypeError", "(", "'You cannot use this function during a multiprocessing signle run and '", "'not hav...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_start_run
Can be used to manually allow running of an experiment without using an environment. :param run_name_or_idx: Can manually set a trajectory to a particular run. If `None` the current run the trajectory is set to is used. :param turn_into_run: Turns the trajectory i...
pypet/trajectory.py
def f_start_run(self, run_name_or_idx=None, turn_into_run=True): """ Can be used to manually allow running of an experiment without using an environment. :param run_name_or_idx: Can manually set a trajectory to a particular run. If `None` the current run the trajectory is set t...
def f_start_run(self, run_name_or_idx=None, turn_into_run=True): """ Can be used to manually allow running of an experiment without using an environment. :param run_name_or_idx: Can manually set a trajectory to a particular run. If `None` the current run the trajectory is set t...
[ "Can", "be", "used", "to", "manually", "allow", "running", "of", "an", "experiment", "without", "using", "an", "environment", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3074-L3104
[ "def", "f_start_run", "(", "self", ",", "run_name_or_idx", "=", "None", ",", "turn_into_run", "=", "True", ")", ":", "if", "self", ".", "_run_started", ":", "return", "self", "if", "run_name_or_idx", "is", "None", ":", "if", "self", ".", "v_idx", "==", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_finalize_run
Can be called to finish a run if manually started. Does NOT reset the index of the run, i.e. ``f_restore_default`` should be called manually if desired. Does NOT store any data (except meta data) so you have to call ``f_store`` manually before to avoid data loss. :param store_...
pypet/trajectory.py
def f_finalize_run(self, store_meta_data=True, clean_up=True): """ Can be called to finish a run if manually started. Does NOT reset the index of the run, i.e. ``f_restore_default`` should be called manually if desired. Does NOT store any data (except meta data) so you have to call ...
def f_finalize_run(self, store_meta_data=True, clean_up=True): """ Can be called to finish a run if manually started. Does NOT reset the index of the run, i.e. ``f_restore_default`` should be called manually if desired. Does NOT store any data (except meta data) so you have to call ...
[ "Can", "be", "called", "to", "finish", "a", "run", "if", "manually", "started", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3106-L3141
[ "def", "f_finalize_run", "(", "self", ",", "store_meta_data", "=", "True", ",", "clean_up", "=", "True", ")", ":", "if", "not", "self", ".", "_run_started", ":", "return", "self", "self", ".", "_set_finish", "(", ")", "if", "clean_up", "and", "self", "."...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._set_start
Sets the start timestamp and formatted time to the current time.
pypet/trajectory.py
def _set_start(self): """ Sets the start timestamp and formatted time to the current time. """ init_time = time.time() formatted_time = datetime.datetime.fromtimestamp(init_time).strftime('%Y_%m_%d_%Hh%Mm%Ss') run_info_dict = self._run_information[self.v_crun] run_info_dict['time...
def _set_start(self): """ Sets the start timestamp and formatted time to the current time. """ init_time = time.time() formatted_time = datetime.datetime.fromtimestamp(init_time).strftime('%Y_%m_%d_%Hh%Mm%Ss') run_info_dict = self._run_information[self.v_crun] run_info_dict['time...
[ "Sets", "the", "start", "timestamp", "and", "formatted", "time", "to", "the", "current", "time", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3143-L3151
[ "def", "_set_start", "(", "self", ")", ":", "init_time", "=", "time", ".", "time", "(", ")", "formatted_time", "=", "datetime", ".", "datetime", ".", "fromtimestamp", "(", "init_time", ")", ".", "strftime", "(", "'%Y_%m_%d_%Hh%Mm%Ss'", ")", "run_info_dict", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._summarize_explored_parameters
Summarizes the parameter settings. :param run_name: Name of the single run :param paramlist: List of explored parameters :param add_table: Whether to add the overview table :param create_run_group: If a group with the particular name should be created if it does not exis...
pypet/trajectory.py
def _summarize_explored_parameters(self): """Summarizes the parameter settings. :param run_name: Name of the single run :param paramlist: List of explored parameters :param add_table: Whether to add the overview table :param create_run_group: If a group with the ...
def _summarize_explored_parameters(self): """Summarizes the parameter settings. :param run_name: Name of the single run :param paramlist: List of explored parameters :param add_table: Whether to add the overview table :param create_run_group: If a group with the ...
[ "Summarizes", "the", "parameter", "settings", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3153-L3189
[ "def", "_summarize_explored_parameters", "(", "self", ")", ":", "runsummary", "=", "''", "for", "idx", ",", "expparam", "in", "enumerate", "(", "self", ".", "_explored_parameters", ".", "values", "(", ")", ")", ":", "# Create the run summary for the `run` overview",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._set_finish
Sets the finish time and computes the runtime in human readable format
pypet/trajectory.py
def _set_finish(self): """ Sets the finish time and computes the runtime in human readable format """ run_info_dict = self._run_information[self.v_crun] timestamp_run = run_info_dict['timestamp'] run_summary = self._summarize_explored_parameters() finish_timestamp_run = time.t...
def _set_finish(self): """ Sets the finish time and computes the runtime in human readable format """ run_info_dict = self._run_information[self.v_crun] timestamp_run = run_info_dict['timestamp'] run_summary = self._summarize_explored_parameters() finish_timestamp_run = time.t...
[ "Sets", "the", "finish", "time", "and", "computes", "the", "runtime", "in", "human", "readable", "format" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3191-L3209
[ "def", "_set_finish", "(", "self", ")", ":", "run_info_dict", "=", "self", ".", "_run_information", "[", "self", ".", "v_crun", "]", "timestamp_run", "=", "run_info_dict", "[", "'timestamp'", "]", "run_summary", "=", "self", ".", "_summarize_explored_parameters", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._construct_instance
Creates a new node. Checks if the new node needs to know the trajectory. :param constructor: The constructor to use :param full_name: Full name of node :param args: Arguments passed to constructor :param kwargs: Keyword arguments passed to the constructor :return:
pypet/trajectory.py
def _construct_instance(self, constructor, full_name, *args, **kwargs): """ Creates a new node. Checks if the new node needs to know the trajectory. :param constructor: The constructor to use :param full_name: Full name of node :param args: Arguments passed to constructor :para...
def _construct_instance(self, constructor, full_name, *args, **kwargs): """ Creates a new node. Checks if the new node needs to know the trajectory. :param constructor: The constructor to use :param full_name: Full name of node :param args: Arguments passed to constructor :para...
[ "Creates", "a", "new", "node", ".", "Checks", "if", "the", "new", "node", "needs", "to", "know", "the", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3211-L3223
[ "def", "_construct_instance", "(", "self", ",", "constructor", ",", "full_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "getattr", "(", "constructor", ",", "'KNOWS_TRAJECTORY'", ",", "False", ")", ":", "return", "constructor", "(", "ful...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._return_item_dictionary
Returns a dictionary containing either all parameters, all explored parameters, all config, all derived parameters, or all results. :param param_dict: The dictionary which is about to be returned :param fast_access: Whether to use fast access :param copy: If the original dict should be ...
pypet/trajectory.py
def _return_item_dictionary(param_dict, fast_access, copy): """Returns a dictionary containing either all parameters, all explored parameters, all config, all derived parameters, or all results. :param param_dict: The dictionary which is about to be returned :param fast_access: Whether ...
def _return_item_dictionary(param_dict, fast_access, copy): """Returns a dictionary containing either all parameters, all explored parameters, all config, all derived parameters, or all results. :param param_dict: The dictionary which is about to be returned :param fast_access: Whether ...
[ "Returns", "a", "dictionary", "containing", "either", "all", "parameters", "all", "explored", "parameters", "all", "config", "all", "derived", "parameters", "or", "all", "results", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3396-L3426
[ "def", "_return_item_dictionary", "(", "param_dict", ",", "fast_access", ",", "copy", ")", ":", "if", "not", "copy", "and", "fast_access", ":", "raise", "ValueError", "(", "'You cannot access the original dictionary and use fast access at the'", "' same time!'", ")", "if"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory._finalize_run
Called by the environment after storing to perform some rollback operations. All results and derived parameters created in the current run are removed. Important for single processing to not blow up the parent trajectory with the results of all runs.
pypet/trajectory.py
def _finalize_run(self): """Called by the environment after storing to perform some rollback operations. All results and derived parameters created in the current run are removed. Important for single processing to not blow up the parent trajectory with the results of all runs. ...
def _finalize_run(self): """Called by the environment after storing to perform some rollback operations. All results and derived parameters created in the current run are removed. Important for single processing to not blow up the parent trajectory with the results of all runs. ...
[ "Called", "by", "the", "environment", "after", "storing", "to", "perform", "some", "rollback", "operations", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3428-L3448
[ "def", "_finalize_run", "(", "self", ")", ":", "self", ".", "_run_information", "[", "self", ".", "v_crun", "]", "[", "'completed'", "]", "=", "1", "while", "len", "(", "self", ".", "_new_links", ")", ":", "name_pair", ",", "child_parent_pair", "=", "sel...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_to_dict
Returns a dictionary with pairings of (full) names as keys and instances/values. :param fast_access: If True, parameter values are returned instead of the instances. Works also for results if they contain a single item with the name of the result. :param short_names: ...
pypet/trajectory.py
def f_to_dict(self, fast_access=False, short_names=False, nested=False, copy=True, with_links=True): """Returns a dictionary with pairings of (full) names as keys and instances/values. :param fast_access: If True, parameter values are returned instead of the instances. ...
def f_to_dict(self, fast_access=False, short_names=False, nested=False, copy=True, with_links=True): """Returns a dictionary with pairings of (full) names as keys and instances/values. :param fast_access: If True, parameter values are returned instead of the instances. ...
[ "Returns", "a", "dictionary", "with", "pairings", "of", "(", "full", ")", "names", "as", "keys", "and", "instances", "/", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3450-L3488
[ "def", "f_to_dict", "(", "self", ",", "fast_access", "=", "False", ",", "short_names", "=", "False", ",", "nested", "=", "False", ",", "copy", "=", "True", ",", "with_links", "=", "True", ")", ":", "return", "self", ".", "_nn_interface", ".", "_to_dict",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_config
Returns a dictionary containing the full config names as keys and the config parameters or the config parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned in the dictionary. :param copy: ...
pypet/trajectory.py
def f_get_config(self, fast_access=False, copy=True): """Returns a dictionary containing the full config names as keys and the config parameters or the config parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned ...
def f_get_config(self, fast_access=False, copy=True): """Returns a dictionary containing the full config names as keys and the config parameters or the config parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned ...
[ "Returns", "a", "dictionary", "containing", "the", "full", "config", "names", "as", "keys", "and", "the", "config", "parameters", "or", "the", "config", "parameter", "data", "items", "as", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3490-L3512
[ "def", "f_get_config", "(", "self", ",", "fast_access", "=", "False", ",", "copy", "=", "True", ")", ":", "return", "self", ".", "_return_item_dictionary", "(", "self", ".", "_config", ",", "fast_access", ",", "copy", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_parameters
Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned in the dictionary. :param copy: Whether t...
pypet/trajectory.py
def f_get_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned ...
def f_get_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned ...
[ "Returns", "a", "dictionary", "containing", "the", "full", "parameter", "names", "as", "keys", "and", "the", "parameters", "or", "the", "parameter", "data", "items", "as", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3514-L3536
[ "def", "f_get_parameters", "(", "self", ",", "fast_access", "=", "False", ",", "copy", "=", "True", ")", ":", "return", "self", ".", "_return_item_dictionary", "(", "self", ".", "_parameters", ",", "fast_access", ",", "copy", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_explored_parameters
Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. IMPORTANT: This dictionary always contains all explored parameters as keys. Even when they are not loaded, in this case the value is simply `None`. `fast_access...
pypet/trajectory.py
def f_get_explored_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. IMPORTANT: This dictionary always contains all explored parameters as keys. Even when they...
def f_get_explored_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. IMPORTANT: This dictionary always contains all explored parameters as keys. Even when they...
[ "Returns", "a", "dictionary", "containing", "the", "full", "parameter", "names", "as", "keys", "and", "the", "parameters", "or", "the", "parameter", "data", "items", "as", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3539-L3565
[ "def", "f_get_explored_parameters", "(", "self", ",", "fast_access", "=", "False", ",", "copy", "=", "True", ")", ":", "return", "self", ".", "_return_item_dictionary", "(", "self", ".", "_explored_parameters", ",", "fast_access", ",", "copy", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_derived_parameters
Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are returned in the dictionary. :param copy: Whether t...
pypet/trajectory.py
def f_get_derived_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are return...
def f_get_derived_parameters(self, fast_access=False, copy=True): """ Returns a dictionary containing the full parameter names as keys and the parameters or the parameter data items as values. :param fast_access: Determines whether the parameter objects or their values are return...
[ "Returns", "a", "dictionary", "containing", "the", "full", "parameter", "names", "as", "keys", "and", "the", "parameters", "or", "the", "parameter", "data", "items", "as", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3567-L3589
[ "def", "f_get_derived_parameters", "(", "self", ",", "fast_access", "=", "False", ",", "copy", "=", "True", ")", ":", "return", "self", ".", "_return_item_dictionary", "(", "self", ".", "_derived_parameters", ",", "fast_access", ",", "copy", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_get_results
Returns a dictionary containing the full result names as keys and the corresponding result objects or result data items as values. :param fast_access: Determines whether the result objects or their values are returned in the dictionary. Works only for results if they contain a...
pypet/trajectory.py
def f_get_results(self, fast_access=False, copy=True): """ Returns a dictionary containing the full result names as keys and the corresponding result objects or result data items as values. :param fast_access: Determines whether the result objects or their values are returned ...
def f_get_results(self, fast_access=False, copy=True): """ Returns a dictionary containing the full result names as keys and the corresponding result objects or result data items as values. :param fast_access: Determines whether the result objects or their values are returned ...
[ "Returns", "a", "dictionary", "containing", "the", "full", "result", "names", "as", "keys", "and", "the", "corresponding", "result", "objects", "or", "result", "data", "items", "as", "values", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3591-L3614
[ "def", "f_get_results", "(", "self", ",", "fast_access", "=", "False", ",", "copy", "=", "True", ")", ":", "return", "self", ".", "_return_item_dictionary", "(", "self", ".", "_results", ",", "fast_access", ",", "copy", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_store_item
Stores a single item, see also :func:`~pypet.trajectory.Trajectory.f_store_items`.
pypet/trajectory.py
def f_store_item(self, item, *args, **kwargs): """Stores a single item, see also :func:`~pypet.trajectory.Trajectory.f_store_items`.""" self.f_store_items([item], *args, **kwargs)
def f_store_item(self, item, *args, **kwargs): """Stores a single item, see also :func:`~pypet.trajectory.Trajectory.f_store_items`.""" self.f_store_items([item], *args, **kwargs)
[ "Stores", "a", "single", "item", "see", "also", ":", "func", ":", "~pypet", ".", "trajectory", ".", "Trajectory", ".", "f_store_items", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3616-L3618
[ "def", "f_store_item", "(", "self", ",", "item", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "f_store_items", "(", "[", "item", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_store_items
Stores individual items to disk. This function is useful if you calculated very large results (or large derived parameters) during runtime and you want to write these to disk immediately and empty them afterwards to free some memory. Instead of storing individual parameters or results ...
pypet/trajectory.py
def f_store_items(self, iterator, *args, **kwargs): """Stores individual items to disk. This function is useful if you calculated very large results (or large derived parameters) during runtime and you want to write these to disk immediately and empty them afterwards to free some memory...
def f_store_items(self, iterator, *args, **kwargs): """Stores individual items to disk. This function is useful if you calculated very large results (or large derived parameters) during runtime and you want to write these to disk immediately and empty them afterwards to free some memory...
[ "Stores", "individual", "items", "to", "disk", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3620-L3704
[ "def", "f_store_items", "(", "self", ",", "iterator", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "_stored", ":", "raise", "TypeError", "(", "'Cannot store stuff for a trajectory that has never been '", "'stored to disk. Please cal...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_load_item
Loads a single item, see also :func:`~pypet.trajectory.Trajectory.f_load_items`
pypet/trajectory.py
def f_load_item(self, item, *args, **kwargs): """Loads a single item, see also :func:`~pypet.trajectory.Trajectory.f_load_items`""" self.f_load_items([item], *args, **kwargs)
def f_load_item(self, item, *args, **kwargs): """Loads a single item, see also :func:`~pypet.trajectory.Trajectory.f_load_items`""" self.f_load_items([item], *args, **kwargs)
[ "Loads", "a", "single", "item", "see", "also", ":", "func", ":", "~pypet", ".", "trajectory", ".", "Trajectory", ".", "f_load_items" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3706-L3708
[ "def", "f_load_item", "(", "self", ",", "item", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "f_load_items", "(", "[", "item", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_load_items
Loads parameters and results specified in `iterator`. You can directly list the Parameter objects or just their names. If names are given the `~pypet.naturalnaming.NNGroupNode.f_get` method is applied to find the parameters or results in the trajectory. Accordingly, the parameters and results ...
pypet/trajectory.py
def f_load_items(self, iterator, *args, **kwargs): """Loads parameters and results specified in `iterator`. You can directly list the Parameter objects or just their names. If names are given the `~pypet.naturalnaming.NNGroupNode.f_get` method is applied to find the parameters or resul...
def f_load_items(self, iterator, *args, **kwargs): """Loads parameters and results specified in `iterator`. You can directly list the Parameter objects or just their names. If names are given the `~pypet.naturalnaming.NNGroupNode.f_get` method is applied to find the parameters or resul...
[ "Loads", "parameters", "and", "results", "specified", "in", "iterator", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3710-L3788
[ "def", "f_load_items", "(", "self", ",", "iterator", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "_stored", ":", "raise", "TypeError", "(", "'Cannot load stuff from disk for a trajectory that has never been stored.'", ")", "fetch...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_remove_item
Removes a single item, see :func:`~pypet.trajectory.Trajectory.f_remove_items`
pypet/trajectory.py
def f_remove_item(self, item, recursive=False): """Removes a single item, see :func:`~pypet.trajectory.Trajectory.f_remove_items`""" self.f_remove_items([item], recursive=recursive)
def f_remove_item(self, item, recursive=False): """Removes a single item, see :func:`~pypet.trajectory.Trajectory.f_remove_items`""" self.f_remove_items([item], recursive=recursive)
[ "Removes", "a", "single", "item", "see", ":", "func", ":", "~pypet", ".", "trajectory", ".", "Trajectory", ".", "f_remove_items" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3791-L3793
[ "def", "f_remove_item", "(", "self", ",", "item", ",", "recursive", "=", "False", ")", ":", "self", ".", "f_remove_items", "(", "[", "item", "]", ",", "recursive", "=", "recursive", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_remove_items
Removes parameters, results or groups from the trajectory. This function ONLY removes items from your current trajectory and does not delete data stored to disk. If you want to delete data from disk, take a look at :func:`~pypet.trajectory.Trajectory.f_delete_items`. This will also rem...
pypet/trajectory.py
def f_remove_items(self, iterator, recursive=False): """Removes parameters, results or groups from the trajectory. This function ONLY removes items from your current trajectory and does not delete data stored to disk. If you want to delete data from disk, take a look at :func:`~pypet.tr...
def f_remove_items(self, iterator, recursive=False): """Removes parameters, results or groups from the trajectory. This function ONLY removes items from your current trajectory and does not delete data stored to disk. If you want to delete data from disk, take a look at :func:`~pypet.tr...
[ "Removes", "parameters", "results", "or", "groups", "from", "the", "trajectory", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3796-L3826
[ "def", "f_remove_items", "(", "self", ",", "iterator", ",", "recursive", "=", "False", ")", ":", "# Will format the request in a form that is understood by the storage service", "# aka (msg, item, args, kwargs)", "fetched_items", "=", "self", ".", "_nn_interface", ".", "_fetc...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_delete_links
Deletes several links from the hard disk. Links can be passed as a string ``'groupA.groupB.linkA'`` or as a tuple containing the node from which the link should be removed and the name of the link ``(groupWithLink, 'linkA')``.
pypet/trajectory.py
def f_delete_links(self, iterator_of_links, remove_from_trajectory=False): """Deletes several links from the hard disk. Links can be passed as a string ``'groupA.groupB.linkA'`` or as a tuple containing the node from which the link should be removed and the name of the link ``(groupWit...
def f_delete_links(self, iterator_of_links, remove_from_trajectory=False): """Deletes several links from the hard disk. Links can be passed as a string ``'groupA.groupB.linkA'`` or as a tuple containing the node from which the link should be removed and the name of the link ``(groupWit...
[ "Deletes", "several", "links", "from", "the", "hard", "disk", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3832-L3868
[ "def", "f_delete_links", "(", "self", ",", "iterator_of_links", ",", "remove_from_trajectory", "=", "False", ")", ":", "to_delete_links", "=", "[", "]", "group_link_pairs", "=", "[", "]", "for", "elem", "in", "iterator_of_links", ":", "if", "isinstance", "(", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_remove
Recursively removes all children of the trajectory :param recursive: Only here for consistency with signature of parent method. Cannot be set to `False` because the trajectory root node cannot be removed. :param predicate: Predicate which can evaluate for each nod...
pypet/trajectory.py
def f_remove(self, recursive=True, predicate=None): """Recursively removes all children of the trajectory :param recursive: Only here for consistency with signature of parent method. Cannot be set to `False` because the trajectory root node cannot be removed. :param pr...
def f_remove(self, recursive=True, predicate=None): """Recursively removes all children of the trajectory :param recursive: Only here for consistency with signature of parent method. Cannot be set to `False` because the trajectory root node cannot be removed. :param pr...
[ "Recursively", "removes", "all", "children", "of", "the", "trajectory" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3870-L3888
[ "def", "f_remove", "(", "self", ",", "recursive", "=", "True", ",", "predicate", "=", "None", ")", ":", "if", "not", "recursive", ":", "raise", "ValueError", "(", "'Nice try ;-)'", ")", "for", "child", "in", "list", "(", "self", ".", "_children", ".", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_delete_item
Deletes a single item, see :func:`~pypet.trajectory.Trajectory.f_delete_items`
pypet/trajectory.py
def f_delete_item(self, item, *args, **kwargs): """Deletes a single item, see :func:`~pypet.trajectory.Trajectory.f_delete_items`""" self.f_delete_items([item], *args, **kwargs)
def f_delete_item(self, item, *args, **kwargs): """Deletes a single item, see :func:`~pypet.trajectory.Trajectory.f_delete_items`""" self.f_delete_items([item], *args, **kwargs)
[ "Deletes", "a", "single", "item", "see", ":", "func", ":", "~pypet", ".", "trajectory", ".", "Trajectory", ".", "f_delete_items" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3891-L3893
[ "def", "f_delete_item", "(", "self", ",", "item", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "f_delete_items", "(", "[", "item", "]", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Trajectory.f_delete_items
Deletes items from storage on disk. Per default the item is NOT removed from the trajectory. Links are NOT deleted on the hard disk, please delete links manually before deleting data! :param iterator: A sequence of items you want to remove. Either the instances themselves...
pypet/trajectory.py
def f_delete_items(self, iterator, *args, **kwargs): """Deletes items from storage on disk. Per default the item is NOT removed from the trajectory. Links are NOT deleted on the hard disk, please delete links manually before deleting data! :param iterator: A seque...
def f_delete_items(self, iterator, *args, **kwargs): """Deletes items from storage on disk. Per default the item is NOT removed from the trajectory. Links are NOT deleted on the hard disk, please delete links manually before deleting data! :param iterator: A seque...
[ "Deletes", "items", "from", "storage", "on", "disk", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L3896-L3981
[ "def", "f_delete_items", "(", "self", ",", "iterator", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "remove_from_trajectory", "=", "kwargs", ".", "pop", "(", "'remove_from_trajectory'", ",", "False", ")", "recursive", "=", "kwargs", ".", "get", "("...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_pool_single_run
Starts a pool single run and passes the storage service
pypet/environment.py
def _pool_single_run(kwargs): """Starts a pool single run and passes the storage service""" wrap_mode = kwargs['wrap_mode'] traj = kwargs['traj'] traj.v_storage_service = _pool_single_run.storage_service if wrap_mode == pypetconstants.WRAP_MODE_LOCAL: # Free references from previous runs ...
def _pool_single_run(kwargs): """Starts a pool single run and passes the storage service""" wrap_mode = kwargs['wrap_mode'] traj = kwargs['traj'] traj.v_storage_service = _pool_single_run.storage_service if wrap_mode == pypetconstants.WRAP_MODE_LOCAL: # Free references from previous runs ...
[ "Starts", "a", "pool", "single", "run", "and", "passes", "the", "storage", "service" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L88-L96
[ "def", "_pool_single_run", "(", "kwargs", ")", ":", "wrap_mode", "=", "kwargs", "[", "'wrap_mode'", "]", "traj", "=", "kwargs", "[", "'traj'", "]", "traj", ".", "v_storage_service", "=", "_pool_single_run", ".", "storage_service", "if", "wrap_mode", "==", "pyp...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_frozen_pool_single_run
Single run wrapper for the frozen pool, makes a single run and passes kwargs
pypet/environment.py
def _frozen_pool_single_run(kwargs): """Single run wrapper for the frozen pool, makes a single run and passes kwargs""" idx = kwargs.pop('idx') frozen_kwargs = _frozen_pool_single_run.kwargs frozen_kwargs.update(kwargs) # in case of `run_map` # we need to update job's args and kwargs traj = fro...
def _frozen_pool_single_run(kwargs): """Single run wrapper for the frozen pool, makes a single run and passes kwargs""" idx = kwargs.pop('idx') frozen_kwargs = _frozen_pool_single_run.kwargs frozen_kwargs.update(kwargs) # in case of `run_map` # we need to update job's args and kwargs traj = fro...
[ "Single", "run", "wrapper", "for", "the", "frozen", "pool", "makes", "a", "single", "run", "and", "passes", "kwargs" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L99-L107
[ "def", "_frozen_pool_single_run", "(", "kwargs", ")", ":", "idx", "=", "kwargs", ".", "pop", "(", "'idx'", ")", "frozen_kwargs", "=", "_frozen_pool_single_run", ".", "kwargs", "frozen_kwargs", ".", "update", "(", "kwargs", ")", "# in case of `run_map`", "# we need...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_configure_pool
Configures the pool and keeps the storage service
pypet/environment.py
def _configure_pool(kwargs): """Configures the pool and keeps the storage service""" _pool_single_run.storage_service = kwargs['storage_service'] _configure_niceness(kwargs) _configure_logging(kwargs, extract=False)
def _configure_pool(kwargs): """Configures the pool and keeps the storage service""" _pool_single_run.storage_service = kwargs['storage_service'] _configure_niceness(kwargs) _configure_logging(kwargs, extract=False)
[ "Configures", "the", "pool", "and", "keeps", "the", "storage", "service" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L110-L114
[ "def", "_configure_pool", "(", "kwargs", ")", ":", "_pool_single_run", ".", "storage_service", "=", "kwargs", "[", "'storage_service'", "]", "_configure_niceness", "(", "kwargs", ")", "_configure_logging", "(", "kwargs", ",", "extract", "=", "False", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_configure_frozen_pool
Configures the frozen pool and keeps all kwargs
pypet/environment.py
def _configure_frozen_pool(kwargs): """Configures the frozen pool and keeps all kwargs""" _frozen_pool_single_run.kwargs = kwargs _configure_niceness(kwargs) _configure_logging(kwargs, extract=False) # Reset full copy to it's old value traj = kwargs['traj'] traj.v_full_copy = kwargs['full_co...
def _configure_frozen_pool(kwargs): """Configures the frozen pool and keeps all kwargs""" _frozen_pool_single_run.kwargs = kwargs _configure_niceness(kwargs) _configure_logging(kwargs, extract=False) # Reset full copy to it's old value traj = kwargs['traj'] traj.v_full_copy = kwargs['full_co...
[ "Configures", "the", "frozen", "pool", "and", "keeps", "all", "kwargs" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L117-L124
[ "def", "_configure_frozen_pool", "(", "kwargs", ")", ":", "_frozen_pool_single_run", ".", "kwargs", "=", "kwargs", "_configure_niceness", "(", "kwargs", ")", "_configure_logging", "(", "kwargs", ",", "extract", "=", "False", ")", "# Reset full copy to it's old value", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_process_single_run
Wrapper function that first configures logging and starts a single run afterwards.
pypet/environment.py
def _process_single_run(kwargs): """Wrapper function that first configures logging and starts a single run afterwards.""" _configure_niceness(kwargs) _configure_logging(kwargs) result_queue = kwargs['result_queue'] result = _sigint_handling_single_run(kwargs) result_queue.put(result) result_...
def _process_single_run(kwargs): """Wrapper function that first configures logging and starts a single run afterwards.""" _configure_niceness(kwargs) _configure_logging(kwargs) result_queue = kwargs['result_queue'] result = _sigint_handling_single_run(kwargs) result_queue.put(result) result_...
[ "Wrapper", "function", "that", "first", "configures", "logging", "and", "starts", "a", "single", "run", "afterwards", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L127-L134
[ "def", "_process_single_run", "(", "kwargs", ")", ":", "_configure_niceness", "(", "kwargs", ")", "_configure_logging", "(", "kwargs", ")", "result_queue", "=", "kwargs", "[", "'result_queue'", "]", "result", "=", "_sigint_handling_single_run", "(", "kwargs", ")", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_configure_frozen_scoop
Wrapper function that configures a frozen SCOOP set up. Deletes of data if necessary.
pypet/environment.py
def _configure_frozen_scoop(kwargs): """Wrapper function that configures a frozen SCOOP set up. Deletes of data if necessary. """ def _delete_old_scoop_rev_data(old_scoop_rev): if old_scoop_rev is not None: try: elements = shared.elements for key in ...
def _configure_frozen_scoop(kwargs): """Wrapper function that configures a frozen SCOOP set up. Deletes of data if necessary. """ def _delete_old_scoop_rev_data(old_scoop_rev): if old_scoop_rev is not None: try: elements = shared.elements for key in ...
[ "Wrapper", "function", "that", "configures", "a", "frozen", "SCOOP", "set", "up", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L137-L173
[ "def", "_configure_frozen_scoop", "(", "kwargs", ")", ":", "def", "_delete_old_scoop_rev_data", "(", "old_scoop_rev", ")", ":", "if", "old_scoop_rev", "is", "not", "None", ":", "try", ":", "elements", "=", "shared", ".", "elements", "for", "key", "in", "elemen...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_scoop_single_run
Wrapper function for scoop, that does not configure logging
pypet/environment.py
def _scoop_single_run(kwargs): """Wrapper function for scoop, that does not configure logging""" try: try: is_origin = scoop.IS_ORIGIN except AttributeError: # scoop is not properly started, i.e. with `python -m scoop...` # in this case scoop uses default `map...
def _scoop_single_run(kwargs): """Wrapper function for scoop, that does not configure logging""" try: try: is_origin = scoop.IS_ORIGIN except AttributeError: # scoop is not properly started, i.e. with `python -m scoop...` # in this case scoop uses default `map...
[ "Wrapper", "function", "for", "scoop", "that", "does", "not", "configure", "logging" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L190-L207
[ "def", "_scoop_single_run", "(", "kwargs", ")", ":", "try", ":", "try", ":", "is_origin", "=", "scoop", ".", "IS_ORIGIN", "except", "AttributeError", ":", "# scoop is not properly started, i.e. with `python -m scoop...`", "# in this case scoop uses default `map` function, i.e."...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_configure_logging
Requests the logging manager to configure logging. :param extract: If naming data should be extracted from the trajectory
pypet/environment.py
def _configure_logging(kwargs, extract=True): """Requests the logging manager to configure logging. :param extract: If naming data should be extracted from the trajectory """ try: logging_manager = kwargs['logging_manager'] if extract: logging_manager.extract_repla...
def _configure_logging(kwargs, extract=True): """Requests the logging manager to configure logging. :param extract: If naming data should be extracted from the trajectory """ try: logging_manager = kwargs['logging_manager'] if extract: logging_manager.extract_repla...
[ "Requests", "the", "logging", "manager", "to", "configure", "logging", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L210-L225
[ "def", "_configure_logging", "(", "kwargs", ",", "extract", "=", "True", ")", ":", "try", ":", "logging_manager", "=", "kwargs", "[", "'logging_manager'", "]", "if", "extract", ":", "logging_manager", ".", "extract_replacements", "(", "kwargs", "[", "'traj'", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_configure_niceness
Sets niceness of a process
pypet/environment.py
def _configure_niceness(kwargs): """Sets niceness of a process""" niceness = kwargs['niceness'] if niceness is not None: try: try: current = os.nice(0) if niceness - current > 0: # Under Linux you cannot decrement niceness if set elsewh...
def _configure_niceness(kwargs): """Sets niceness of a process""" niceness = kwargs['niceness'] if niceness is not None: try: try: current = os.nice(0) if niceness - current > 0: # Under Linux you cannot decrement niceness if set elsewh...
[ "Sets", "niceness", "of", "a", "process" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L228-L243
[ "def", "_configure_niceness", "(", "kwargs", ")", ":", "niceness", "=", "kwargs", "[", "'niceness'", "]", "if", "niceness", "is", "not", "None", ":", "try", ":", "try", ":", "current", "=", "os", ".", "nice", "(", "0", ")", "if", "niceness", "-", "cu...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_sigint_handling_single_run
Wrapper that allow graceful exits of single runs
pypet/environment.py
def _sigint_handling_single_run(kwargs): """Wrapper that allow graceful exits of single runs""" try: graceful_exit = kwargs['graceful_exit'] if graceful_exit: sigint_handling.start() if sigint_handling.hit: result = (sigint_handling.SIGINT, None) ...
def _sigint_handling_single_run(kwargs): """Wrapper that allow graceful exits of single runs""" try: graceful_exit = kwargs['graceful_exit'] if graceful_exit: sigint_handling.start() if sigint_handling.hit: result = (sigint_handling.SIGINT, None) ...
[ "Wrapper", "that", "allow", "graceful", "exits", "of", "single", "runs" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L245-L265
[ "def", "_sigint_handling_single_run", "(", "kwargs", ")", ":", "try", ":", "graceful_exit", "=", "kwargs", "[", "'graceful_exit'", "]", "if", "graceful_exit", ":", "sigint_handling", ".", "start", "(", ")", "if", "sigint_handling", ".", "hit", ":", "result", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_single_run
Performs a single run of the experiment. :param kwargs: Dict of arguments traj: The trajectory containing all parameters set to the corresponding run index. runfunc: The user's job function runargs: The arguments handed to the user's job function (as *args) runkwargs: The keywor...
pypet/environment.py
def _single_run(kwargs): """ Performs a single run of the experiment. :param kwargs: Dict of arguments traj: The trajectory containing all parameters set to the corresponding run index. runfunc: The user's job function runargs: The arguments handed to the user's job function (as *arg...
def _single_run(kwargs): """ Performs a single run of the experiment. :param kwargs: Dict of arguments traj: The trajectory containing all parameters set to the corresponding run index. runfunc: The user's job function runargs: The arguments handed to the user's job function (as *arg...
[ "Performs", "a", "single", "run", "of", "the", "experiment", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L268-L338
[ "def", "_single_run", "(", "kwargs", ")", ":", "pypet_root_logger", "=", "logging", ".", "getLogger", "(", "'pypet'", ")", "traj", "=", "kwargs", "[", "'traj'", "]", "runfunc", "=", "kwargs", "[", "'runfunc'", "]", "runargs", "=", "kwargs", "[", "'runargs'...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
_wrap_handling
Starts running a queue handler and creates a log file for the queue.
pypet/environment.py
def _wrap_handling(kwargs): """ Starts running a queue handler and creates a log file for the queue.""" _configure_logging(kwargs, extract=False) # Main job, make the listener to the queue start receiving message for writing to disk. handler=kwargs['handler'] graceful_exit = kwargs['graceful_exit'] ...
def _wrap_handling(kwargs): """ Starts running a queue handler and creates a log file for the queue.""" _configure_logging(kwargs, extract=False) # Main job, make the listener to the queue start receiving message for writing to disk. handler=kwargs['handler'] graceful_exit = kwargs['graceful_exit'] ...
[ "Starts", "running", "a", "queue", "handler", "and", "creates", "a", "log", "file", "for", "the", "queue", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/environment.py#L341-L352
[ "def", "_wrap_handling", "(", "kwargs", ")", ":", "_configure_logging", "(", "kwargs", ",", "extract", "=", "False", ")", "# Main job, make the listener to the queue start receiving message for writing to disk.", "handler", "=", "kwargs", "[", "'handler'", "]", "graceful_ex...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
load_class
Loads a class from a string naming the module and class name. For example: >>> load_class(full_class_string = 'pypet.brian.parameter.BrianParameter') <BrianParameter>
pypet/utils/dynamicimports.py
def load_class(full_class_string): """Loads a class from a string naming the module and class name. For example: >>> load_class(full_class_string = 'pypet.brian.parameter.BrianParameter') <BrianParameter> """ class_data = full_class_string.split(".") module_path = ".".join(class_data[:-1]...
def load_class(full_class_string): """Loads a class from a string naming the module and class name. For example: >>> load_class(full_class_string = 'pypet.brian.parameter.BrianParameter') <BrianParameter> """ class_data = full_class_string.split(".") module_path = ".".join(class_data[:-1]...
[ "Loads", "a", "class", "from", "a", "string", "naming", "the", "module", "and", "class", "name", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/dynamicimports.py#L19-L34
[ "def", "load_class", "(", "full_class_string", ")", ":", "class_data", "=", "full_class_string", ".", "split", "(", "\".\"", ")", "module_path", "=", "\".\"", ".", "join", "(", "class_data", "[", ":", "-", "1", "]", ")", "class_str", "=", "class_data", "["...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
create_class
Dynamically creates a class. It is tried if the class can be created by the already given imports. If not the list of the dynamically loaded classes is used.
pypet/utils/dynamicimports.py
def create_class(class_name, dynamic_imports): """Dynamically creates a class. It is tried if the class can be created by the already given imports. If not the list of the dynamically loaded classes is used. """ try: new_class = globals()[class_name] if not inspect.isclass(new_cla...
def create_class(class_name, dynamic_imports): """Dynamically creates a class. It is tried if the class can be created by the already given imports. If not the list of the dynamically loaded classes is used. """ try: new_class = globals()[class_name] if not inspect.isclass(new_cla...
[ "Dynamically", "creates", "a", "class", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/dynamicimports.py#L37-L67
[ "def", "create_class", "(", "class_name", ",", "dynamic_imports", ")", ":", "try", ":", "new_class", "=", "globals", "(", ")", "[", "class_name", "]", "if", "not", "inspect", ".", "isclass", "(", "new_class", ")", ":", "raise", "TypeError", "(", "'Not a cl...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
BaseParameter.f_get_range_length
Returns the length of the parameter range. Raises TypeError if the parameter has no range. Does not need to be implemented if the parameter supports ``__len__`` appropriately.
pypet/parameter.py
def f_get_range_length(self): """Returns the length of the parameter range. Raises TypeError if the parameter has no range. Does not need to be implemented if the parameter supports ``__len__`` appropriately. """ if not self.f_has_range(): raise TypeError('...
def f_get_range_length(self): """Returns the length of the parameter range. Raises TypeError if the parameter has no range. Does not need to be implemented if the parameter supports ``__len__`` appropriately. """ if not self.f_has_range(): raise TypeError('...
[ "Returns", "the", "length", "of", "the", "parameter", "range", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L251-L265
[ "def", "f_get_range_length", "(", "self", ")", ":", "if", "not", "self", ".", "f_has_range", "(", ")", ":", "raise", "TypeError", "(", "'Not applicable, parameter does not have a range'", ")", "elif", "hasattr", "(", "self", ",", "'__len__'", ")", ":", "return",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
BaseParameter.f_val_to_str
String summary of the value handled by the parameter. Note that representing the parameter as a string accesses its value, but for simpler debugging, this does not lock the parameter or counts as usage! Calls `__repr__` of the contained value.
pypet/parameter.py
def f_val_to_str(self): """String summary of the value handled by the parameter. Note that representing the parameter as a string accesses its value, but for simpler debugging, this does not lock the parameter or counts as usage! Calls `__repr__` of the contained value. """ ...
def f_val_to_str(self): """String summary of the value handled by the parameter. Note that representing the parameter as a string accesses its value, but for simpler debugging, this does not lock the parameter or counts as usage! Calls `__repr__` of the contained value. """ ...
[ "String", "summary", "of", "the", "value", "handled", "by", "the", "parameter", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L267-L282
[ "def", "f_val_to_str", "(", "self", ")", ":", "old_locked", "=", "self", ".", "_locked", "try", ":", "return", "repr", "(", "self", ".", "f_get", "(", ")", ")", "except", "Exception", ":", "return", "'No Evaluation possible (yet)!'", "finally", ":", "self", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
BaseParameter._equal_values
Checks if the parameter considers two values as equal. This is important for the trajectory in case of merging. In case you want to delete duplicate parameter points, the trajectory needs to know when two parameters are equal. Since equality is not always implemented by values handled by ...
pypet/parameter.py
def _equal_values(self, val1, val2): """Checks if the parameter considers two values as equal. This is important for the trajectory in case of merging. In case you want to delete duplicate parameter points, the trajectory needs to know when two parameters are equal. Since equality is no...
def _equal_values(self, val1, val2): """Checks if the parameter considers two values as equal. This is important for the trajectory in case of merging. In case you want to delete duplicate parameter points, the trajectory needs to know when two parameters are equal. Since equality is no...
[ "Checks", "if", "the", "parameter", "considers", "two", "values", "as", "equal", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L284-L316
[ "def", "_equal_values", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "self", ".", "f_supports", "(", "val1", ")", "!=", "self", ".", "f_supports", "(", "val2", ")", ":", "return", "False", "if", "not", "self", ".", "f_supports", "(", "val1"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
BaseParameter._values_of_same_type
Checks if two values agree in type. For example, two 32 bit integers would be of same type, but not a string and an integer, nor a 64 bit and a 32 bit integer. This is important for exploration. You are only allowed to explore data that is of the same type as the default value. ...
pypet/parameter.py
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. For example, two 32 bit integers would be of same type, but not a string and an integer, nor a 64 bit and a 32 bit integer. This is important for exploration. You are only allowed to explore data that ...
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. For example, two 32 bit integers would be of same type, but not a string and an integer, nor a 64 bit and a 32 bit integer. This is important for exploration. You are only allowed to explore data that ...
[ "Checks", "if", "two", "values", "agree", "in", "type", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L318-L366
[ "def", "_values_of_same_type", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "self", ".", "f_supports", "(", "val1", ")", "!=", "self", ".", "f_supports", "(", "val2", ")", ":", "return", "False", "if", "not", "self", ".", "f_supports", "(", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter.f_supports
Checks if input data is supported by the parameter.
pypet/parameter.py
def f_supports(self, data): """Checks if input data is supported by the parameter.""" dtype = type(data) if dtype is tuple or dtype is list: # Parameters cannot handle empty tuples if len(data) == 0: return False old_type = None ...
def f_supports(self, data): """Checks if input data is supported by the parameter.""" dtype = type(data) if dtype is tuple or dtype is list: # Parameters cannot handle empty tuples if len(data) == 0: return False old_type = None ...
[ "Checks", "if", "input", "data", "is", "supported", "by", "the", "parameter", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L856-L887
[ "def", "f_supports", "(", "self", ",", "data", ")", ":", "dtype", "=", "type", "(", "data", ")", "if", "dtype", "is", "tuple", "or", "dtype", "is", "list", ":", "# Parameters cannot handle empty tuples", "if", "len", "(", "data", ")", "==", "0", ":", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._values_of_same_type
Checks if two values agree in type. Raises a TypeError if both values are not supported by the parameter. Returns false if only one of the two values is supported by the parameter. Example usage: >>>param._values_of_same_type(42,43) True >>>param._values_of_same_type(...
pypet/parameter.py
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. Raises a TypeError if both values are not supported by the parameter. Returns false if only one of the two values is supported by the parameter. Example usage: >>>param._values_of_same_type(42,4...
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. Raises a TypeError if both values are not supported by the parameter. Returns false if only one of the two values is supported by the parameter. Example usage: >>>param._values_of_same_type(42,4...
[ "Checks", "if", "two", "values", "agree", "in", "type", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L889-L930
[ "def", "_values_of_same_type", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "self", ".", "f_supports", "(", "val1", ")", "!=", "self", ".", "f_supports", "(", "val2", ")", ":", "return", "False", "if", "not", "self", ".", "f_supports", "(", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter.f_get_range
Returns a python iterable containing the exploration range. :param copy: If the range should be copied before handed over to avoid tempering with data Example usage: >>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am a neat example') >>> param._explore([...
pypet/parameter.py
def f_get_range(self, copy=True): """Returns a python iterable containing the exploration range. :param copy: If the range should be copied before handed over to avoid tempering with data Example usage: >>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am ...
def f_get_range(self, copy=True): """Returns a python iterable containing the exploration range. :param copy: If the range should be copied before handed over to avoid tempering with data Example usage: >>> param = Parameter('groupA.groupB.myparam',data=22, comment='I am ...
[ "Returns", "a", "python", "iterable", "containing", "the", "exploration", "range", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L964-L987
[ "def", "f_get_range", "(", "self", ",", "copy", "=", "True", ")", ":", "if", "not", "self", ".", "f_has_range", "(", ")", ":", "raise", "TypeError", "(", "'Your parameter `%s` is not array, so cannot return array.'", "%", "self", ".", "v_full_name", ")", "elif",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._explore
Explores the parameter according to the iterable. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable are not the same as the type of the default value, or the parameter has alread...
pypet/parameter.py
def _explore(self, explore_iterable): """Explores the parameter according to the iterable. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable are not the same as the type of the d...
def _explore(self, explore_iterable): """Explores the parameter according to the iterable. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable are not the same as the type of the d...
[ "Explores", "the", "parameter", "according", "to", "the", "iterable", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L990-L1028
[ "def", "_explore", "(", "self", ",", "explore_iterable", ")", ":", "if", "self", ".", "v_locked", ":", "raise", "pex", ".", "ParameterLockedException", "(", "'Parameter `%s` is locked!'", "%", "self", ".", "v_full_name", ")", "if", "self", ".", "f_has_range", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._expand
Explores the parameter according to the iterable and appends to the exploration range. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable are not the same as the type of the default value...
pypet/parameter.py
def _expand(self, explore_iterable): """Explores the parameter according to the iterable and appends to the exploration range. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable a...
def _expand(self, explore_iterable): """Explores the parameter according to the iterable and appends to the exploration range. Raises ParameterLockedException if the parameter is locked. Raises TypeError if the parameter does not support the data, the types of the data in the iterable a...
[ "Explores", "the", "parameter", "according", "to", "the", "iterable", "and", "appends", "to", "the", "exploration", "range", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1030-L1065
[ "def", "_expand", "(", "self", ",", "explore_iterable", ")", ":", "if", "self", ".", "v_locked", ":", "raise", "pex", ".", "ParameterLockedException", "(", "'Parameter `%s` is locked!'", "%", "self", ".", "v_full_name", ")", "if", "not", "self", ".", "f_has_ra...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._data_sanity_checks
Checks if data values are valid. Checks if the data values are supported by the parameter and if the values are of the same type as the default value.
pypet/parameter.py
def _data_sanity_checks(self, explore_iterable): """Checks if data values are valid. Checks if the data values are supported by the parameter and if the values are of the same type as the default value. """ data_list = [] for val in explore_iterable: if n...
def _data_sanity_checks(self, explore_iterable): """Checks if data values are valid. Checks if the data values are supported by the parameter and if the values are of the same type as the default value. """ data_list = [] for val in explore_iterable: if n...
[ "Checks", "if", "data", "values", "are", "valid", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1067-L1092
[ "def", "_data_sanity_checks", "(", "self", ",", "explore_iterable", ")", ":", "data_list", "=", "[", "]", "for", "val", "in", "explore_iterable", ":", "if", "not", "self", ".", "f_supports", "(", "val", ")", ":", "raise", "TypeError", "(", "'%s is of not sup...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._store
Returns a dictionary of formatted data understood by the storage service. The data is put into an :class:`~pypet.parameter.ObjectTable` named 'data'. If the parameter is explored, the exploration range is also put into another table named 'explored_data'. :return: Dictionary containing...
pypet/parameter.py
def _store(self): """Returns a dictionary of formatted data understood by the storage service. The data is put into an :class:`~pypet.parameter.ObjectTable` named 'data'. If the parameter is explored, the exploration range is also put into another table named 'explored_data'. :...
def _store(self): """Returns a dictionary of formatted data understood by the storage service. The data is put into an :class:`~pypet.parameter.ObjectTable` named 'data'. If the parameter is explored, the exploration range is also put into another table named 'explored_data'. :...
[ "Returns", "a", "dictionary", "of", "formatted", "data", "understood", "by", "the", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1094-L1112
[ "def", "_store", "(", "self", ")", ":", "if", "self", ".", "_data", "is", "not", "None", ":", "store_dict", "=", "{", "'data'", ":", "ObjectTable", "(", "data", "=", "{", "'data'", ":", "[", "self", ".", "_data", "]", "}", ")", "}", "if", "self",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
Parameter._load
Loads the data and exploration range from the `load_dict`. The `load_dict` needs to be in the same format as the result of the :func:`~pypet.parameter.Parameter._store` method.
pypet/parameter.py
def _load(self, load_dict): """Loads the data and exploration range from the `load_dict`. The `load_dict` needs to be in the same format as the result of the :func:`~pypet.parameter.Parameter._store` method. """ if self.v_locked: raise pex.ParameterLockedException('...
def _load(self, load_dict): """Loads the data and exploration range from the `load_dict`. The `load_dict` needs to be in the same format as the result of the :func:`~pypet.parameter.Parameter._store` method. """ if self.v_locked: raise pex.ParameterLockedException('...
[ "Loads", "the", "data", "and", "exploration", "range", "from", "the", "load_dict", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1115-L1136
[ "def", "_load", "(", "self", ",", "load_dict", ")", ":", "if", "self", ".", "v_locked", ":", "raise", "pex", ".", "ParameterLockedException", "(", "'Parameter `%s` is locked!'", "%", "self", ".", "v_full_name", ")", "if", "'data'", "in", "load_dict", ":", "s...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
ArrayParameter._store
Creates a storage dictionary for the storage service. If the data is not a numpy array, a numpy matrix, or a tuple, the :func:`~pypet.parameter.Parmater._store` method of the parent class is called. Otherwise the array is put into the dictionary with the key 'data__rr__'. Each array o...
pypet/parameter.py
def _store(self): """Creates a storage dictionary for the storage service. If the data is not a numpy array, a numpy matrix, or a tuple, the :func:`~pypet.parameter.Parmater._store` method of the parent class is called. Otherwise the array is put into the dictionary with the key 'data_...
def _store(self): """Creates a storage dictionary for the storage service. If the data is not a numpy array, a numpy matrix, or a tuple, the :func:`~pypet.parameter.Parmater._store` method of the parent class is called. Otherwise the array is put into the dictionary with the key 'data_...
[ "Creates", "a", "storage", "dictionary", "for", "the", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1198-L1265
[ "def", "_store", "(", "self", ")", ":", "if", "type", "(", "self", ".", "_data", ")", "not", "in", "(", "np", ".", "ndarray", ",", "tuple", ",", "np", ".", "matrix", ",", "list", ")", ":", "return", "super", "(", "ArrayParameter", ",", "self", ")...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
ArrayParameter._load
Reconstructs the data and exploration array. Checks if it can find the array identifier in the `load_dict`, i.e. '__rr__'. If not calls :class:`~pypet.parameter.Parameter._load` of the parent class. If the parameter is explored, the exploration range of arrays is reconstructed as it wa...
pypet/parameter.py
def _load(self, load_dict): """Reconstructs the data and exploration array. Checks if it can find the array identifier in the `load_dict`, i.e. '__rr__'. If not calls :class:`~pypet.parameter.Parameter._load` of the parent class. If the parameter is explored, the exploration range of a...
def _load(self, load_dict): """Reconstructs the data and exploration array. Checks if it can find the array identifier in the `load_dict`, i.e. '__rr__'. If not calls :class:`~pypet.parameter.Parameter._load` of the parent class. If the parameter is explored, the exploration range of a...
[ "Reconstructs", "the", "data", "and", "exploration", "array", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1279-L1314
[ "def", "_load", "(", "self", ",", "load_dict", ")", ":", "if", "self", ".", "v_locked", ":", "raise", "pex", ".", "ParameterLockedException", "(", "'Parameter `%s` is locked!'", "%", "self", ".", "v_full_name", ")", "try", ":", "self", ".", "_data", "=", "...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
ArrayParameter._values_of_same_type
Checks if two values agree in type. The array parameter is less restrictive than the parameter. If both values are arrays, matrices or tuples, they are considered to be of same type regardless of their size and values they contain.
pypet/parameter.py
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. The array parameter is less restrictive than the parameter. If both values are arrays, matrices or tuples, they are considered to be of same type regardless of their size and values they contain. ...
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. The array parameter is less restrictive than the parameter. If both values are arrays, matrices or tuples, they are considered to be of same type regardless of their size and values they contain. ...
[ "Checks", "if", "two", "values", "agree", "in", "type", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1316-L1327
[ "def", "_values_of_same_type", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "(", "type", "(", "val1", ")", "in", "(", "np", ".", "ndarray", ",", "tuple", ",", "np", ".", "matrix", ")", ")", "and", "(", "type", "(", "val2", ")", "is", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
ArrayParameter.f_supports
Checks if input data is supported by the parameter.
pypet/parameter.py
def f_supports(self, data): """Checks if input data is supported by the parameter.""" dtype = type(data) if dtype is tuple or dtype is list and len(data) == 0: return True # ArrayParameter does support empty tuples elif dtype is np.ndarray and data.size == 0 and data.ndim =...
def f_supports(self, data): """Checks if input data is supported by the parameter.""" dtype = type(data) if dtype is tuple or dtype is list and len(data) == 0: return True # ArrayParameter does support empty tuples elif dtype is np.ndarray and data.size == 0 and data.ndim =...
[ "Checks", "if", "input", "data", "is", "supported", "by", "the", "parameter", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1329-L1337
[ "def", "f_supports", "(", "self", ",", "data", ")", ":", "dtype", "=", "type", "(", "data", ")", "if", "dtype", "is", "tuple", "or", "dtype", "is", "list", "and", "len", "(", "data", ")", "==", "0", ":", "return", "True", "# ArrayParameter does suppor...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._values_of_same_type
Checks if two values agree in type. The sparse parameter is less restrictive than the parameter. If both values are sparse matrices they are considered to be of same type regardless of their size and values they contain.
pypet/parameter.py
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. The sparse parameter is less restrictive than the parameter. If both values are sparse matrices they are considered to be of same type regardless of their size and values they contain. """ ...
def _values_of_same_type(self, val1, val2): """Checks if two values agree in type. The sparse parameter is less restrictive than the parameter. If both values are sparse matrices they are considered to be of same type regardless of their size and values they contain. """ ...
[ "Checks", "if", "two", "values", "agree", "in", "type", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1360-L1371
[ "def", "_values_of_same_type", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "self", ".", "_is_supported_matrix", "(", "val1", ")", "and", "self", ".", "_is_supported_matrix", "(", "val2", ")", ":", "return", "True", "else", ":", "return", "super"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._equal_values
Matrices are equal if they hash to the same value.
pypet/parameter.py
def _equal_values(self, val1, val2): """Matrices are equal if they hash to the same value.""" if self._is_supported_matrix(val1): if self._is_supported_matrix(val2): _, _, hash_tuple_1 = self._serialize_matrix(val1) _, _, hash_tuple_2 = self._serialize_matrix...
def _equal_values(self, val1, val2): """Matrices are equal if they hash to the same value.""" if self._is_supported_matrix(val1): if self._is_supported_matrix(val2): _, _, hash_tuple_1 = self._serialize_matrix(val1) _, _, hash_tuple_2 = self._serialize_matrix...
[ "Matrices", "are", "equal", "if", "they", "hash", "to", "the", "same", "value", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1373-L1385
[ "def", "_equal_values", "(", "self", ",", "val1", ",", "val2", ")", ":", "if", "self", ".", "_is_supported_matrix", "(", "val1", ")", ":", "if", "self", ".", "_is_supported_matrix", "(", "val2", ")", ":", "_", ",", "_", ",", "hash_tuple_1", "=", "self"...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._is_supported_matrix
Checks if a data is csr, csc, bsr, or dia Scipy sparse matrix
pypet/parameter.py
def _is_supported_matrix(data): """Checks if a data is csr, csc, bsr, or dia Scipy sparse matrix""" return (spsp.isspmatrix_csc(data) or spsp.isspmatrix_csr(data) or spsp.isspmatrix_bsr(data) or spsp.isspmatrix_dia(data))
def _is_supported_matrix(data): """Checks if a data is csr, csc, bsr, or dia Scipy sparse matrix""" return (spsp.isspmatrix_csc(data) or spsp.isspmatrix_csr(data) or spsp.isspmatrix_bsr(data) or spsp.isspmatrix_dia(data))
[ "Checks", "if", "a", "data", "is", "csr", "csc", "bsr", "or", "dia", "Scipy", "sparse", "matrix" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1388-L1393
[ "def", "_is_supported_matrix", "(", "data", ")", ":", "return", "(", "spsp", ".", "isspmatrix_csc", "(", "data", ")", "or", "spsp", ".", "isspmatrix_csr", "(", "data", ")", "or", "spsp", ".", "isspmatrix_bsr", "(", "data", ")", "or", "spsp", ".", "isspma...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter.f_supports
Sparse matrices support Scipy csr, csc, bsr and dia matrices and everything their parent class the :class:`~pypet.parameter.ArrayParameter` supports.
pypet/parameter.py
def f_supports(self, data): """Sparse matrices support Scipy csr, csc, bsr and dia matrices and everything their parent class the :class:`~pypet.parameter.ArrayParameter` supports. """ if self._is_supported_matrix(data): return True else: return super(Spa...
def f_supports(self, data): """Sparse matrices support Scipy csr, csc, bsr and dia matrices and everything their parent class the :class:`~pypet.parameter.ArrayParameter` supports. """ if self._is_supported_matrix(data): return True else: return super(Spa...
[ "Sparse", "matrices", "support", "Scipy", "csr", "csc", "bsr", "and", "dia", "matrices", "and", "everything", "their", "parent", "class", "the", ":", "class", ":", "~pypet", ".", "parameter", ".", "ArrayParameter", "supports", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1396-L1404
[ "def", "f_supports", "(", "self", ",", "data", ")", ":", "if", "self", ".", "_is_supported_matrix", "(", "data", ")", ":", "return", "True", "else", ":", "return", "super", "(", "SparseParameter", ",", "self", ")", ".", "f_supports", "(", "data", ")" ]
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._serialize_matrix
Extracts data from a sparse matrix to make it serializable in a human readable format. :return: Tuple with following elements: 1. A list containing data that is necessary to reconstruct the matrix. For csr, csc, and bsr matrices the following attributes are extract...
pypet/parameter.py
def _serialize_matrix(matrix): """Extracts data from a sparse matrix to make it serializable in a human readable format. :return: Tuple with following elements: 1. A list containing data that is necessary to reconstruct the matrix. For csr, csc, and bsr mat...
def _serialize_matrix(matrix): """Extracts data from a sparse matrix to make it serializable in a human readable format. :return: Tuple with following elements: 1. A list containing data that is necessary to reconstruct the matrix. For csr, csc, and bsr mat...
[ "Extracts", "data", "from", "a", "sparse", "matrix", "to", "make", "it", "serializable", "in", "a", "human", "readable", "format", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1407-L1483
[ "def", "_serialize_matrix", "(", "matrix", ")", ":", "if", "(", "spsp", ".", "isspmatrix_csc", "(", "matrix", ")", "or", "spsp", ".", "isspmatrix_csr", "(", "matrix", ")", "or", "spsp", ".", "isspmatrix_bsr", "(", "matrix", ")", ")", ":", "if", "matrix",...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._store
Creates a storage dictionary for the storage service. If the data is not a supported sparse matrix, the :func:`~pypet.parameter.ArrayParmater._store` method of the parent class is called. Otherwise the matrix is split into parts with :func:`~pypet.parameter.SparseParameter._serialize_m...
pypet/parameter.py
def _store(self): """Creates a storage dictionary for the storage service. If the data is not a supported sparse matrix, the :func:`~pypet.parameter.ArrayParmater._store` method of the parent class is called. Otherwise the matrix is split into parts with :func:`~pypet.parameter...
def _store(self): """Creates a storage dictionary for the storage service. If the data is not a supported sparse matrix, the :func:`~pypet.parameter.ArrayParmater._store` method of the parent class is called. Otherwise the matrix is split into parts with :func:`~pypet.parameter...
[ "Creates", "a", "storage", "dictionary", "for", "the", "storage", "service", "." ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1492-L1564
[ "def", "_store", "(", "self", ")", ":", "if", "not", "self", ".", "_is_supported_matrix", "(", "self", ".", "_data", ")", ":", "return", "super", "(", "SparseParameter", ",", "self", ")", ".", "_store", "(", ")", "else", ":", "store_dict", "=", "{", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._build_names
Formats a name for storage :return: A tuple of names with the following format: `xspm__spsp__XXXX__spsp__XXXXXXXX` where the first 'XXXX' refer to the property and the latter 'XXXXXXX' to the sparse matrix index.
pypet/parameter.py
def _build_names(self, name_idx, is_dia): """Formats a name for storage :return: A tuple of names with the following format: `xspm__spsp__XXXX__spsp__XXXXXXXX` where the first 'XXXX' refer to the property and the latter 'XXXXXXX' to the sparse matrix index. """ ...
def _build_names(self, name_idx, is_dia): """Formats a name for storage :return: A tuple of names with the following format: `xspm__spsp__XXXX__spsp__XXXXXXXX` where the first 'XXXX' refer to the property and the latter 'XXXXXXX' to the sparse matrix index. """ ...
[ "Formats", "a", "name", "for", "storage" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1566-L1578
[ "def", "_build_names", "(", "self", ",", "name_idx", ",", "is_dia", ")", ":", "name_list", "=", "self", ".", "_get_name_list", "(", "is_dia", ")", "return", "tuple", "(", "[", "'explored%s.set_%05d.xspm_%s_%08d'", "%", "(", "SparseParameter", ".", "IDENTIFIER", ...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._reconstruct_matrix
Reconstructs a matrix from a list containing sparse matrix extracted properties `data_list` needs to be formatted as the first result of :func:`~pypet.parameter.SparseParameter._serialize_matrix`
pypet/parameter.py
def _reconstruct_matrix(data_list): """Reconstructs a matrix from a list containing sparse matrix extracted properties `data_list` needs to be formatted as the first result of :func:`~pypet.parameter.SparseParameter._serialize_matrix` """ matrix_format = data_list[0] da...
def _reconstruct_matrix(data_list): """Reconstructs a matrix from a list containing sparse matrix extracted properties `data_list` needs to be formatted as the first result of :func:`~pypet.parameter.SparseParameter._serialize_matrix` """ matrix_format = data_list[0] da...
[ "Reconstructs", "a", "matrix", "from", "a", "list", "containing", "sparse", "matrix", "extracted", "properties" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1588-L1621
[ "def", "_reconstruct_matrix", "(", "data_list", ")", ":", "matrix_format", "=", "data_list", "[", "0", "]", "data", "=", "data_list", "[", "1", "]", "is_empty", "=", "isinstance", "(", "data", ",", "str", ")", "and", "data", "==", "'__empty__'", "if", "m...
97ad3e80d46dbdea02deeb98ea41f05a19565826
test
SparseParameter._load
Reconstructs the data and exploration array Checks if it can find the array identifier in the `load_dict`, i.e. '__spsp__'. If not, calls :class:`~pypet.parameter.ArrayParameter._load` of the parent class. If the parameter is explored, the exploration range of matrices is reconstructed ...
pypet/parameter.py
def _load(self, load_dict): """Reconstructs the data and exploration array Checks if it can find the array identifier in the `load_dict`, i.e. '__spsp__'. If not, calls :class:`~pypet.parameter.ArrayParameter._load` of the parent class. If the parameter is explored, the exploration ran...
def _load(self, load_dict): """Reconstructs the data and exploration array Checks if it can find the array identifier in the `load_dict`, i.e. '__spsp__'. If not, calls :class:`~pypet.parameter.ArrayParameter._load` of the parent class. If the parameter is explored, the exploration ran...
[ "Reconstructs", "the", "data", "and", "exploration", "array" ]
SmokinCaterpillar/pypet
python
https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/parameter.py#L1623-L1674
[ "def", "_load", "(", "self", ",", "load_dict", ")", ":", "if", "self", ".", "v_locked", ":", "raise", "pex", ".", "ParameterLockedException", "(", "'Parameter `%s` is locked!'", "%", "self", ".", "v_full_name", ")", "try", ":", "is_dia", "=", "load_dict", "[...
97ad3e80d46dbdea02deeb98ea41f05a19565826