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 | ReferenceStore.store_references | Stores references to disk and may collect garbage. | pypet/utils/mpwrappers.py | def store_references(self, references):
"""Stores references to disk and may collect garbage."""
for trajectory_name in references:
self._storage_service.store(pypetconstants.LIST, references[trajectory_name], trajectory_name=trajectory_name)
self._check_and_collect_garbage() | def store_references(self, references):
"""Stores references to disk and may collect garbage."""
for trajectory_name in references:
self._storage_service.store(pypetconstants.LIST, references[trajectory_name], trajectory_name=trajectory_name)
self._check_and_collect_garbage() | [
"Stores",
"references",
"to",
"disk",
"and",
"may",
"collect",
"garbage",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/mpwrappers.py#L1048-L1052 | [
"def",
"store_references",
"(",
"self",
",",
"references",
")",
":",
"for",
"trajectory_name",
"in",
"references",
":",
"self",
".",
"_storage_service",
".",
"store",
"(",
"pypetconstants",
".",
"LIST",
",",
"references",
"[",
"trajectory_name",
"]",
",",
"tra... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | parse_config | Decorator wrapping the environment to use a config file | pypet/utils/configparsing.py | def parse_config(init_func):
"""Decorator wrapping the environment to use a config file"""
@functools.wraps(init_func)
def new_func(env, *args, **kwargs):
config_interpreter = ConfigInterpreter(kwargs)
# Pass the config data to the kwargs
new_kwargs = config_interpreter.interpret()
... | def parse_config(init_func):
"""Decorator wrapping the environment to use a config file"""
@functools.wraps(init_func)
def new_func(env, *args, **kwargs):
config_interpreter = ConfigInterpreter(kwargs)
# Pass the config data to the kwargs
new_kwargs = config_interpreter.interpret()
... | [
"Decorator",
"wrapping",
"the",
"environment",
"to",
"use",
"a",
"config",
"file"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/configparsing.py#L13-L23 | [
"def",
"parse_config",
"(",
"init_func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"init_func",
")",
"def",
"new_func",
"(",
"env",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"config_interpreter",
"=",
"ConfigInterpreter",
"(",
"kwargs",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | ConfigInterpreter._collect_section | Collects all settings within a section | pypet/utils/configparsing.py | def _collect_section(self, section):
"""Collects all settings within a section"""
kwargs = {}
try:
if self.parser.has_section(section):
options = self.parser.options(section)
for option in options:
str_val = self.parser.get(section,... | def _collect_section(self, section):
"""Collects all settings within a section"""
kwargs = {}
try:
if self.parser.has_section(section):
options = self.parser.options(section)
for option in options:
str_val = self.parser.get(section,... | [
"Collects",
"all",
"settings",
"within",
"a",
"section"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/configparsing.py#L47-L59 | [
"def",
"_collect_section",
"(",
"self",
",",
"section",
")",
":",
"kwargs",
"=",
"{",
"}",
"try",
":",
"if",
"self",
".",
"parser",
".",
"has_section",
"(",
"section",
")",
":",
"options",
"=",
"self",
".",
"parser",
".",
"options",
"(",
"section",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | ConfigInterpreter._collect_config | Collects all info from three sections | pypet/utils/configparsing.py | def _collect_config(self):
"""Collects all info from three sections"""
kwargs = {}
sections = ('storage_service', 'trajectory', 'environment')
for section in sections:
kwargs.update(self._collect_section(section))
return kwargs | def _collect_config(self):
"""Collects all info from three sections"""
kwargs = {}
sections = ('storage_service', 'trajectory', 'environment')
for section in sections:
kwargs.update(self._collect_section(section))
return kwargs | [
"Collects",
"all",
"info",
"from",
"three",
"sections"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/configparsing.py#L61-L67 | [
"def",
"_collect_config",
"(",
"self",
")",
":",
"kwargs",
"=",
"{",
"}",
"sections",
"=",
"(",
"'storage_service'",
",",
"'trajectory'",
",",
"'environment'",
")",
"for",
"section",
"in",
"sections",
":",
"kwargs",
".",
"update",
"(",
"self",
".",
"_colle... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | ConfigInterpreter.interpret | Copies parsed arguments into the kwargs passed to the environment | pypet/utils/configparsing.py | def interpret(self):
"""Copies parsed arguments into the kwargs passed to the environment"""
if self.config_file:
new_kwargs = self._collect_config()
for key in new_kwargs:
# Already specified kwargs take precedence over the ini file
if key not in ... | def interpret(self):
"""Copies parsed arguments into the kwargs passed to the environment"""
if self.config_file:
new_kwargs = self._collect_config()
for key in new_kwargs:
# Already specified kwargs take precedence over the ini file
if key not in ... | [
"Copies",
"parsed",
"arguments",
"into",
"the",
"kwargs",
"passed",
"to",
"the",
"environment"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/configparsing.py#L69-L79 | [
"def",
"interpret",
"(",
"self",
")",
":",
"if",
"self",
".",
"config_file",
":",
"new_kwargs",
"=",
"self",
".",
"_collect_config",
"(",
")",
"for",
"key",
"in",
"new_kwargs",
":",
"# Already specified kwargs take precedence over the ini file",
"if",
"key",
"not"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | ConfigInterpreter.add_parameters | Adds parameters and config from the `.ini` file to the trajectory | pypet/utils/configparsing.py | def add_parameters(self, traj):
"""Adds parameters and config from the `.ini` file to the trajectory"""
if self.config_file:
parameters = self._collect_section('parameters')
for name in parameters:
value = parameters[name]
if not isinstance(value, ... | def add_parameters(self, traj):
"""Adds parameters and config from the `.ini` file to the trajectory"""
if self.config_file:
parameters = self._collect_section('parameters')
for name in parameters:
value = parameters[name]
if not isinstance(value, ... | [
"Adds",
"parameters",
"and",
"config",
"from",
"the",
".",
"ini",
"file",
"to",
"the",
"trajectory"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/utils/configparsing.py#L81-L95 | [
"def",
"add_parameters",
"(",
"self",
",",
"traj",
")",
":",
"if",
"self",
".",
"config_file",
":",
"parameters",
"=",
"self",
".",
"_collect_section",
"(",
"'parameters'",
")",
"for",
"name",
"in",
"parameters",
":",
"value",
"=",
"parameters",
"[",
"name... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | convert_rule | Converts a rule given as an integer into a binary list representation.
It reads from left to right (contrary to the Wikipedia article given below),
i.e. the 2**0 is found on the left hand side and 2**7 on the right.
For example:
``convert_rule(30)`` returns [0, 1, 1, 1, 1, 0, 0, 0]
The resu... | examples/example_17_wrapping_an_existing_project/original.py | def convert_rule(rule_number):
""" Converts a rule given as an integer into a binary list representation.
It reads from left to right (contrary to the Wikipedia article given below),
i.e. the 2**0 is found on the left hand side and 2**7 on the right.
For example:
``convert_rule(30)`` returns ... | def convert_rule(rule_number):
""" Converts a rule given as an integer into a binary list representation.
It reads from left to right (contrary to the Wikipedia article given below),
i.e. the 2**0 is found on the left hand side and 2**7 on the right.
For example:
``convert_rule(30)`` returns ... | [
"Converts",
"a",
"rule",
"given",
"as",
"an",
"integer",
"into",
"a",
"binary",
"list",
"representation",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/examples/example_17_wrapping_an_existing_project/original.py#L17-L46 | [
"def",
"convert_rule",
"(",
"rule_number",
")",
":",
"binary_rule",
"=",
"[",
"(",
"rule_number",
"//",
"pow",
"(",
"2",
",",
"i",
")",
")",
"%",
"2",
"for",
"i",
"in",
"range",
"(",
"8",
")",
"]",
"return",
"np",
".",
"array",
"(",
"binary_rule",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | make_initial_state | Creates an initial state for the automaton.
:param name:
Either ``'single'`` for a single live cell in the middle of the cell ring,
or ``'random'`` for uniformly distributed random pattern of zeros and ones.
:param ncells: Number of cells in the automaton
:param seed: Random number seed ... | examples/example_17_wrapping_an_existing_project/original.py | def make_initial_state(name, ncells, seed=42):
""" Creates an initial state for the automaton.
:param name:
Either ``'single'`` for a single live cell in the middle of the cell ring,
or ``'random'`` for uniformly distributed random pattern of zeros and ones.
:param ncells: Number of cells... | def make_initial_state(name, ncells, seed=42):
""" Creates an initial state for the automaton.
:param name:
Either ``'single'`` for a single live cell in the middle of the cell ring,
or ``'random'`` for uniformly distributed random pattern of zeros and ones.
:param ncells: Number of cells... | [
"Creates",
"an",
"initial",
"state",
"for",
"the",
"automaton",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/examples/example_17_wrapping_an_existing_project/original.py#L49-L75 | [
"def",
"make_initial_state",
"(",
"name",
",",
"ncells",
",",
"seed",
"=",
"42",
")",
":",
"if",
"name",
"==",
"'single'",
":",
"just_one_cell",
"=",
"np",
".",
"zeros",
"(",
"ncells",
")",
"just_one_cell",
"[",
"int",
"(",
"ncells",
"/",
"2",
")",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | plot_pattern | Plots an automaton ``pattern`` and stores the image under a given ``filename``.
For axes labels the ``rule_number`` is also required. | examples/example_17_wrapping_an_existing_project/original.py | def plot_pattern(pattern, rule_number, filename):
""" Plots an automaton ``pattern`` and stores the image under a given ``filename``.
For axes labels the ``rule_number`` is also required.
"""
plt.figure()
plt.imshow(pattern)
plt.xlabel('Cell No.')
plt.ylabel('Time Step')
plt.title('CA ... | def plot_pattern(pattern, rule_number, filename):
""" Plots an automaton ``pattern`` and stores the image under a given ``filename``.
For axes labels the ``rule_number`` is also required.
"""
plt.figure()
plt.imshow(pattern)
plt.xlabel('Cell No.')
plt.ylabel('Time Step')
plt.title('CA ... | [
"Plots",
"an",
"automaton",
"pattern",
"and",
"stores",
"the",
"image",
"under",
"a",
"given",
"filename",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/examples/example_17_wrapping_an_existing_project/original.py#L78-L91 | [
"def",
"plot_pattern",
"(",
"pattern",
",",
"rule_number",
",",
"filename",
")",
":",
"plt",
".",
"figure",
"(",
")",
"plt",
".",
"imshow",
"(",
"pattern",
")",
"plt",
".",
"xlabel",
"(",
"'Cell No.'",
")",
"plt",
".",
"ylabel",
"(",
"'Time Step'",
")"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | cellular_automaton_1D | Simulates a 1 dimensional cellular automaton.
:param initial_state:
The initial state of *dead* and *alive* cells as a 1D numpy array.
It's length determines the size of the simulation.
:param rule_number:
The update rule as an integer from 0 to 255.
:param steps:
Numbe... | examples/example_17_wrapping_an_existing_project/original.py | def cellular_automaton_1D(initial_state, rule_number, steps):
""" Simulates a 1 dimensional cellular automaton.
:param initial_state:
The initial state of *dead* and *alive* cells as a 1D numpy array.
It's length determines the size of the simulation.
:param rule_number:
The upda... | def cellular_automaton_1D(initial_state, rule_number, steps):
""" Simulates a 1 dimensional cellular automaton.
:param initial_state:
The initial state of *dead* and *alive* cells as a 1D numpy array.
It's length determines the size of the simulation.
:param rule_number:
The upda... | [
"Simulates",
"a",
"1",
"dimensional",
"cellular",
"automaton",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/examples/example_17_wrapping_an_existing_project/original.py#L94-L146 | [
"def",
"cellular_automaton_1D",
"(",
"initial_state",
",",
"rule_number",
",",
"steps",
")",
":",
"ncells",
"=",
"len",
"(",
"initial_state",
")",
"# Create an array for the full pattern",
"pattern",
"=",
"np",
".",
"zeros",
"(",
"(",
"steps",
",",
"ncells",
")"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | main | Main simulation function | examples/example_17_wrapping_an_existing_project/original.py | def main():
""" Main simulation function """
rules_to_test = [10, 30, 90, 110, 184] # rules we want to explore:
steps = 250 # cell iterations
ncells = 400 # number of cells
seed = 100042 # RNG seed
initial_states = ['single', 'random'] # Initial states we want to explore
# create a fol... | def main():
""" Main simulation function """
rules_to_test = [10, 30, 90, 110, 184] # rules we want to explore:
steps = 250 # cell iterations
ncells = 400 # number of cells
seed = 100042 # RNG seed
initial_states = ['single', 'random'] # Initial states we want to explore
# create a fol... | [
"Main",
"simulation",
"function"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/examples/example_17_wrapping_an_existing_project/original.py#L149-L192 | [
"def",
"main",
"(",
")",
":",
"rules_to_test",
"=",
"[",
"10",
",",
"30",
",",
"90",
",",
"110",
",",
"184",
"]",
"# rules we want to explore:",
"steps",
"=",
"250",
"# cell iterations",
"ncells",
"=",
"400",
"# number of cells",
"seed",
"=",
"100042",
"# ... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | get_all_slots | Iterates through a class' (`cls`) mro to get all slots as a set. | pypet/slots.py | def get_all_slots(cls):
"""Iterates through a class' (`cls`) mro to get all slots as a set."""
slots_iterator = (getattr(c, '__slots__', ()) for c in cls.__mro__)
# `__slots__` might only be a single string,
# so we need to put the strings into a tuple.
slots_converted = ((slots,) if isinstance(slot... | def get_all_slots(cls):
"""Iterates through a class' (`cls`) mro to get all slots as a set."""
slots_iterator = (getattr(c, '__slots__', ()) for c in cls.__mro__)
# `__slots__` might only be a single string,
# so we need to put the strings into a tuple.
slots_converted = ((slots,) if isinstance(slot... | [
"Iterates",
"through",
"a",
"class",
"(",
"cls",
")",
"mro",
"to",
"get",
"all",
"slots",
"as",
"a",
"set",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/slots.py#L6-L15 | [
"def",
"get_all_slots",
"(",
"cls",
")",
":",
"slots_iterator",
"=",
"(",
"getattr",
"(",
"c",
",",
"'__slots__'",
",",
"(",
")",
")",
"for",
"c",
"in",
"cls",
".",
"__mro__",
")",
"# `__slots__` might only be a single string,",
"# so we need to put the strings in... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | NodeProcessingTimer.signal_update | Signals the process timer.
If more time than the display time has passed a message is emitted. | pypet/storageservice.py | def signal_update(self):
"""Signals the process timer.
If more time than the display time has passed a message is emitted.
"""
if not self.active:
return
self._updates += 1
current_time = time.time()
dt = current_time - self._last_time
if dt... | def signal_update(self):
"""Signals the process timer.
If more time than the display time has passed a message is emitted.
"""
if not self.active:
return
self._updates += 1
current_time = time.time()
dt = current_time - self._last_time
if dt... | [
"Signals",
"the",
"process",
"timer",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L103-L127 | [
"def",
"signal_update",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"active",
":",
"return",
"self",
".",
"_updates",
"+=",
"1",
"current_time",
"=",
"time",
".",
"time",
"(",
")",
"dt",
"=",
"current_time",
"-",
"self",
".",
"_last_time",
"if",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._overview_group | Direct link to the overview group | pypet/storageservice.py | def _overview_group(self):
"""Direct link to the overview group"""
if self._overview_group_ is None:
self._overview_group_ = self._all_create_or_get_groups('overview')[0]
return self._overview_group_ | def _overview_group(self):
"""Direct link to the overview group"""
if self._overview_group_ is None:
self._overview_group_ = self._all_create_or_get_groups('overview')[0]
return self._overview_group_ | [
"Direct",
"link",
"to",
"the",
"overview",
"group"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L696-L700 | [
"def",
"_overview_group",
"(",
"self",
")",
":",
"if",
"self",
".",
"_overview_group_",
"is",
"None",
":",
"self",
".",
"_overview_group_",
"=",
"self",
".",
"_all_create_or_get_groups",
"(",
"'overview'",
")",
"[",
"0",
"]",
"return",
"self",
".",
"_overvie... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_get_filters | Makes filters
Pops filter arguments from `kwargs` such that they are not passed
on to other functions also using kwargs. | pypet/storageservice.py | def _all_get_filters(self, kwargs=None):
"""Makes filters
Pops filter arguments from `kwargs` such that they are not passed
on to other functions also using kwargs.
"""
if kwargs is None:
kwargs = {}
complib = kwargs.pop('complib', None)
complevel = ... | def _all_get_filters(self, kwargs=None):
"""Makes filters
Pops filter arguments from `kwargs` such that they are not passed
on to other functions also using kwargs.
"""
if kwargs is None:
kwargs = {}
complib = kwargs.pop('complib', None)
complevel = ... | [
"Makes",
"filters"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L702-L742 | [
"def",
"_all_get_filters",
"(",
"self",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"kwargs",
"is",
"None",
":",
"kwargs",
"=",
"{",
"}",
"complib",
"=",
"kwargs",
".",
"pop",
"(",
"'complib'",
",",
"None",
")",
"complevel",
"=",
"kwargs",
".",
"pop"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_set_config | Sets a config value to the Trajectory or changes it if the trajectory was loaded
a the settings no longer match | pypet/storageservice.py | def _srvc_set_config(self, trajectory):
"""Sets a config value to the Trajectory or changes it if the trajectory was loaded
a the settings no longer match"""
def _set_config(name, value, comment):
if not trajectory.f_contains('config.'+name, shortcuts=False):
trajecto... | def _srvc_set_config(self, trajectory):
"""Sets a config value to the Trajectory or changes it if the trajectory was loaded
a the settings no longer match"""
def _set_config(name, value, comment):
if not trajectory.f_contains('config.'+name, shortcuts=False):
trajecto... | [
"Sets",
"a",
"config",
"value",
"to",
"the",
"Trajectory",
"or",
"changes",
"it",
"if",
"the",
"trajectory",
"was",
"loaded",
"a",
"the",
"settings",
"no",
"longer",
"match"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L744-L801 | [
"def",
"_srvc_set_config",
"(",
"self",
",",
"trajectory",
")",
":",
"def",
"_set_config",
"(",
"name",
",",
"value",
",",
"comment",
")",
":",
"if",
"not",
"trajectory",
".",
"f_contains",
"(",
"'config.'",
"+",
"name",
",",
"shortcuts",
"=",
"False",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService.load | Loads a particular item from disk.
The storage service always accepts these parameters:
:param trajectory_name: Name of current trajectory and name of top node in hdf5 file.
:param trajectory_index:
If no `trajectory_name` is provided, you can specify an integer index.
... | pypet/storageservice.py | def load(self, msg, stuff_to_load, *args, **kwargs):
"""Loads a particular item from disk.
The storage service always accepts these parameters:
:param trajectory_name: Name of current trajectory and name of top node in hdf5 file.
:param trajectory_index:
If no `trajectory... | def load(self, msg, stuff_to_load, *args, **kwargs):
"""Loads a particular item from disk.
The storage service always accepts these parameters:
:param trajectory_name: Name of current trajectory and name of top node in hdf5 file.
:param trajectory_index:
If no `trajectory... | [
"Loads",
"a",
"particular",
"item",
"from",
"disk",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L803-L963 | [
"def",
"load",
"(",
"self",
",",
"msg",
",",
"stuff_to_load",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"opened",
"=",
"True",
"try",
":",
"opened",
"=",
"self",
".",
"_srvc_opening_routine",
"(",
"'r'",
",",
"kwargs",
"=",
"kwargs",
")",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService.store | Stores a particular item to disk.
The storage service always accepts these parameters:
:param trajectory_name: Name or current trajectory and name of top node in hdf5 file
:param filename: Name of the hdf5 file
:param file_title: If file needs to be created, assigns a title to the fi... | pypet/storageservice.py | def store(self, msg, stuff_to_store, *args, **kwargs):
""" Stores a particular item to disk.
The storage service always accepts these parameters:
:param trajectory_name: Name or current trajectory and name of top node in hdf5 file
:param filename: Name of the hdf5 file
:param... | def store(self, msg, stuff_to_store, *args, **kwargs):
""" Stores a particular item to disk.
The storage service always accepts these parameters:
:param trajectory_name: Name or current trajectory and name of top node in hdf5 file
:param filename: Name of the hdf5 file
:param... | [
"Stores",
"a",
"particular",
"item",
"to",
"disk",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L965-L1337 | [
"def",
"store",
"(",
"self",
",",
"msg",
",",
"stuff_to_store",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"opened",
"=",
"True",
"try",
":",
"opened",
"=",
"self",
".",
"_srvc_opening_routine",
"(",
"'a'",
",",
"msg",
",",
"kwargs",
")",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_load_several_items | Loads several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` provided to this function. | pypet/storageservice.py | def _srvc_load_several_items(self, iterable, *args, **kwargs):
"""Loads several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` provi... | def _srvc_load_several_items(self, iterable, *args, **kwargs):
"""Loads several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` provi... | [
"Loads",
"several",
"items",
"from",
"an",
"iterable"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1339-L1357 | [
"def",
"_srvc_load_several_items",
"(",
"self",
",",
"iterable",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"input_tuple",
"in",
"iterable",
":",
"msg",
"=",
"input_tuple",
"[",
"0",
"]",
"item",
"=",
"input_tuple",
"[",
"1",
"]",
"if"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_check_hdf_properties | Reads out the properties for storing new data into the hdf5file
:param traj:
The trajectory | pypet/storageservice.py | def _srvc_check_hdf_properties(self, traj):
"""Reads out the properties for storing new data into the hdf5file
:param traj:
The trajectory
"""
for attr_name in HDF5StorageService.ATTR_LIST:
try:
config = traj.f_get('config.hdf5.' + attr_name).f... | def _srvc_check_hdf_properties(self, traj):
"""Reads out the properties for storing new data into the hdf5file
:param traj:
The trajectory
"""
for attr_name in HDF5StorageService.ATTR_LIST:
try:
config = traj.f_get('config.hdf5.' + attr_name).f... | [
"Reads",
"out",
"the",
"properties",
"for",
"storing",
"new",
"data",
"into",
"the",
"hdf5file"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1359-L1404 | [
"def",
"_srvc_check_hdf_properties",
"(",
"self",
",",
"traj",
")",
":",
"for",
"attr_name",
"in",
"HDF5StorageService",
".",
"ATTR_LIST",
":",
"try",
":",
"config",
"=",
"traj",
".",
"f_get",
"(",
"'config.hdf5.'",
"+",
"attr_name",
")",
".",
"f_get",
"(",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_store_several_items | Stores several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` provided to this function. | pypet/storageservice.py | def _srvc_store_several_items(self, iterable, *args, **kwargs):
"""Stores several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` pro... | def _srvc_store_several_items(self, iterable, *args, **kwargs):
"""Stores several items from an iterable
Iterables are supposed to be of a format like `[(msg, item, args, kwarg),...]`
If `args` and `kwargs` are not part of a tuple, they are taken from the
current `args` and `kwargs` pro... | [
"Stores",
"several",
"items",
"from",
"an",
"iterable"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1406-L1424 | [
"def",
"_srvc_store_several_items",
"(",
"self",
",",
"iterable",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"input_tuple",
"in",
"iterable",
":",
"msg",
"=",
"input_tuple",
"[",
"0",
"]",
"item",
"=",
"input_tuple",
"[",
"1",
"]",
"if... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_opening_routine | Opens an hdf5 file for reading or writing
The file is only opened if it has not been opened before (i.e. `self._hdf5file is None`).
:param mode:
'a' for appending
'r' for reading
Unfortunately, pandas currently does not work with read-only mode.
... | pypet/storageservice.py | def _srvc_opening_routine(self, mode, msg=None, kwargs=()):
"""Opens an hdf5 file for reading or writing
The file is only opened if it has not been opened before (i.e. `self._hdf5file is None`).
:param mode:
'a' for appending
'r' for reading
Unfortuna... | def _srvc_opening_routine(self, mode, msg=None, kwargs=()):
"""Opens an hdf5 file for reading or writing
The file is only opened if it has not been opened before (i.e. `self._hdf5file is None`).
:param mode:
'a' for appending
'r' for reading
Unfortuna... | [
"Opens",
"an",
"hdf5",
"file",
"for",
"reading",
"or",
"writing"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1426-L1539 | [
"def",
"_srvc_opening_routine",
"(",
"self",
",",
"mode",
",",
"msg",
"=",
"None",
",",
"kwargs",
"=",
"(",
")",
")",
":",
"self",
".",
"_mode",
"=",
"mode",
"self",
".",
"_srvc_extract_file_information",
"(",
"kwargs",
")",
"if",
"not",
"self",
".",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_closing_routine | Routine to close an hdf5 file
The file is closed only when `closing=True`. `closing=True` means that
the file was opened in the current highest recursion level. This prevents re-opening
and closing of the file if `store` or `load` are called recursively. | pypet/storageservice.py | def _srvc_closing_routine(self, closing):
"""Routine to close an hdf5 file
The file is closed only when `closing=True`. `closing=True` means that
the file was opened in the current highest recursion level. This prevents re-opening
and closing of the file if `store` or `load` are called ... | def _srvc_closing_routine(self, closing):
"""Routine to close an hdf5 file
The file is closed only when `closing=True`. `closing=True` means that
the file was opened in the current highest recursion level. This prevents re-opening
and closing of the file if `store` or `load` are called ... | [
"Routine",
"to",
"close",
"an",
"hdf5",
"file"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1541-L1583 | [
"def",
"_srvc_closing_routine",
"(",
"self",
",",
"closing",
")",
":",
"if",
"(",
"not",
"self",
".",
"_keep_open",
"and",
"closing",
"and",
"self",
".",
"is_open",
")",
":",
"f_fd",
"=",
"self",
".",
"_hdf5file",
".",
"fileno",
"(",
")",
"self",
".",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_extract_file_information | Extracts file information from kwargs.
Note that `kwargs` is not passed as `**kwargs` in order to also
`pop` the elements on the level of the function calling `_srvc_extract_file_information`. | pypet/storageservice.py | def _srvc_extract_file_information(self, kwargs):
"""Extracts file information from kwargs.
Note that `kwargs` is not passed as `**kwargs` in order to also
`pop` the elements on the level of the function calling `_srvc_extract_file_information`.
"""
if 'filename' in kwargs:
... | def _srvc_extract_file_information(self, kwargs):
"""Extracts file information from kwargs.
Note that `kwargs` is not passed as `**kwargs` in order to also
`pop` the elements on the level of the function calling `_srvc_extract_file_information`.
"""
if 'filename' in kwargs:
... | [
"Extracts",
"file",
"information",
"from",
"kwargs",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1585-L1602 | [
"def",
"_srvc_extract_file_information",
"(",
"self",
",",
"kwargs",
")",
":",
"if",
"'filename'",
"in",
"kwargs",
":",
"self",
".",
"_filename",
"=",
"kwargs",
".",
"pop",
"(",
"'filename'",
")",
"if",
"'file_title'",
"in",
"kwargs",
":",
"self",
".",
"_f... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_backup_trajectory | Backs up a trajectory.
:param traj: Trajectory that should be backed up
:param backup_filename:
Path and filename of backup file. If None is specified the storage service
defaults to `path_to_trajectory_hdf5_file/backup_trajectory_name.hdf`. | pypet/storageservice.py | def _trj_backup_trajectory(self, traj, backup_filename=None):
"""Backs up a trajectory.
:param traj: Trajectory that should be backed up
:param backup_filename:
Path and filename of backup file. If None is specified the storage service
defaults to `path_to_trajectory_h... | def _trj_backup_trajectory(self, traj, backup_filename=None):
"""Backs up a trajectory.
:param traj: Trajectory that should be backed up
:param backup_filename:
Path and filename of backup file. If None is specified the storage service
defaults to `path_to_trajectory_h... | [
"Backs",
"up",
"a",
"trajectory",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1607-L1639 | [
"def",
"_trj_backup_trajectory",
"(",
"self",
",",
"traj",
",",
"backup_filename",
"=",
"None",
")",
":",
"self",
".",
"_logger",
".",
"info",
"(",
"'Storing backup of %s.'",
"%",
"traj",
".",
"v_name",
")",
"mypath",
",",
"_",
"=",
"os",
".",
"path",
".... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_read_out_row | Reads out a row and returns a dictionary containing the row content.
:param colnames: List of column names
:param row: A pytables table row
:return: A dictionary with colnames as keys and content as values | pypet/storageservice.py | def _trj_read_out_row(colnames, row):
"""Reads out a row and returns a dictionary containing the row content.
:param colnames: List of column names
:param row: A pytables table row
:return: A dictionary with colnames as keys and content as values
"""
result_dict = {}
... | def _trj_read_out_row(colnames, row):
"""Reads out a row and returns a dictionary containing the row content.
:param colnames: List of column names
:param row: A pytables table row
:return: A dictionary with colnames as keys and content as values
"""
result_dict = {}
... | [
"Reads",
"out",
"a",
"row",
"and",
"returns",
"a",
"dictionary",
"containing",
"the",
"row",
"content",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1642-L1654 | [
"def",
"_trj_read_out_row",
"(",
"colnames",
",",
"row",
")",
":",
"result_dict",
"=",
"{",
"}",
"for",
"colname",
"in",
"colnames",
":",
"result_dict",
"[",
"colname",
"]",
"=",
"row",
"[",
"colname",
"]",
"return",
"result_dict"
] | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_merge_trajectories | Merges another trajectory into the current trajectory (as in self._trajectory_name).
:param other_trajectory_name: Name of other trajectory
:param rename_dict: Dictionary with old names (keys) and new names (values).
:param move_nodes: Whether to move hdf5 nodes or copy them
:param dele... | pypet/storageservice.py | def _trj_merge_trajectories(self, other_trajectory_name, rename_dict, move_nodes=False,
delete_trajectory=False, other_filename=None):
"""Merges another trajectory into the current trajectory (as in self._trajectory_name).
:param other_trajectory_name: Name of other traj... | def _trj_merge_trajectories(self, other_trajectory_name, rename_dict, move_nodes=False,
delete_trajectory=False, other_filename=None):
"""Merges another trajectory into the current trajectory (as in self._trajectory_name).
:param other_trajectory_name: Name of other traj... | [
"Merges",
"another",
"trajectory",
"into",
"the",
"current",
"trajectory",
"(",
"as",
"in",
"self",
".",
"_trajectory_name",
")",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1657-L1719 | [
"def",
"_trj_merge_trajectories",
"(",
"self",
",",
"other_trajectory_name",
",",
"rename_dict",
",",
"move_nodes",
"=",
"False",
",",
"delete_trajectory",
"=",
"False",
",",
"other_filename",
"=",
"None",
")",
":",
"if",
"other_filename",
"is",
"None",
"or",
"o... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_prepare_merge | Prepares a trajectory for merging.
This function will already store extended parameters.
:param traj: Target of merge
:param changed_parameters: List of extended parameters (i.e. their names). | pypet/storageservice.py | def _trj_prepare_merge(self, traj, changed_parameters, old_length):
"""Prepares a trajectory for merging.
This function will already store extended parameters.
:param traj: Target of merge
:param changed_parameters: List of extended parameters (i.e. their names).
"""
... | def _trj_prepare_merge(self, traj, changed_parameters, old_length):
"""Prepares a trajectory for merging.
This function will already store extended parameters.
:param traj: Target of merge
:param changed_parameters: List of extended parameters (i.e. their names).
"""
... | [
"Prepares",
"a",
"trajectory",
"for",
"merging",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1721-L1771 | [
"def",
"_trj_prepare_merge",
"(",
"self",
",",
"traj",
",",
"changed_parameters",
",",
"old_length",
")",
":",
"if",
"not",
"traj",
".",
"_stored",
":",
"traj",
".",
"f_store",
"(",
")",
"# Update meta information",
"infotable",
"=",
"getattr",
"(",
"self",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_load_trajectory | Loads a single trajectory from a given file.
:param traj: The trajectory
:param as_new: Whether to load trajectory as new
:param load_parameters: How to load parameters and config
:param load_derived_parameters: How to load derived parameters
:param load_results: How to loa... | pypet/storageservice.py | def _trj_load_trajectory(self, traj, as_new, load_parameters, load_derived_parameters,
load_results, load_other_data, recursive, max_depth,
with_run_information, with_meta_data, force):
"""Loads a single trajectory from a given file.
:param tra... | def _trj_load_trajectory(self, traj, as_new, load_parameters, load_derived_parameters,
load_results, load_other_data, recursive, max_depth,
with_run_information, with_meta_data, force):
"""Loads a single trajectory from a given file.
:param tra... | [
"Loads",
"a",
"single",
"trajectory",
"from",
"a",
"given",
"file",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1776-L1927 | [
"def",
"_trj_load_trajectory",
"(",
"self",
",",
"traj",
",",
"as_new",
",",
"load_parameters",
",",
"load_derived_parameters",
",",
"load_results",
",",
"load_other_data",
",",
"recursive",
",",
"max_depth",
",",
"with_run_information",
",",
"with_meta_data",
",",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_load_meta_data | Loads meta information about the trajectory
Checks if the version number does not differ from current pypet version
Loads, comment, timestamp, name, version from disk in case trajectory is not loaded
as new. Updates the run information as well. | pypet/storageservice.py | def _trj_load_meta_data(self, traj, load_data, as_new, with_run_information, force):
"""Loads meta information about the trajectory
Checks if the version number does not differ from current pypet version
Loads, comment, timestamp, name, version from disk in case trajectory is not loaded
... | def _trj_load_meta_data(self, traj, load_data, as_new, with_run_information, force):
"""Loads meta information about the trajectory
Checks if the version number does not differ from current pypet version
Loads, comment, timestamp, name, version from disk in case trajectory is not loaded
... | [
"Loads",
"meta",
"information",
"about",
"the",
"trajectory"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L1929-L2014 | [
"def",
"_trj_load_meta_data",
"(",
"self",
",",
"traj",
",",
"load_data",
",",
"as_new",
",",
"with_run_information",
",",
"force",
")",
":",
"metatable",
"=",
"self",
".",
"_overview_group",
".",
"info",
"metarow",
"=",
"metatable",
"[",
"0",
"]",
"try",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_load_sub_branch | Loads data starting from a node along a branch and starts recursively loading
all data at end of branch.
:param traj_node: The node from where loading starts
:param branch_name:
A branch along which loading progresses. Colon Notation is used:
'group1.group2.group3' loa... | pypet/storageservice.py | def _tree_load_sub_branch(self, traj_node, branch_name,
load_data=pypetconstants.LOAD_DATA,
with_links=True, recursive=False,
max_depth=None, _trajectory=None,
_as_new=False, _hdf5_group=None):
... | def _tree_load_sub_branch(self, traj_node, branch_name,
load_data=pypetconstants.LOAD_DATA,
with_links=True, recursive=False,
max_depth=None, _trajectory=None,
_as_new=False, _hdf5_group=None):
... | [
"Loads",
"data",
"starting",
"from",
"a",
"node",
"along",
"a",
"branch",
"and",
"starts",
"recursively",
"loading",
"all",
"data",
"at",
"end",
"of",
"branch",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2051-L2148 | [
"def",
"_tree_load_sub_branch",
"(",
"self",
",",
"traj_node",
",",
"branch_name",
",",
"load_data",
"=",
"pypetconstants",
".",
"LOAD_DATA",
",",
"with_links",
"=",
"True",
",",
"recursive",
"=",
"False",
",",
"max_depth",
"=",
"None",
",",
"_trajectory",
"="... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_check_version | Checks for version mismatch
Raises a VersionMismatchError if version of loaded trajectory and current pypet version
do not match. In case of `force=True` error is not raised only a warning is emitted. | pypet/storageservice.py | def _trj_check_version(self, version, python, force):
"""Checks for version mismatch
Raises a VersionMismatchError if version of loaded trajectory and current pypet version
do not match. In case of `force=True` error is not raised only a warning is emitted.
"""
curr_python = py... | def _trj_check_version(self, version, python, force):
"""Checks for version mismatch
Raises a VersionMismatchError if version of loaded trajectory and current pypet version
do not match. In case of `force=True` error is not raised only a warning is emitted.
"""
curr_python = py... | [
"Checks",
"for",
"version",
"mismatch"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2150-L2172 | [
"def",
"_trj_check_version",
"(",
"self",
",",
"version",
",",
"python",
",",
"force",
")",
":",
"curr_python",
"=",
"pypetconstants",
".",
"python_version_string",
"if",
"(",
"version",
"!=",
"VERSION",
"or",
"curr_python",
"!=",
"python",
")",
"and",
"not",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_fill_run_table | Fills the `run` overview table with information.
Will also update new information. | pypet/storageservice.py | def _trj_fill_run_table(self, traj, start, stop):
"""Fills the `run` overview table with information.
Will also update new information.
"""
def _make_row(info_dict):
row = (info_dict['idx'],
info_dict['name'],
info_dict['time'],
... | def _trj_fill_run_table(self, traj, start, stop):
"""Fills the `run` overview table with information.
Will also update new information.
"""
def _make_row(info_dict):
row = (info_dict['idx'],
info_dict['name'],
info_dict['time'],
... | [
"Fills",
"the",
"run",
"overview",
"table",
"with",
"information",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2177-L2220 | [
"def",
"_trj_fill_run_table",
"(",
"self",
",",
"traj",
",",
"start",
",",
"stop",
")",
":",
"def",
"_make_row",
"(",
"info_dict",
")",
":",
"row",
"=",
"(",
"info_dict",
"[",
"'idx'",
"]",
",",
"info_dict",
"[",
"'name'",
"]",
",",
"info_dict",
"[",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_store_meta_data | Stores general information about the trajectory in the hdf5file.
The `info` table will contain the name of the trajectory, it's timestamp, a comment,
the length (aka the number of single runs), and the current version number of pypet.
Also prepares the desired overview tables and fills the `ru... | pypet/storageservice.py | def _trj_store_meta_data(self, traj):
""" Stores general information about the trajectory in the hdf5file.
The `info` table will contain the name of the trajectory, it's timestamp, a comment,
the length (aka the number of single runs), and the current version number of pypet.
Also prep... | def _trj_store_meta_data(self, traj):
""" Stores general information about the trajectory in the hdf5file.
The `info` table will contain the name of the trajectory, it's timestamp, a comment,
the length (aka the number of single runs), and the current version number of pypet.
Also prep... | [
"Stores",
"general",
"information",
"about",
"the",
"trajectory",
"in",
"the",
"hdf5file",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2222-L2338 | [
"def",
"_trj_store_meta_data",
"(",
"self",
",",
"traj",
")",
":",
"# Description of the `info` table",
"descriptiondict",
"=",
"{",
"'name'",
":",
"pt",
".",
"StringCol",
"(",
"pypetconstants",
".",
"HDF5_STRCOL_MAX_LOCATION_LENGTH",
",",
"pos",
"=",
"0",
")",
",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_load_exploration | Recalls names of all explored parameters | pypet/storageservice.py | def _trj_load_exploration(self, traj):
"""Recalls names of all explored parameters"""
if hasattr(self._overview_group, 'explorations'):
explorations_table = self._overview_group._f_get_child( 'explorations')
for row in explorations_table.iterrows():
param_name = r... | def _trj_load_exploration(self, traj):
"""Recalls names of all explored parameters"""
if hasattr(self._overview_group, 'explorations'):
explorations_table = self._overview_group._f_get_child( 'explorations')
for row in explorations_table.iterrows():
param_name = r... | [
"Recalls",
"names",
"of",
"all",
"explored",
"parameters"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2340-L2357 | [
"def",
"_trj_load_exploration",
"(",
"self",
",",
"traj",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_overview_group",
",",
"'explorations'",
")",
":",
"explorations_table",
"=",
"self",
".",
"_overview_group",
".",
"_f_get_child",
"(",
"'explorations'",
")",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_store_explorations | Stores a all explored parameter names for internal recall | pypet/storageservice.py | def _trj_store_explorations(self, traj):
"""Stores a all explored parameter names for internal recall"""
nexplored = len(traj._explored_parameters)
if nexplored > 0:
if hasattr(self._overview_group, 'explorations'):
explorations_table = self._overview_group._f_get_chi... | def _trj_store_explorations(self, traj):
"""Stores a all explored parameter names for internal recall"""
nexplored = len(traj._explored_parameters)
if nexplored > 0:
if hasattr(self._overview_group, 'explorations'):
explorations_table = self._overview_group._f_get_chi... | [
"Stores",
"a",
"all",
"explored",
"parameter",
"names",
"for",
"internal",
"recall"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2359-L2383 | [
"def",
"_trj_store_explorations",
"(",
"self",
",",
"traj",
")",
":",
"nexplored",
"=",
"len",
"(",
"traj",
".",
"_explored_parameters",
")",
"if",
"nexplored",
">",
"0",
":",
"if",
"hasattr",
"(",
"self",
".",
"_overview_group",
",",
"'explorations'",
")",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srvc_make_overview_tables | Creates the overview tables in overview group | pypet/storageservice.py | def _srvc_make_overview_tables(self, tables_to_make, traj=None):
"""Creates the overview tables in overview group"""
for table_name in tables_to_make:
# Prepare the tables desciptions, depending on which overview table we create
# we need different columns
paramdescri... | def _srvc_make_overview_tables(self, tables_to_make, traj=None):
"""Creates the overview tables in overview group"""
for table_name in tables_to_make:
# Prepare the tables desciptions, depending on which overview table we create
# we need different columns
paramdescri... | [
"Creates",
"the",
"overview",
"tables",
"in",
"overview",
"group"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2385-L2451 | [
"def",
"_srvc_make_overview_tables",
"(",
"self",
",",
"tables_to_make",
",",
"traj",
"=",
"None",
")",
":",
"for",
"table_name",
"in",
"tables_to_make",
":",
"# Prepare the tables desciptions, depending on which overview table we create",
"# we need different columns",
"paramd... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._trj_store_trajectory | Stores a trajectory to an hdf5 file
Stores all groups, parameters and results | pypet/storageservice.py | def _trj_store_trajectory(self, traj, only_init=False, store_data=pypetconstants.STORE_DATA,
max_depth=None):
""" Stores a trajectory to an hdf5 file
Stores all groups, parameters and results
"""
if not only_init:
self._logger.info('Start stori... | def _trj_store_trajectory(self, traj, only_init=False, store_data=pypetconstants.STORE_DATA,
max_depth=None):
""" Stores a trajectory to an hdf5 file
Stores all groups, parameters and results
"""
if not only_init:
self._logger.info('Start stori... | [
"Stores",
"a",
"trajectory",
"to",
"an",
"hdf5",
"file"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2453-L2525 | [
"def",
"_trj_store_trajectory",
"(",
"self",
",",
"traj",
",",
"only_init",
"=",
"False",
",",
"store_data",
"=",
"pypetconstants",
".",
"STORE_DATA",
",",
"max_depth",
"=",
"None",
")",
":",
"if",
"not",
"only_init",
":",
"self",
".",
"_logger",
".",
"inf... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_store_sub_branch | Stores data starting from a node along a branch and starts recursively loading
all data at end of branch.
:param traj_node: The node where storing starts
:param branch_name:
A branch along which storing progresses. Colon Notation is used:
'group1.group2.group3' loads '... | pypet/storageservice.py | def _tree_store_sub_branch(self, traj_node, branch_name,
store_data=pypetconstants.STORE_DATA,
with_links=True,
recursive=False,
max_depth=None,
hdf5_group=None):
... | def _tree_store_sub_branch(self, traj_node, branch_name,
store_data=pypetconstants.STORE_DATA,
with_links=True,
recursive=False,
max_depth=None,
hdf5_group=None):
... | [
"Stores",
"data",
"starting",
"from",
"a",
"node",
"along",
"a",
"branch",
"and",
"starts",
"recursively",
"loading",
"all",
"data",
"at",
"end",
"of",
"branch",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2527-L2627 | [
"def",
"_tree_store_sub_branch",
"(",
"self",
",",
"traj_node",
",",
"branch_name",
",",
"store_data",
"=",
"pypetconstants",
".",
"STORE_DATA",
",",
"with_links",
"=",
"True",
",",
"recursive",
"=",
"False",
",",
"max_depth",
"=",
"None",
",",
"hdf5_group",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_create_leaf | Creates a new pypet leaf instance.
Returns the leaf and if it is an explored parameter the length of the range. | pypet/storageservice.py | def _tree_create_leaf(self, name, trajectory, hdf5_group):
""" Creates a new pypet leaf instance.
Returns the leaf and if it is an explored parameter the length of the range.
"""
class_name = self._all_get_from_attrs(hdf5_group, HDF5StorageService.CLASS_NAME)
# Create the inst... | def _tree_create_leaf(self, name, trajectory, hdf5_group):
""" Creates a new pypet leaf instance.
Returns the leaf and if it is an explored parameter the length of the range.
"""
class_name = self._all_get_from_attrs(hdf5_group, HDF5StorageService.CLASS_NAME)
# Create the inst... | [
"Creates",
"a",
"new",
"pypet",
"leaf",
"instance",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2632-L2645 | [
"def",
"_tree_create_leaf",
"(",
"self",
",",
"name",
",",
"trajectory",
",",
"hdf5_group",
")",
":",
"class_name",
"=",
"self",
".",
"_all_get_from_attrs",
"(",
"hdf5_group",
",",
"HDF5StorageService",
".",
"CLASS_NAME",
")",
"# Create the instance with the appropria... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_load_nodes_dfs | Loads a node from hdf5 file and if desired recursively everything below
:param parent_traj_node: The parent node whose child should be loaded
:param load_data: How to load the data
:param with_links: If links should be loaded
:param recursive: Whether loading recursively below hdf5_grou... | pypet/storageservice.py | def _tree_load_nodes_dfs(self, parent_traj_node, load_data, with_links, recursive,
max_depth, current_depth, trajectory, as_new, hdf5_group):
"""Loads a node from hdf5 file and if desired recursively everything below
:param parent_traj_node: The parent node whose child should b... | def _tree_load_nodes_dfs(self, parent_traj_node, load_data, with_links, recursive,
max_depth, current_depth, trajectory, as_new, hdf5_group):
"""Loads a node from hdf5 file and if desired recursively everything below
:param parent_traj_node: The parent node whose child should b... | [
"Loads",
"a",
"node",
"from",
"hdf5",
"file",
"and",
"if",
"desired",
"recursively",
"everything",
"below"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2647-L2730 | [
"def",
"_tree_load_nodes_dfs",
"(",
"self",
",",
"parent_traj_node",
",",
"load_data",
",",
"with_links",
",",
"recursive",
",",
"max_depth",
",",
"current_depth",
",",
"trajectory",
",",
"as_new",
",",
"hdf5_group",
")",
":",
"if",
"max_depth",
"is",
"None",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_load_link | Loads a link
:param new_traj_node: Node in traj containing link
:param load_data: How to load data in the linked node
:param traj: The trajectory
:param as_new: If data in linked node should be loaded as new
:param hdf5_soft_link: The hdf5 soft link | pypet/storageservice.py | def _tree_load_link(self, new_traj_node, load_data, traj, as_new, hdf5_soft_link):
""" Loads a link
:param new_traj_node: Node in traj containing link
:param load_data: How to load data in the linked node
:param traj: The trajectory
:param as_new: If data in linked node... | def _tree_load_link(self, new_traj_node, load_data, traj, as_new, hdf5_soft_link):
""" Loads a link
:param new_traj_node: Node in traj containing link
:param load_data: How to load data in the linked node
:param traj: The trajectory
:param as_new: If data in linked node... | [
"Loads",
"a",
"link",
":",
"param",
"new_traj_node",
":",
"Node",
"in",
"traj",
"containing",
"link",
":",
"param",
"load_data",
":",
"How",
"to",
"load",
"data",
"in",
"the",
"linked",
"node",
":",
"param",
"traj",
":",
"The",
"trajectory",
":",
"param"... | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2732-L2775 | [
"def",
"_tree_load_link",
"(",
"self",
",",
"new_traj_node",
",",
"load_data",
",",
"traj",
",",
"as_new",
",",
"hdf5_soft_link",
")",
":",
"try",
":",
"linked_group",
"=",
"hdf5_soft_link",
"(",
")",
"link_name",
"=",
"hdf5_soft_link",
".",
"_v_name",
"if",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_store_nodes_dfs | Stores a node to hdf5 and if desired stores recursively everything below it.
:param parent_traj_node: The parental node
:param name: Name of node to be stored
:param store_data: How to store data
:param with_links: If links should be stored
:param recursive: Whether to store rec... | pypet/storageservice.py | def _tree_store_nodes_dfs(self, parent_traj_node, name, store_data, with_links, recursive,
max_depth, current_depth,
parent_hdf5_group):
"""Stores a node to hdf5 and if desired stores recursively everything below it.
:param parent_traj_node: The paren... | def _tree_store_nodes_dfs(self, parent_traj_node, name, store_data, with_links, recursive,
max_depth, current_depth,
parent_hdf5_group):
"""Stores a node to hdf5 and if desired stores recursively everything below it.
:param parent_traj_node: The paren... | [
"Stores",
"a",
"node",
"to",
"hdf5",
"and",
"if",
"desired",
"stores",
"recursively",
"everything",
"below",
"it",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2777-L2830 | [
"def",
"_tree_store_nodes_dfs",
"(",
"self",
",",
"parent_traj_node",
",",
"name",
",",
"store_data",
",",
"with_links",
",",
"recursive",
",",
"max_depth",
",",
"current_depth",
",",
"parent_hdf5_group",
")",
":",
"if",
"max_depth",
"is",
"None",
":",
"max_dept... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._tree_store_link | Creates a soft link.
:param node_in_traj: parental node
:param store_data: how to store data
:param link: name of link
:param hdf5_group: current parental hdf5 group | pypet/storageservice.py | def _tree_store_link(self, node_in_traj, link, hdf5_group):
"""Creates a soft link.
:param node_in_traj: parental node
:param store_data: how to store data
:param link: name of link
:param hdf5_group: current parental hdf5 group
"""
if hasattr(hdf5_group... | def _tree_store_link(self, node_in_traj, link, hdf5_group):
"""Creates a soft link.
:param node_in_traj: parental node
:param store_data: how to store data
:param link: name of link
:param hdf5_group: current parental hdf5 group
"""
if hasattr(hdf5_group... | [
"Creates",
"a",
"soft",
"link",
".",
":",
"param",
"node_in_traj",
":",
"parental",
"node",
":",
"param",
"store_data",
":",
"how",
"to",
"store",
"data",
":",
"param",
"link",
":",
"name",
"of",
"link",
":",
"param",
"hdf5_group",
":",
"current",
"paren... | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2832-L2863 | [
"def",
"_tree_store_link",
"(",
"self",
",",
"node_in_traj",
",",
"link",
",",
"hdf5_group",
")",
":",
"if",
"hasattr",
"(",
"hdf5_group",
",",
"link",
")",
":",
"return",
"linked_traj_node",
"=",
"node_in_traj",
".",
"_links",
"[",
"link",
"]",
"linking_nam... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srn_store_single_run | Stores a single run instance to disk (only meta data) | pypet/storageservice.py | def _srn_store_single_run(self, traj,
recursive=True,
store_data=pypetconstants.STORE_DATA,
max_depth=None):
""" Stores a single run instance to disk (only meta data)"""
if store_data != pypetconstants.STORE_NOTHI... | def _srn_store_single_run(self, traj,
recursive=True,
store_data=pypetconstants.STORE_DATA,
max_depth=None):
""" Stores a single run instance to disk (only meta data)"""
if store_data != pypetconstants.STORE_NOTHI... | [
"Stores",
"a",
"single",
"run",
"instance",
"to",
"disk",
"(",
"only",
"meta",
"data",
")"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2867-L2895 | [
"def",
"_srn_store_single_run",
"(",
"self",
",",
"traj",
",",
"recursive",
"=",
"True",
",",
"store_data",
"=",
"pypetconstants",
".",
"STORE_DATA",
",",
"max_depth",
"=",
"None",
")",
":",
"if",
"store_data",
"!=",
"pypetconstants",
".",
"STORE_NOTHING",
":"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._srn_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/storageservice.py | def _srn_summarize_explored_parameters(self, paramlist):
"""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 ... | def _srn_summarize_explored_parameters(self, paramlist):
"""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 ... | [
"Summarizes",
"the",
"parameter",
"settings",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2897-L2934 | [
"def",
"_srn_summarize_explored_parameters",
"(",
"self",
",",
"paramlist",
")",
":",
"runsummary",
"=",
"''",
"paramlist",
"=",
"sorted",
"(",
"paramlist",
",",
"key",
"=",
"lambda",
"name",
":",
"name",
".",
"v_name",
"+",
"name",
".",
"v_location",
")",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_store_param_or_result_table_entry | Stores a single row into an overview table
:param instance: A parameter or result instance
:param table: Table where row will be inserted
:param flags:
Flags how to insert into the table. Potential Flags are
`ADD_ROW`, `REMOVE_ROW`, `MODIFY_ROW`
:param additi... | pypet/storageservice.py | def _all_store_param_or_result_table_entry(self, instance, table, flags,
additional_info=None):
"""Stores a single row into an overview table
:param instance: A parameter or result instance
:param table: Table where row will be inserted
:... | def _all_store_param_or_result_table_entry(self, instance, table, flags,
additional_info=None):
"""Stores a single row into an overview table
:param instance: A parameter or result instance
:param table: Table where row will be inserted
:... | [
"Stores",
"a",
"single",
"row",
"into",
"an",
"overview",
"table"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2939-L2995 | [
"def",
"_all_store_param_or_result_table_entry",
"(",
"self",
",",
"instance",
",",
"table",
",",
"flags",
",",
"additional_info",
"=",
"None",
")",
":",
"# assert isinstance(table, pt.Table)",
"location",
"=",
"instance",
".",
"v_location",
"name",
"=",
"instance",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_get_or_create_table | Creates a new table, or if the table already exists, returns it. | pypet/storageservice.py | def _all_get_or_create_table(self, where, tablename, description, expectedrows=None):
"""Creates a new table, or if the table already exists, returns it."""
where_node = self._hdf5file.get_node(where)
if not tablename in where_node:
if not expectedrows is None:
table... | def _all_get_or_create_table(self, where, tablename, description, expectedrows=None):
"""Creates a new table, or if the table already exists, returns it."""
where_node = self._hdf5file.get_node(where)
if not tablename in where_node:
if not expectedrows is None:
table... | [
"Creates",
"a",
"new",
"table",
"or",
"if",
"the",
"table",
"already",
"exists",
"returns",
"it",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L2998-L3015 | [
"def",
"_all_get_or_create_table",
"(",
"self",
",",
"where",
",",
"tablename",
",",
"description",
",",
"expectedrows",
"=",
"None",
")",
":",
"where_node",
"=",
"self",
".",
"_hdf5file",
".",
"get_node",
"(",
"where",
")",
"if",
"not",
"tablename",
"in",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_get_node_by_name | Returns an HDF5 node by the path specified in `name` | pypet/storageservice.py | def _all_get_node_by_name(self, name):
"""Returns an HDF5 node by the path specified in `name`"""
path_name = name.replace('.', '/')
where = '/%s/%s' % (self._trajectory_name, path_name)
return self._hdf5file.get_node(where=where) | def _all_get_node_by_name(self, name):
"""Returns an HDF5 node by the path specified in `name`"""
path_name = name.replace('.', '/')
where = '/%s/%s' % (self._trajectory_name, path_name)
return self._hdf5file.get_node(where=where) | [
"Returns",
"an",
"HDF5",
"node",
"by",
"the",
"path",
"specified",
"in",
"name"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3017-L3021 | [
"def",
"_all_get_node_by_name",
"(",
"self",
",",
"name",
")",
":",
"path_name",
"=",
"name",
".",
"replace",
"(",
"'.'",
",",
"'/'",
")",
"where",
"=",
"'/%s/%s'",
"%",
"(",
"self",
".",
"_trajectory_name",
",",
"path_name",
")",
"return",
"self",
".",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_set_attributes_to_recall_natives | Stores original data type to hdf5 node attributes for preserving the data type.
:param data:
Data to be stored
:param ptitem:
HDF5 node to store data types as attributes. Can also be just a PTItemMock.
:param prefix:
String prefix to label and name data ... | pypet/storageservice.py | def _all_set_attributes_to_recall_natives(data, ptitem, prefix):
"""Stores original data type to hdf5 node attributes for preserving the data type.
:param data:
Data to be stored
:param ptitem:
HDF5 node to store data types as attributes. Can also be just a PTItemMock... | def _all_set_attributes_to_recall_natives(data, ptitem, prefix):
"""Stores original data type to hdf5 node attributes for preserving the data type.
:param data:
Data to be stored
:param ptitem:
HDF5 node to store data types as attributes. Can also be just a PTItemMock... | [
"Stores",
"original",
"data",
"type",
"to",
"hdf5",
"node",
"attributes",
"for",
"preserving",
"the",
"data",
"type",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3037-L3112 | [
"def",
"_all_set_attributes_to_recall_natives",
"(",
"data",
",",
"ptitem",
",",
"prefix",
")",
":",
"# If `data` is a container, remember the container type",
"if",
"type",
"(",
"data",
")",
"is",
"tuple",
":",
"HDF5StorageService",
".",
"_all_set_attr",
"(",
"ptitem",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_recall_native_type | Checks if loaded data has the type it was stored in. If not converts it.
:param data: Data item to be checked and converted
:param ptitem: HDf5 Node or Leaf from where data was loaded
:param prefix: Prefix for recalling the data type from the hdf5 node attributes
:return:
... | pypet/storageservice.py | def _all_recall_native_type(self, data, ptitem, prefix):
"""Checks if loaded data has the type it was stored in. If not converts it.
:param data: Data item to be checked and converted
:param ptitem: HDf5 Node or Leaf from where data was loaded
:param prefix: Prefix for recalling the dat... | def _all_recall_native_type(self, data, ptitem, prefix):
"""Checks if loaded data has the type it was stored in. If not converts it.
:param data: Data item to be checked and converted
:param ptitem: HDf5 Node or Leaf from where data was loaded
:param prefix: Prefix for recalling the dat... | [
"Checks",
"if",
"loaded",
"data",
"has",
"the",
"type",
"it",
"was",
"stored",
"in",
".",
"If",
"not",
"converts",
"it",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3114-L3206 | [
"def",
"_all_recall_native_type",
"(",
"self",
",",
"data",
",",
"ptitem",
",",
"prefix",
")",
":",
"typestr",
"=",
"self",
".",
"_all_get_from_attrs",
"(",
"ptitem",
",",
"prefix",
"+",
"HDF5StorageService",
".",
"SCALAR_TYPE",
")",
"colltype",
"=",
"self",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_add_or_modify_row | Adds or changes a row in a pytable.
:param item_name: Name of item, the row is about, only important for throwing errors.
:param insert_dict:
Dictionary of data that is about to be inserted into the pytables row.
:param table:
The table to insert or modify a row in
... | pypet/storageservice.py | def _all_add_or_modify_row(self, item_name, insert_dict, table, index=None, condition=None,
condvars=None,
flags=(ADD_ROW, MODIFY_ROW,)):
"""Adds or changes a row in a pytable.
:param item_name: Name of item, the row is about, only important... | def _all_add_or_modify_row(self, item_name, insert_dict, table, index=None, condition=None,
condvars=None,
flags=(ADD_ROW, MODIFY_ROW,)):
"""Adds or changes a row in a pytable.
:param item_name: Name of item, the row is about, only important... | [
"Adds",
"or",
"changes",
"a",
"row",
"in",
"a",
"pytable",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3217-L3316 | [
"def",
"_all_add_or_modify_row",
"(",
"self",
",",
"item_name",
",",
"insert_dict",
",",
"table",
",",
"index",
"=",
"None",
",",
"condition",
"=",
"None",
",",
"condvars",
"=",
"None",
",",
"flags",
"=",
"(",
"ADD_ROW",
",",
"MODIFY_ROW",
",",
")",
")",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_insert_into_row | Copies data from `insert_dict` into a pytables `row`. | pypet/storageservice.py | def _all_insert_into_row(self, row, insert_dict):
"""Copies data from `insert_dict` into a pytables `row`."""
for key, val in insert_dict.items():
try:
row[key] = val
except KeyError as ke:
self._logger.warning('Could not write `%s` into a table, '... | def _all_insert_into_row(self, row, insert_dict):
"""Copies data from `insert_dict` into a pytables `row`."""
for key, val in insert_dict.items():
try:
row[key] = val
except KeyError as ke:
self._logger.warning('Could not write `%s` into a table, '... | [
"Copies",
"data",
"from",
"insert_dict",
"into",
"a",
"pytables",
"row",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3318-L3324 | [
"def",
"_all_insert_into_row",
"(",
"self",
",",
"row",
",",
"insert_dict",
")",
":",
"for",
"key",
",",
"val",
"in",
"insert_dict",
".",
"items",
"(",
")",
":",
"try",
":",
"row",
"[",
"key",
"]",
"=",
"val",
"except",
"KeyError",
"as",
"ke",
":",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_extract_insert_dict | Extracts information from a given item to be stored into a pytable row.
Items can be a variety of things here, trajectories, single runs, group node,
parameters, results.
:param item: Item from which data should be extracted
:param colnames: Names of the columns in the pytable
... | pypet/storageservice.py | def _all_extract_insert_dict(self, item, colnames, additional_info=None):
"""Extracts information from a given item to be stored into a pytable row.
Items can be a variety of things here, trajectories, single runs, group node,
parameters, results.
:param item: Item from which data shou... | def _all_extract_insert_dict(self, item, colnames, additional_info=None):
"""Extracts information from a given item to be stored into a pytable row.
Items can be a variety of things here, trajectories, single runs, group node,
parameters, results.
:param item: Item from which data shou... | [
"Extracts",
"information",
"from",
"a",
"given",
"item",
"to",
"be",
"stored",
"into",
"a",
"pytable",
"row",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3326-L3414 | [
"def",
"_all_extract_insert_dict",
"(",
"self",
",",
"item",
",",
"colnames",
",",
"additional_info",
"=",
"None",
")",
":",
"insert_dict",
"=",
"{",
"}",
"if",
"'length'",
"in",
"colnames",
":",
"insert_dict",
"[",
"'length'",
"]",
"=",
"len",
"(",
"item"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_cut_string | Cuts string data to the maximum length allowed in a pytables column
if string is too long.
:param string: String to be cut
:param max_length: Maximum allowed string length
:param logger: Logger where messages about truncating should be written
:return: String, cut if too long | pypet/storageservice.py | def _all_cut_string(string, max_length, logger):
"""Cuts string data to the maximum length allowed in a pytables column
if string is too long.
:param string: String to be cut
:param max_length: Maximum allowed string length
:param logger: Logger where messages about truncating s... | def _all_cut_string(string, max_length, logger):
"""Cuts string data to the maximum length allowed in a pytables column
if string is too long.
:param string: String to be cut
:param max_length: Maximum allowed string length
:param logger: Logger where messages about truncating s... | [
"Cuts",
"string",
"data",
"to",
"the",
"maximum",
"length",
"allowed",
"in",
"a",
"pytables",
"column",
"if",
"string",
"is",
"too",
"long",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3417-L3434 | [
"def",
"_all_cut_string",
"(",
"string",
",",
"max_length",
",",
"logger",
")",
":",
"if",
"len",
"(",
"string",
")",
">",
"max_length",
":",
"logger",
".",
"debug",
"(",
"'The string `%s` was too long I truncated it to'",
"' %d characters'",
"%",
"(",
"string",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_create_or_get_group | Creates or returns a group | pypet/storageservice.py | def _all_create_or_get_group(self, name, parent_hdf5_group=None):
"""Creates or returns a group"""
if not name in parent_hdf5_group:
new_hdf5_group = self._hdf5file.create_group(where=parent_hdf5_group,
name=name,
... | def _all_create_or_get_group(self, name, parent_hdf5_group=None):
"""Creates or returns a group"""
if not name in parent_hdf5_group:
new_hdf5_group = self._hdf5file.create_group(where=parent_hdf5_group,
name=name,
... | [
"Creates",
"or",
"returns",
"a",
"group"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3436-L3446 | [
"def",
"_all_create_or_get_group",
"(",
"self",
",",
"name",
",",
"parent_hdf5_group",
"=",
"None",
")",
":",
"if",
"not",
"name",
"in",
"parent_hdf5_group",
":",
"new_hdf5_group",
"=",
"self",
".",
"_hdf5file",
".",
"create_group",
"(",
"where",
"=",
"parent_... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_create_or_get_groups | Creates new or follows existing group nodes along a given colon separated `key`.
:param key:
Colon separated path along hdf5 file, e.g. `parameters.mobiles.cars`.
:param start_hdf5_group:
HDF5 group from where to start, leave `None` for the trajectory group.
:return:... | pypet/storageservice.py | def _all_create_or_get_groups(self, key, start_hdf5_group=None):
"""Creates new or follows existing group nodes along a given colon separated `key`.
:param key:
Colon separated path along hdf5 file, e.g. `parameters.mobiles.cars`.
:param start_hdf5_group:
HDF5 group f... | def _all_create_or_get_groups(self, key, start_hdf5_group=None):
"""Creates new or follows existing group nodes along a given colon separated `key`.
:param key:
Colon separated path along hdf5 file, e.g. `parameters.mobiles.cars`.
:param start_hdf5_group:
HDF5 group f... | [
"Creates",
"new",
"or",
"follows",
"existing",
"group",
"nodes",
"along",
"a",
"given",
"colon",
"separated",
"key",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3448-L3475 | [
"def",
"_all_create_or_get_groups",
"(",
"self",
",",
"key",
",",
"start_hdf5_group",
"=",
"None",
")",
":",
"if",
"start_hdf5_group",
"is",
"None",
":",
"newhdf5_group",
"=",
"self",
".",
"_trajectory_group",
"else",
":",
"newhdf5_group",
"=",
"start_hdf5_group",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._ann_store_annotations | Stores annotations into an hdf5 file. | pypet/storageservice.py | def _ann_store_annotations(self, item_with_annotations, node, overwrite=False):
"""Stores annotations into an hdf5 file."""
# If we overwrite delete all annotations first
if overwrite is True or overwrite == 'v_annotations':
annotated = self._all_get_from_attrs(node, HDF5StorageServ... | def _ann_store_annotations(self, item_with_annotations, node, overwrite=False):
"""Stores annotations into an hdf5 file."""
# If we overwrite delete all annotations first
if overwrite is True or overwrite == 'v_annotations':
annotated = self._all_get_from_attrs(node, HDF5StorageServ... | [
"Stores",
"annotations",
"into",
"an",
"hdf5",
"file",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3480-L3514 | [
"def",
"_ann_store_annotations",
"(",
"self",
",",
"item_with_annotations",
",",
"node",
",",
"overwrite",
"=",
"False",
")",
":",
"# If we overwrite delete all annotations first",
"if",
"overwrite",
"is",
"True",
"or",
"overwrite",
"==",
"'v_annotations'",
":",
"anno... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._ann_load_annotations | Loads annotations from disk. | pypet/storageservice.py | def _ann_load_annotations(self, item_with_annotations, node):
"""Loads annotations from disk."""
annotated = self._all_get_from_attrs(node, HDF5StorageService.ANNOTATED)
if annotated:
annotations = item_with_annotations.v_annotations
# You can only load into non-empty... | def _ann_load_annotations(self, item_with_annotations, node):
"""Loads annotations from disk."""
annotated = self._all_get_from_attrs(node, HDF5StorageService.ANNOTATED)
if annotated:
annotations = item_with_annotations.v_annotations
# You can only load into non-empty... | [
"Loads",
"annotations",
"from",
"disk",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3516-L3538 | [
"def",
"_ann_load_annotations",
"(",
"self",
",",
"item_with_annotations",
",",
"node",
")",
":",
"annotated",
"=",
"self",
".",
"_all_get_from_attrs",
"(",
"node",
",",
"HDF5StorageService",
".",
"ANNOTATED",
")",
"if",
"annotated",
":",
"annotations",
"=",
"it... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._grp_store_group | Stores a group node.
For group nodes only annotations and comments need to be stored. | pypet/storageservice.py | def _grp_store_group(self, traj_group, store_data=pypetconstants.STORE_DATA,
with_links=True, recursive=False, max_depth=None,
_hdf5_group=None, _newly_created=False):
"""Stores a group node.
For group nodes only annotations and comments need to be stor... | def _grp_store_group(self, traj_group, store_data=pypetconstants.STORE_DATA,
with_links=True, recursive=False, max_depth=None,
_hdf5_group=None, _newly_created=False):
"""Stores a group node.
For group nodes only annotations and comments need to be stor... | [
"Stores",
"a",
"group",
"node",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3543-L3588 | [
"def",
"_grp_store_group",
"(",
"self",
",",
"traj_group",
",",
"store_data",
"=",
"pypetconstants",
".",
"STORE_DATA",
",",
"with_links",
"=",
"True",
",",
"recursive",
"=",
"False",
",",
"max_depth",
"=",
"None",
",",
"_hdf5_group",
"=",
"None",
",",
"_new... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._grp_load_group | Loads a group node and potentially everything recursively below | pypet/storageservice.py | def _grp_load_group(self, traj_group, load_data=pypetconstants.LOAD_DATA, with_links=True,
recursive=False, max_depth=None,
_traj=None, _as_new=False, _hdf5_group=None):
"""Loads a group node and potentially everything recursively below"""
if _hdf5_group i... | def _grp_load_group(self, traj_group, load_data=pypetconstants.LOAD_DATA, with_links=True,
recursive=False, max_depth=None,
_traj=None, _as_new=False, _hdf5_group=None):
"""Loads a group node and potentially everything recursively below"""
if _hdf5_group i... | [
"Loads",
"a",
"group",
"node",
"and",
"potentially",
"everything",
"recursively",
"below"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3590-L3617 | [
"def",
"_grp_load_group",
"(",
"self",
",",
"traj_group",
",",
"load_data",
"=",
"pypetconstants",
".",
"LOAD_DATA",
",",
"with_links",
"=",
"True",
",",
"recursive",
"=",
"False",
",",
"max_depth",
"=",
"None",
",",
"_traj",
"=",
"None",
",",
"_as_new",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_load_skeleton | Reloads skeleton data of a tree node | pypet/storageservice.py | def _all_load_skeleton(self, traj_node, hdf5_group):
"""Reloads skeleton data of a tree node"""
if traj_node.v_annotations.f_is_empty():
self._ann_load_annotations(traj_node, hdf5_group)
if traj_node.v_comment == '':
comment = self._all_get_from_attrs(hdf5_group, HDF5Stor... | def _all_load_skeleton(self, traj_node, hdf5_group):
"""Reloads skeleton data of a tree node"""
if traj_node.v_annotations.f_is_empty():
self._ann_load_annotations(traj_node, hdf5_group)
if traj_node.v_comment == '':
comment = self._all_get_from_attrs(hdf5_group, HDF5Stor... | [
"Reloads",
"skeleton",
"data",
"of",
"a",
"tree",
"node"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3619-L3627 | [
"def",
"_all_load_skeleton",
"(",
"self",
",",
"traj_node",
",",
"hdf5_group",
")",
":",
"if",
"traj_node",
".",
"v_annotations",
".",
"f_is_empty",
"(",
")",
":",
"self",
".",
"_ann_load_annotations",
"(",
"traj_node",
",",
"hdf5_group",
")",
"if",
"traj_node... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_extract_missing_flags | Extracts storage flags for data in `data_dict`
if they were not specified in `flags_dict`.
See :const:`~pypet.storageservice.HDF5StorageService.TYPE_FLAG_MAPPING`
for how to store different types of data per default. | pypet/storageservice.py | def _prm_extract_missing_flags(data_dict, flags_dict):
"""Extracts storage flags for data in `data_dict`
if they were not specified in `flags_dict`.
See :const:`~pypet.storageservice.HDF5StorageService.TYPE_FLAG_MAPPING`
for how to store different types of data per default.
"""... | def _prm_extract_missing_flags(data_dict, flags_dict):
"""Extracts storage flags for data in `data_dict`
if they were not specified in `flags_dict`.
See :const:`~pypet.storageservice.HDF5StorageService.TYPE_FLAG_MAPPING`
for how to store different types of data per default.
"""... | [
"Extracts",
"storage",
"flags",
"for",
"data",
"in",
"data_dict",
"if",
"they",
"were",
"not",
"specified",
"in",
"flags_dict",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3632-L3654 | [
"def",
"_prm_extract_missing_flags",
"(",
"data_dict",
",",
"flags_dict",
")",
":",
"for",
"key",
",",
"data",
"in",
"data_dict",
".",
"items",
"(",
")",
":",
"if",
"not",
"key",
"in",
"flags_dict",
":",
"dtype",
"=",
"type",
"(",
"data",
")",
"if",
"(... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_meta_add_summary | Adds data to the summary tables and returns if `instance`s comment has to be stored.
Also moves comments upwards in the hierarchy if purge_duplicate_comments is true
and a lower index run has completed. Only necessary for *multiprocessing*.
:return: Tuple
* String specifying the s... | pypet/storageservice.py | def _prm_meta_add_summary(self, instance):
"""Adds data to the summary tables and returns if `instance`s comment has to be stored.
Also moves comments upwards in the hierarchy if purge_duplicate_comments is true
and a lower index run has completed. Only necessary for *multiprocessing*.
... | def _prm_meta_add_summary(self, instance):
"""Adds data to the summary tables and returns if `instance`s comment has to be stored.
Also moves comments upwards in the hierarchy if purge_duplicate_comments is true
and a lower index run has completed. Only necessary for *multiprocessing*.
... | [
"Adds",
"data",
"to",
"the",
"summary",
"tables",
"and",
"returns",
"if",
"instance",
"s",
"comment",
"has",
"to",
"be",
"stored",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3656-L3720 | [
"def",
"_prm_meta_add_summary",
"(",
"self",
",",
"instance",
")",
":",
"if",
"instance",
".",
"v_comment",
"==",
"''",
":",
"return",
"False",
"where",
"=",
"instance",
".",
"v_branch",
"definitely_store_comment",
"=",
"True",
"# Get the hexdigest of the comment to... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_add_meta_info | Adds information to overview tables and meta information to
the `instance`s hdf5 `group`.
:param instance: Instance to store meta info about
:param group: HDF5 group of instance
:param overwrite: If data should be explicitly overwritten | pypet/storageservice.py | def _prm_add_meta_info(self, instance, group, overwrite=False):
"""Adds information to overview tables and meta information to
the `instance`s hdf5 `group`.
:param instance: Instance to store meta info about
:param group: HDF5 group of instance
:param overwrite: If data should b... | def _prm_add_meta_info(self, instance, group, overwrite=False):
"""Adds information to overview tables and meta information to
the `instance`s hdf5 `group`.
:param instance: Instance to store meta info about
:param group: HDF5 group of instance
:param overwrite: If data should b... | [
"Adds",
"information",
"to",
"overview",
"tables",
"and",
"meta",
"information",
"to",
"the",
"instance",
"s",
"hdf5",
"group",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3722-L3780 | [
"def",
"_prm_add_meta_info",
"(",
"self",
",",
"instance",
",",
"group",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"overwrite",
":",
"flags",
"=",
"(",
")",
"else",
":",
"flags",
"=",
"(",
"HDF5StorageService",
".",
"ADD_ROW",
",",
")",
"definitely... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_store_from_dict | Stores a `store_dict` | pypet/storageservice.py | def _prm_store_from_dict(self, fullname, store_dict, hdf5_group, store_flags, kwargs):
"""Stores a `store_dict`"""
for key, data_to_store in store_dict.items():
# self._logger.log(1, 'SUB-Storing %s [%s]', key, str(store_dict[key]))
original_hdf5_group = None
flag = ... | def _prm_store_from_dict(self, fullname, store_dict, hdf5_group, store_flags, kwargs):
"""Stores a `store_dict`"""
for key, data_to_store in store_dict.items():
# self._logger.log(1, 'SUB-Storing %s [%s]', key, str(store_dict[key]))
original_hdf5_group = None
flag = ... | [
"Stores",
"a",
"store_dict"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3782-L3846 | [
"def",
"_prm_store_from_dict",
"(",
"self",
",",
"fullname",
",",
"store_dict",
",",
"hdf5_group",
",",
"store_flags",
",",
"kwargs",
")",
":",
"for",
"key",
",",
"data_to_store",
"in",
"store_dict",
".",
"items",
"(",
")",
":",
"# self._logger.log(1, 'SUB-Stori... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_store_parameter_or_result | Stores a parameter or result to hdf5.
:param instance:
The instance to be stored
:param store_data:
How to store data
:param store_flags:
Dictionary containing how to store individual data, usually empty.
:param overwrite:
Instructi... | pypet/storageservice.py | def _prm_store_parameter_or_result(self,
instance,
store_data=pypetconstants.STORE_DATA,
store_flags=None,
overwrite=None,
wi... | def _prm_store_parameter_or_result(self,
instance,
store_data=pypetconstants.STORE_DATA,
store_flags=None,
overwrite=None,
wi... | [
"Stores",
"a",
"parameter",
"or",
"result",
"to",
"hdf5",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L3848-L3996 | [
"def",
"_prm_store_parameter_or_result",
"(",
"self",
",",
"instance",
",",
"store_data",
"=",
"pypetconstants",
".",
"STORE_DATA",
",",
"store_flags",
"=",
"None",
",",
"overwrite",
"=",
"None",
",",
"with_links",
"=",
"False",
",",
"recursive",
"=",
"False",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_select_shared_pandas_data | Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:param kwargs:
Arguments passed to pandas' select method | pypet/storageservice.py | def _prm_select_shared_pandas_data(self, pd_node, full_name, **kwargs):
"""Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:param kwargs:
... | def _prm_select_shared_pandas_data(self, pd_node, full_name, **kwargs):
"""Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:param kwargs:
... | [
"Reads",
"a",
"DataFrame",
"from",
"dis",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4035-L4057 | [
"def",
"_prm_select_shared_pandas_data",
"(",
"self",
",",
"pd_node",
",",
"full_name",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"pathname",
"=",
"pd_node",
".",
"_v_pathname",
"pandas_store",
"=",
"self",
".",
"_hdf5store",
"return",
"pandas_store",
"."... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_shared_array | Creates and array that can be used with an HDF5 array object | pypet/storageservice.py | def _prm_write_shared_array(self, key, data, hdf5_group, full_name, flag, **kwargs):
"""Creates and array that can be used with an HDF5 array object"""
if flag == HDF5StorageService.ARRAY:
self._prm_write_into_array(key, data, hdf5_group, full_name, **kwargs)
elif flag in (HDF5Stora... | def _prm_write_shared_array(self, key, data, hdf5_group, full_name, flag, **kwargs):
"""Creates and array that can be used with an HDF5 array object"""
if flag == HDF5StorageService.ARRAY:
self._prm_write_into_array(key, data, hdf5_group, full_name, **kwargs)
elif flag in (HDF5Stora... | [
"Creates",
"and",
"array",
"that",
"can",
"be",
"used",
"with",
"an",
"HDF5",
"array",
"object"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4059-L4073 | [
"def",
"_prm_write_shared_array",
"(",
"self",
",",
"key",
",",
"data",
",",
"hdf5_group",
",",
"full_name",
",",
"flag",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"flag",
"==",
"HDF5StorageService",
".",
"ARRAY",
":",
"self",
".",
"_prm_write_into_array",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_shared_table | Creates a new empty table | pypet/storageservice.py | def _prm_write_shared_table(self, key, hdf5_group, fullname, **kwargs):
"""Creates a new empty table"""
first_row = None
description = None
if 'first_row' in kwargs:
first_row = kwargs.pop('first_row')
if not 'description' in kwargs:
description = ... | def _prm_write_shared_table(self, key, hdf5_group, fullname, **kwargs):
"""Creates a new empty table"""
first_row = None
description = None
if 'first_row' in kwargs:
first_row = kwargs.pop('first_row')
if not 'description' in kwargs:
description = ... | [
"Creates",
"a",
"new",
"empty",
"table"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4075-L4108 | [
"def",
"_prm_write_shared_table",
"(",
"self",
",",
"key",
",",
"hdf5_group",
",",
"fullname",
",",
"*",
"*",
"kwargs",
")",
":",
"first_row",
"=",
"None",
"description",
"=",
"None",
"if",
"'first_row'",
"in",
"kwargs",
":",
"first_row",
"=",
"kwargs",
".... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_dict_as_table | Stores a python dictionary as pytable
:param key:
Name of data item to store
:param data_to_store:
Dictionary to store
:param group:
Group node where to store data in hdf5 file
:param fullname:
Full name of the `data_to_store`s orig... | pypet/storageservice.py | def _prm_write_dict_as_table(self, key, data_to_store, group, fullname, **kwargs):
"""Stores a python dictionary as pytable
:param key:
Name of data item to store
:param data_to_store:
Dictionary to store
:param group:
Group node where to store d... | def _prm_write_dict_as_table(self, key, data_to_store, group, fullname, **kwargs):
"""Stores a python dictionary as pytable
:param key:
Name of data item to store
:param data_to_store:
Dictionary to store
:param group:
Group node where to store d... | [
"Stores",
"a",
"python",
"dictionary",
"as",
"pytable"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4110-L4157 | [
"def",
"_prm_write_dict_as_table",
"(",
"self",
",",
"key",
",",
"data_to_store",
",",
"group",
",",
"fullname",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"key",
"in",
"group",
":",
"raise",
"ValueError",
"(",
"'Dictionary `%s` already exists in `%s`. Appending is ... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_pandas_data | Stores a pandas DataFrame into hdf5.
:param key:
Name of data item to store
:param data:
Pandas Data to Store
:param group:
Group node where to store data in hdf5 file
:param fullname:
Full name of the `data_to_store`s original cont... | pypet/storageservice.py | def _prm_write_pandas_data(self, key, data, group, fullname, flag, **kwargs):
"""Stores a pandas DataFrame into hdf5.
:param key:
Name of data item to store
:param data:
Pandas Data to Store
:param group:
Group node where to store data in hdf5 fi... | def _prm_write_pandas_data(self, key, data, group, fullname, flag, **kwargs):
"""Stores a pandas DataFrame into hdf5.
:param key:
Name of data item to store
:param data:
Pandas Data to Store
:param group:
Group node where to store data in hdf5 fi... | [
"Stores",
"a",
"pandas",
"DataFrame",
"into",
"hdf5",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4159-L4215 | [
"def",
"_prm_write_pandas_data",
"(",
"self",
",",
"key",
",",
"data",
",",
"group",
",",
"fullname",
",",
"flag",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"'filters'",
"not",
"in",
"kwargs",
":",
"filters",
"=",
"self",
".",
"_all_get_filt... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_into_other_array | Stores data as carray, earray or vlarray depending on `flag`.
:param key:
Name of data item to store
:param data:
Data to store
:param group:
Group node where to store data in hdf5 file
:param fullname:
Full name of the `data_to_sto... | pypet/storageservice.py | def _prm_write_into_other_array(self, key, data, group, fullname,
flag, **kwargs):
"""Stores data as carray, earray or vlarray depending on `flag`.
:param key:
Name of data item to store
:param data:
Data to store
:param gr... | def _prm_write_into_other_array(self, key, data, group, fullname,
flag, **kwargs):
"""Stores data as carray, earray or vlarray depending on `flag`.
:param key:
Name of data item to store
:param data:
Data to store
:param gr... | [
"Stores",
"data",
"as",
"carray",
"earray",
"or",
"vlarray",
"depending",
"on",
"flag",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4217-L4289 | [
"def",
"_prm_write_into_other_array",
"(",
"self",
",",
"key",
",",
"data",
",",
"group",
",",
"fullname",
",",
"flag",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"flag",
"==",
"HDF5StorageService",
".",
"CARRAY",
":",
"factory",
"=",
"self",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_into_array | Stores data as array.
:param key:
Name of data item to store
:param data:
Data to store
:param group:
Group node where to store data in hdf5 file
:param fullname:
Full name of the `data_to_store`s original container, only needed for... | pypet/storageservice.py | def _prm_write_into_array(self, key, data, group, fullname, **kwargs):
"""Stores data as array.
:param key:
Name of data item to store
:param data:
Data to store
:param group:
Group node where to store data in hdf5 file
:param fullname:
... | def _prm_write_into_array(self, key, data, group, fullname, **kwargs):
"""Stores data as array.
:param key:
Name of data item to store
:param data:
Data to store
:param group:
Group node where to store data in hdf5 file
:param fullname:
... | [
"Stores",
"data",
"as",
"array",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4291-L4354 | [
"def",
"_prm_write_into_array",
"(",
"self",
",",
"key",
",",
"data",
",",
"group",
",",
"fullname",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"if",
"key",
"in",
"group",
":",
"raise",
"ValueError",
"(",
"'Array `%s` already exists in `%s`. Appending is n... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._lnk_delete_link | Removes a link from disk | pypet/storageservice.py | def _lnk_delete_link(self, link_name):
"""Removes a link from disk"""
translated_name = '/' + self._trajectory_name + '/' + link_name.replace('.','/')
link = self._hdf5file.get_node(where=translated_name)
link._f_remove() | def _lnk_delete_link(self, link_name):
"""Removes a link from disk"""
translated_name = '/' + self._trajectory_name + '/' + link_name.replace('.','/')
link = self._hdf5file.get_node(where=translated_name)
link._f_remove() | [
"Removes",
"a",
"link",
"from",
"disk"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4356-L4360 | [
"def",
"_lnk_delete_link",
"(",
"self",
",",
"link_name",
")",
":",
"translated_name",
"=",
"'/'",
"+",
"self",
".",
"_trajectory_name",
"+",
"'/'",
"+",
"link_name",
".",
"replace",
"(",
"'.'",
",",
"'/'",
")",
"link",
"=",
"self",
".",
"_hdf5file",
"."... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_delete_parameter_or_result_or_group | Removes a parameter or result or group from the hdf5 file.
:param instance: Instance to be removed
:param delete_only:
List of elements if you only want to delete parts of a leaf node. Note that this
needs to list the names of the hdf5 subnodes. BE CAREFUL if you erase parts o... | pypet/storageservice.py | def _all_delete_parameter_or_result_or_group(self, instance,
delete_only=None,
remove_from_item=False,
recursive=False,
_hdf... | def _all_delete_parameter_or_result_or_group(self, instance,
delete_only=None,
remove_from_item=False,
recursive=False,
_hdf... | [
"Removes",
"a",
"parameter",
"or",
"result",
"or",
"group",
"from",
"the",
"hdf5",
"file",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4362-L4420 | [
"def",
"_all_delete_parameter_or_result_or_group",
"(",
"self",
",",
"instance",
",",
"delete_only",
"=",
"None",
",",
"remove_from_item",
"=",
"False",
",",
"recursive",
"=",
"False",
",",
"_hdf5_group",
"=",
"None",
")",
":",
"split_name",
"=",
"instance",
"."... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_write_into_pytable | Stores data as pytable.
:param tablename:
Name of the data table
:param data:
Data to store
:param hdf5_group:
Group node where to store data in hdf5 file
:param fullname:
Full name of the `data_to_store`s original container, only n... | pypet/storageservice.py | def _prm_write_into_pytable(self, tablename, data, hdf5_group, fullname, **kwargs):
"""Stores data as pytable.
:param tablename:
Name of the data table
:param data:
Data to store
:param hdf5_group:
Group node where to store data in hdf5 file
... | def _prm_write_into_pytable(self, tablename, data, hdf5_group, fullname, **kwargs):
"""Stores data as pytable.
:param tablename:
Name of the data table
:param data:
Data to store
:param hdf5_group:
Group node where to store data in hdf5 file
... | [
"Stores",
"data",
"as",
"pytable",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4422-L4542 | [
"def",
"_prm_write_into_pytable",
"(",
"self",
",",
"tablename",
",",
"data",
",",
"hdf5_group",
",",
"fullname",
",",
"*",
"*",
"kwargs",
")",
":",
"datasize",
"=",
"data",
".",
"shape",
"[",
"0",
"]",
"try",
":",
"# Get a new pytables description from the da... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_make_description | Returns a description dictionary for pytables table creation | pypet/storageservice.py | def _prm_make_description(self, data, fullname):
""" Returns a description dictionary for pytables table creation"""
def _convert_lists_and_tuples(series_of_data):
"""Converts lists and tuples to numpy arrays"""
if isinstance(series_of_data[0],
(list, t... | def _prm_make_description(self, data, fullname):
""" Returns a description dictionary for pytables table creation"""
def _convert_lists_and_tuples(series_of_data):
"""Converts lists and tuples to numpy arrays"""
if isinstance(series_of_data[0],
(list, t... | [
"Returns",
"a",
"description",
"dictionary",
"for",
"pytables",
"table",
"creation"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4544-L4575 | [
"def",
"_prm_make_description",
"(",
"self",
",",
"data",
",",
"fullname",
")",
":",
"def",
"_convert_lists_and_tuples",
"(",
"series_of_data",
")",
":",
"\"\"\"Converts lists and tuples to numpy arrays\"\"\"",
"if",
"isinstance",
"(",
"series_of_data",
"[",
"0",
"]",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._all_get_table_col | Creates a pytables column instance.
The type of column depends on the type of `column[0]`.
Note that data in `column` must be homogeneous! | pypet/storageservice.py | def _all_get_table_col(self, key, column, fullname):
""" Creates a pytables column instance.
The type of column depends on the type of `column[0]`.
Note that data in `column` must be homogeneous!
"""
val = column[0]
try:
# # We do not want to loose int_
... | def _all_get_table_col(self, key, column, fullname):
""" Creates a pytables column instance.
The type of column depends on the type of `column[0]`.
Note that data in `column` must be homogeneous!
"""
val = column[0]
try:
# # We do not want to loose int_
... | [
"Creates",
"a",
"pytables",
"column",
"instance",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4577-L4608 | [
"def",
"_all_get_table_col",
"(",
"self",
",",
"key",
",",
"column",
",",
"fullname",
")",
":",
"val",
"=",
"column",
"[",
"0",
"]",
"try",
":",
"# # We do not want to loose int_",
"if",
"type",
"(",
"val",
")",
"is",
"int",
":",
"return",
"pt",
".",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_get_longest_stringsize | Returns the longest string size for a string entry across data. | pypet/storageservice.py | def _prm_get_longest_stringsize(string_list):
""" Returns the longest string size for a string entry across data."""
maxlength = 1
for stringar in string_list:
if isinstance(stringar, np.ndarray):
if stringar.ndim > 0:
for string in stringar.ravel... | def _prm_get_longest_stringsize(string_list):
""" Returns the longest string size for a string entry across data."""
maxlength = 1
for stringar in string_list:
if isinstance(stringar, np.ndarray):
if stringar.ndim > 0:
for string in stringar.ravel... | [
"Returns",
"the",
"longest",
"string",
"size",
"for",
"a",
"string",
"entry",
"across",
"data",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4611-L4626 | [
"def",
"_prm_get_longest_stringsize",
"(",
"string_list",
")",
":",
"maxlength",
"=",
"1",
"for",
"stringar",
"in",
"string_list",
":",
"if",
"isinstance",
"(",
"stringar",
",",
"np",
".",
"ndarray",
")",
":",
"if",
"stringar",
".",
"ndim",
">",
"0",
":",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_load_into_dict | Loads into dictionary | pypet/storageservice.py | def _prm_load_into_dict(self, full_name, load_dict, hdf5_group, instance,
load_only, load_except, load_flags, _prefix = ''):
"""Loads into dictionary"""
for node in hdf5_group:
load_type = self._all_get_from_attrs(node, HDF5StorageService.STORAGE_TYPE)
... | def _prm_load_into_dict(self, full_name, load_dict, hdf5_group, instance,
load_only, load_except, load_flags, _prefix = ''):
"""Loads into dictionary"""
for node in hdf5_group:
load_type = self._all_get_from_attrs(node, HDF5StorageService.STORAGE_TYPE)
... | [
"Loads",
"into",
"dictionary"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4628-L4689 | [
"def",
"_prm_load_into_dict",
"(",
"self",
",",
"full_name",
",",
"load_dict",
",",
"hdf5_group",
",",
"instance",
",",
"load_only",
",",
"load_except",
",",
"load_flags",
",",
"_prefix",
"=",
"''",
")",
":",
"for",
"node",
"in",
"hdf5_group",
":",
"load_typ... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_load_parameter_or_result | Loads a parameter or result from disk.
:param instance:
Empty parameter or result instance
:param load_data:
How to load stuff
:param load_only:
List of data keys if only parts of a result should be loaded
:param load_except:
List o... | pypet/storageservice.py | def _prm_load_parameter_or_result(self, instance,
load_data=pypetconstants.LOAD_DATA,
load_only=None,
load_except=None,
load_flags=None,
... | def _prm_load_parameter_or_result(self, instance,
load_data=pypetconstants.LOAD_DATA,
load_only=None,
load_except=None,
load_flags=None,
... | [
"Loads",
"a",
"parameter",
"or",
"result",
"from",
"disk",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4691-L4846 | [
"def",
"_prm_load_parameter_or_result",
"(",
"self",
",",
"instance",
",",
"load_data",
"=",
"pypetconstants",
".",
"LOAD_DATA",
",",
"load_only",
"=",
"None",
",",
"load_except",
"=",
"None",
",",
"load_flags",
"=",
"None",
",",
"with_links",
"=",
"False",
",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_read_dictionary | Loads data that was originally a dictionary when stored
:param leaf:
PyTables table containing the dictionary data
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to be loaded | pypet/storageservice.py | def _prm_read_dictionary(self, leaf, full_name):
"""Loads data that was originally a dictionary when stored
:param leaf:
PyTables table containing the dictionary data
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
... | def _prm_read_dictionary(self, leaf, full_name):
"""Loads data that was originally a dictionary when stored
:param leaf:
PyTables table containing the dictionary data
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
... | [
"Loads",
"data",
"that",
"was",
"originally",
"a",
"dictionary",
"when",
"stored"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4848-L4879 | [
"def",
"_prm_read_dictionary",
"(",
"self",
",",
"leaf",
",",
"full_name",
")",
":",
"try",
":",
"# Load as Pbject Table",
"temp_table",
"=",
"self",
".",
"_prm_read_table",
"(",
"leaf",
",",
"full_name",
")",
"# Turn the ObjectTable into a dictionary of lists (with len... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_read_shared_data | Reads shared data and constructs the appropraite class.
:param shared_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load | pypet/storageservice.py | def _prm_read_shared_data(self, shared_node, instance):
"""Reads shared data and constructs the appropraite class.
:param shared_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:re... | def _prm_read_shared_data(self, shared_node, instance):
"""Reads shared data and constructs the appropraite class.
:param shared_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:re... | [
"Reads",
"shared",
"data",
"and",
"constructs",
"the",
"appropraite",
"class",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4881-L4907 | [
"def",
"_prm_read_shared_data",
"(",
"self",
",",
"shared_node",
",",
"instance",
")",
":",
"try",
":",
"data_type",
"=",
"self",
".",
"_all_get_from_attrs",
"(",
"shared_node",
",",
"HDF5StorageService",
".",
"SHARED_DATA_TYPE",
")",
"constructor",
"=",
"shared",... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_read_pandas | Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load | pypet/storageservice.py | def _prm_read_pandas(self, pd_node, full_name):
"""Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load
... | def _prm_read_pandas(self, pd_node, full_name):
"""Reads a DataFrame from dis.
:param pd_node:
hdf5 node storing the pandas DataFrame
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load
... | [
"Reads",
"a",
"DataFrame",
"from",
"dis",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4909-L4933 | [
"def",
"_prm_read_pandas",
"(",
"self",
",",
"pd_node",
",",
"full_name",
")",
":",
"try",
":",
"name",
"=",
"pd_node",
".",
"_v_name",
"pathname",
"=",
"pd_node",
".",
"_v_pathname",
"pandas_store",
"=",
"self",
".",
"_hdf5store",
"pandas_data",
"=",
"panda... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_read_table | Reads a non-nested PyTables table column by column and created a new ObjectTable for
the loaded data.
:param table_or_group:
PyTables table to read from or a group containing subtables.
:param full_name:
Full name of the parameter or result whose data is to be loaded
... | pypet/storageservice.py | def _prm_read_table(self, table_or_group, full_name):
"""Reads a non-nested PyTables table column by column and created a new ObjectTable for
the loaded data.
:param table_or_group:
PyTables table to read from or a group containing subtables.
:param full_name:
... | def _prm_read_table(self, table_or_group, full_name):
"""Reads a non-nested PyTables table column by column and created a new ObjectTable for
the loaded data.
:param table_or_group:
PyTables table to read from or a group containing subtables.
:param full_name:
... | [
"Reads",
"a",
"non",
"-",
"nested",
"PyTables",
"table",
"column",
"by",
"column",
"and",
"created",
"a",
"new",
"ObjectTable",
"for",
"the",
"loaded",
"data",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L4935-L5023 | [
"def",
"_prm_read_table",
"(",
"self",
",",
"table_or_group",
",",
"full_name",
")",
":",
"try",
":",
"result_table",
"=",
"None",
"if",
"self",
".",
"_all_get_from_attrs",
"(",
"table_or_group",
",",
"HDF5StorageService",
".",
"SPLIT_TABLE",
")",
":",
"table_na... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | HDF5StorageService._prm_read_array | Reads data from an array or carray
:param array:
PyTables array or carray to read from
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load | pypet/storageservice.py | def _prm_read_array(self, array, full_name):
"""Reads data from an array or carray
:param array:
PyTables array or carray to read from
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load
... | def _prm_read_array(self, array, full_name):
"""Reads data from an array or carray
:param array:
PyTables array or carray to read from
:param full_name:
Full name of the parameter or result whose data is to be loaded
:return:
Data to load
... | [
"Reads",
"data",
"from",
"an",
"array",
"or",
"carray"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/storageservice.py#L5044-L5069 | [
"def",
"_prm_read_array",
"(",
"self",
",",
"array",
",",
"full_name",
")",
":",
"try",
":",
"result",
"=",
"self",
".",
"_svrc_read_array",
"(",
"array",
")",
"# Recall original data types",
"result",
",",
"dummy",
"=",
"self",
".",
"_all_recall_native_type",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | load_trajectory | Helper function that creates a novel trajectory and loads it from disk.
For the parameters see :func:`~pypet.trajectory.Trajectory.f_load`.
``new_name`` and ``add_time`` are only used in case ``as_new`` is ``True``.
Accordingly, they determine the new name of trajectory. | pypet/trajectory.py | def load_trajectory(name=None,
index=None,
as_new=False,
load_parameters=pypetconstants.LOAD_DATA,
load_derived_parameters=pypetconstants.LOAD_SKELETON,
load_results=pypetconstants.LOAD_SKELETON,
load... | def load_trajectory(name=None,
index=None,
as_new=False,
load_parameters=pypetconstants.LOAD_DATA,
load_derived_parameters=pypetconstants.LOAD_SKELETON,
load_results=pypetconstants.LOAD_SKELETON,
load... | [
"Helper",
"function",
"that",
"creates",
"a",
"novel",
"trajectory",
"and",
"loads",
"it",
"from",
"disk",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L34-L72 | [
"def",
"load_trajectory",
"(",
"name",
"=",
"None",
",",
"index",
"=",
"None",
",",
"as_new",
"=",
"False",
",",
"load_parameters",
"=",
"pypetconstants",
".",
"LOAD_DATA",
",",
"load_derived_parameters",
"=",
"pypetconstants",
".",
"LOAD_SKELETON",
",",
"load_r... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | make_set_name | Creates a run set name based on ``idx`` | pypet/trajectory.py | def make_set_name(idx):
"""Creates a run set name based on ``idx``"""
GROUPSIZE = 1000
set_idx = idx // GROUPSIZE
if set_idx >= 0:
return pypetconstants.FORMATTED_SET_NAME % set_idx
else:
return pypetconstants.SET_NAME_DUMMY | def make_set_name(idx):
"""Creates a run set name based on ``idx``"""
GROUPSIZE = 1000
set_idx = idx // GROUPSIZE
if set_idx >= 0:
return pypetconstants.FORMATTED_SET_NAME % set_idx
else:
return pypetconstants.SET_NAME_DUMMY | [
"Creates",
"a",
"run",
"set",
"name",
"based",
"on",
"idx"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L83-L90 | [
"def",
"make_set_name",
"(",
"idx",
")",
":",
"GROUPSIZE",
"=",
"1000",
"set_idx",
"=",
"idx",
"//",
"GROUPSIZE",
"if",
"set_idx",
">=",
"0",
":",
"return",
"pypetconstants",
".",
"FORMATTED_SET_NAME",
"%",
"set_idx",
"else",
":",
"return",
"pypetconstants",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_add_wildcard_functions | #TODO | pypet/trajectory.py | def f_add_wildcard_functions(self, func_dict):
"""#TODO"""
for wildcards, function in func_dict.items():
if not isinstance(wildcards, tuple):
wildcards = (wildcards,)
for wildcard in wildcards:
if wildcard in self._wildcard_keys:
... | def f_add_wildcard_functions(self, func_dict):
"""#TODO"""
for wildcards, function in func_dict.items():
if not isinstance(wildcards, tuple):
wildcards = (wildcards,)
for wildcard in wildcards:
if wildcard in self._wildcard_keys:
... | [
"#TODO"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L356-L366 | [
"def",
"f_add_wildcard_functions",
"(",
"self",
",",
"func_dict",
")",
":",
"for",
"wildcards",
",",
"function",
"in",
"func_dict",
".",
"items",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"wildcards",
",",
"tuple",
")",
":",
"wildcards",
"=",
"(",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_wildcard | #TODO | pypet/trajectory.py | def f_wildcard(self, wildcard='$', run_idx=None):
"""#TODO"""
if run_idx is None:
run_idx = self.v_idx
wildcards = self._wildcard_keys[wildcard]
try:
return self._wildcard_cache[(wildcards, run_idx)]
except KeyError:
translation = self._wildcar... | def f_wildcard(self, wildcard='$', run_idx=None):
"""#TODO"""
if run_idx is None:
run_idx = self.v_idx
wildcards = self._wildcard_keys[wildcard]
try:
return self._wildcard_cache[(wildcards, run_idx)]
except KeyError:
translation = self._wildcar... | [
"#TODO"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L368-L378 | [
"def",
"f_wildcard",
"(",
"self",
",",
"wildcard",
"=",
"'$'",
",",
"run_idx",
"=",
"None",
")",
":",
"if",
"run_idx",
"is",
"None",
":",
"run_idx",
"=",
"self",
".",
"v_idx",
"wildcards",
"=",
"self",
".",
"_wildcard_keys",
"[",
"wildcard",
"]",
"try"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.v_full_copy | Sets full copy mode of trajectory and (!) ALL explored parameters! | pypet/trajectory.py | def v_full_copy(self, val):
""" Sets full copy mode of trajectory and (!) ALL explored parameters!"""
self._full_copy = bool(val)
for param in self._explored_parameters.values():
if param is not None:
param.v_full_copy = bool(val) | def v_full_copy(self, val):
""" Sets full copy mode of trajectory and (!) ALL explored parameters!"""
self._full_copy = bool(val)
for param in self._explored_parameters.values():
if param is not None:
param.v_full_copy = bool(val) | [
"Sets",
"full",
"copy",
"mode",
"of",
"trajectory",
"and",
"(",
"!",
")",
"ALL",
"explored",
"parameters!"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L526-L531 | [
"def",
"v_full_copy",
"(",
"self",
",",
"val",
")",
":",
"self",
".",
"_full_copy",
"=",
"bool",
"(",
"val",
")",
"for",
"param",
"in",
"self",
".",
"_explored_parameters",
".",
"values",
"(",
")",
":",
"if",
"param",
"is",
"not",
"None",
":",
"param... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_set_properties | Sets properties like ``v_fast_access``.
For example: ``traj.f_set_properties(v_fast_access=True, v_auto_load=False)`` | pypet/trajectory.py | def f_set_properties(self, **kwargs):
"""Sets properties like ``v_fast_access``.
For example: ``traj.f_set_properties(v_fast_access=True, v_auto_load=False)``
"""
for name in kwargs:
val = kwargs[name]
if not name.startswith('v_'):
name = 'v_' + ... | def f_set_properties(self, **kwargs):
"""Sets properties like ``v_fast_access``.
For example: ``traj.f_set_properties(v_fast_access=True, v_auto_load=False)``
"""
for name in kwargs:
val = kwargs[name]
if not name.startswith('v_'):
name = 'v_' + ... | [
"Sets",
"properties",
"like",
"v_fast_access",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L544-L557 | [
"def",
"f_set_properties",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"name",
"in",
"kwargs",
":",
"val",
"=",
"kwargs",
"[",
"name",
"]",
"if",
"not",
"name",
".",
"startswith",
"(",
"'v_'",
")",
":",
"name",
"=",
"'v_'",
"+",
"name",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_add_to_dynamic_imports | Adds classes or paths to classes to the trajectory to create custom parameters.
:param dynamic_imports:
If you've written custom parameter that needs to be loaded dynamically during runtime,
this needs to be specified here as a list of classes or strings naming classes
and ... | pypet/trajectory.py | def f_add_to_dynamic_imports(self, dynamic_imports):
"""Adds classes or paths to classes to the trajectory to create custom parameters.
:param dynamic_imports:
If you've written custom parameter that needs to be loaded dynamically during runtime,
this needs to be specified here... | def f_add_to_dynamic_imports(self, dynamic_imports):
"""Adds classes or paths to classes to the trajectory to create custom parameters.
:param dynamic_imports:
If you've written custom parameter that needs to be loaded dynamically during runtime,
this needs to be specified here... | [
"Adds",
"classes",
"or",
"paths",
"to",
"classes",
"to",
"the",
"trajectory",
"to",
"create",
"custom",
"parameters",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L560-L583 | [
"def",
"f_add_to_dynamic_imports",
"(",
"self",
",",
"dynamic_imports",
")",
":",
"if",
"not",
"isinstance",
"(",
"dynamic_imports",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"dynamic_imports",
"=",
"[",
"dynamic_imports",
"]",
"for",
"item",
"in",
"dyn... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_set_crun | Can make the trajectory behave as during a particular single run.
It allows easier data analysis.
Has the following effects:
*
`v_idx` and `v_crun` are set to the appropriate index and run name
*
All explored parameters are set to the corresponding value in t... | pypet/trajectory.py | def f_set_crun(self, name_or_idx):
"""Can make the trajectory behave as during a particular single run.
It allows easier data analysis.
Has the following effects:
*
`v_idx` and `v_crun` are set to the appropriate index and run name
*
All explored para... | def f_set_crun(self, name_or_idx):
"""Can make the trajectory behave as during a particular single run.
It allows easier data analysis.
Has the following effects:
*
`v_idx` and `v_crun` are set to the appropriate index and run name
*
All explored para... | [
"Can",
"make",
"the",
"trajectory",
"behave",
"as",
"during",
"a",
"particular",
"single",
"run",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L586-L623 | [
"def",
"f_set_crun",
"(",
"self",
",",
"name_or_idx",
")",
":",
"if",
"(",
"name_or_idx",
"is",
"None",
"or",
"name_or_idx",
"==",
"self",
".",
"f_wildcard",
"(",
"'$'",
",",
"-",
"1",
")",
"or",
"name_or_idx",
"==",
"-",
"1",
")",
":",
"self",
".",
... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_iter_runs | Makes the trajectory iterate over all runs.
:param start: Start index of run
:param stop: Stop index, leave ``None`` for length of trajectory
:param step: Stepsize
:param yields:
What should be yielded: ``'name'`` of run, ``idx`` of run
or ``'self'`` to simpl... | pypet/trajectory.py | def f_iter_runs(self, start=0, stop=None, step=1, yields='name'):
"""Makes the trajectory iterate over all runs.
:param start: Start index of run
:param stop: Stop index, leave ``None`` for length of trajectory
:param step: Stepsize
:param yields:
What should be ... | def f_iter_runs(self, start=0, stop=None, step=1, yields='name'):
"""Makes the trajectory iterate over all runs.
:param start: Start index of run
:param stop: Stop index, leave ``None`` for length of trajectory
:param step: Stepsize
:param yields:
What should be ... | [
"Makes",
"the",
"trajectory",
"iterate",
"over",
"all",
"runs",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L626-L693 | [
"def",
"f_iter_runs",
"(",
"self",
",",
"start",
"=",
"0",
",",
"stop",
"=",
"None",
",",
"step",
"=",
"1",
",",
"yields",
"=",
"'name'",
")",
":",
"if",
"stop",
"is",
"None",
":",
"stop",
"=",
"len",
"(",
"self",
")",
"elif",
"stop",
">",
"len... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_shrink | Shrinks the trajectory and removes all exploration ranges from the parameters.
Only possible if the trajectory has not been stored to disk before or was loaded as new.
:param force:
Usually you cannot shrink the trajectory if it has been stored to disk,
because there's no guara... | pypet/trajectory.py | def f_shrink(self, force=False):
""" Shrinks the trajectory and removes all exploration ranges from the parameters.
Only possible if the trajectory has not been stored to disk before or was loaded as new.
:param force:
Usually you cannot shrink the trajectory if it has been stored ... | def f_shrink(self, force=False):
""" Shrinks the trajectory and removes all exploration ranges from the parameters.
Only possible if the trajectory has not been stored to disk before or was loaded as new.
:param force:
Usually you cannot shrink the trajectory if it has been stored ... | [
"Shrinks",
"the",
"trajectory",
"and",
"removes",
"all",
"exploration",
"ranges",
"from",
"the",
"parameters",
".",
"Only",
"possible",
"if",
"the",
"trajectory",
"has",
"not",
"been",
"stored",
"to",
"disk",
"before",
"or",
"was",
"loaded",
"as",
"new",
"."... | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L696-L729 | [
"def",
"f_shrink",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"if",
"self",
".",
"_stored",
"and",
"not",
"force",
":",
"raise",
"TypeError",
"(",
"'Your trajectory is already stored to disk or database, shrinking is '",
"'not allowed.'",
")",
"for",
"param"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory._preset | Generic preset function, marks a parameter or config for presetting. | pypet/trajectory.py | def _preset(self, name, args, kwargs):
"""Generic preset function, marks a parameter or config for presetting."""
if self.f_contains(name, shortcuts=False):
raise ValueError('Parameter `%s` is already part of your trajectory, use the normal'
'accessing routine to... | def _preset(self, name, args, kwargs):
"""Generic preset function, marks a parameter or config for presetting."""
if self.f_contains(name, shortcuts=False):
raise ValueError('Parameter `%s` is already part of your trajectory, use the normal'
'accessing routine to... | [
"Generic",
"preset",
"function",
"marks",
"a",
"parameter",
"or",
"config",
"for",
"presetting",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L731-L737 | [
"def",
"_preset",
"(",
"self",
",",
"name",
",",
"args",
",",
"kwargs",
")",
":",
"if",
"self",
".",
"f_contains",
"(",
"name",
",",
"shortcuts",
"=",
"False",
")",
":",
"raise",
"ValueError",
"(",
"'Parameter `%s` is already part of your trajectory, use the nor... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_preset_config | Similar to func:`~pypet.trajectory.Trajectory.f_preset_parameter` | pypet/trajectory.py | def f_preset_config(self, config_name, *args, **kwargs):
"""Similar to func:`~pypet.trajectory.Trajectory.f_preset_parameter`"""
if not config_name.startswith('config.'):
config_name = 'config.' + config_name
self._preset(config_name, args, kwargs) | def f_preset_config(self, config_name, *args, **kwargs):
"""Similar to func:`~pypet.trajectory.Trajectory.f_preset_parameter`"""
if not config_name.startswith('config.'):
config_name = 'config.' + config_name
self._preset(config_name, args, kwargs) | [
"Similar",
"to",
"func",
":",
"~pypet",
".",
"trajectory",
".",
"Trajectory",
".",
"f_preset_parameter"
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L740-L746 | [
"def",
"f_preset_config",
"(",
"self",
",",
"config_name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"config_name",
".",
"startswith",
"(",
"'config.'",
")",
":",
"config_name",
"=",
"'config.'",
"+",
"config_name",
"self",
".",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
test | Trajectory.f_preset_parameter | Presets parameter value before a parameter is added.
Can be called before parameters are added to the Trajectory in order to change the
values that are stored into the parameter on creation.
After creation of a parameter, the instance of the parameter is called
with `param.f_set(*args,... | pypet/trajectory.py | def f_preset_parameter(self, param_name, *args, **kwargs):
"""Presets parameter value before a parameter is added.
Can be called before parameters are added to the Trajectory in order to change the
values that are stored into the parameter on creation.
After creation of a parameter, th... | def f_preset_parameter(self, param_name, *args, **kwargs):
"""Presets parameter value before a parameter is added.
Can be called before parameters are added to the Trajectory in order to change the
values that are stored into the parameter on creation.
After creation of a parameter, th... | [
"Presets",
"parameter",
"value",
"before",
"a",
"parameter",
"is",
"added",
"."
] | SmokinCaterpillar/pypet | python | https://github.com/SmokinCaterpillar/pypet/blob/97ad3e80d46dbdea02deeb98ea41f05a19565826/pypet/trajectory.py#L749-L786 | [
"def",
"f_preset_parameter",
"(",
"self",
",",
"param_name",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"param_name",
".",
"startswith",
"(",
"'parameters.'",
")",
":",
"param_name",
"=",
"'parameters.'",
"+",
"param_name",
"self",
"... | 97ad3e80d46dbdea02deeb98ea41f05a19565826 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.