collection
¶
Module Contents¶
Classes¶
Attributes¶
-
class
ListDataStruct_Interface
[source]¶ Bases:
DataStruct_Interface
-
class
AutosaveStruct
(dataStruct, filename='', change_filename_if_exists=True)[source]¶ Structure that provides automated save of DataStructures
-
class
ListDataStruct
(compress_save=False)[source]¶ Bases:
ListDataStruct_Interface
-
save
(filename)[source]¶ Save data using json format. The data to be saved are automatically detected, see
obj_to_json()
-
extract_collection_from_indices
(indices)[source]¶ Extract data from the collection at specific indices, and return it as new collection
-
_format_str_save
()[source]¶ Save data using json format. The data to be saved are automatically detected, see
obj_to_json()
-
extract_collection_from_attribute
(attributeName)[source]¶ Convenience class to create a sub-collection from an attribute of all the items.
Parameters: attributeName – Name of the attribute to extract Returns: ListDataStruct
-
delete_points_at_indices
(indices)[source]¶ Delete several elements from the Collection
Parameters: indices – list of indices to delete
-
-
theLock
¶
-
class
Performance_ListDataStruct
(stack_size=500)[source]¶ Bases:
ListDataStruct_Interface
-
extract_collection_from_indices
(indices)[source]¶ Extract data from the collection at specific indices, and return it as new collection
-
_get_json_str_at_index
(index, refresh_cache=False)[source]¶ Internal method to return the json string at index
-
get_attribute_value_at_index_fast
(attribute, index)[source]¶ Experimental method to extract the value of an attribute without converting the string to an object. It is based on regex search, and will fail if the element is the last in string.
Parameters: - attribute – attribute to search
- index – index of the element in collection
Returns:
-
reorder
(permutations)[source]¶ Reorder collection accordingly to permutations. E.G, permutations [0,2,1] with collection elems [0,3,2] => collection elems = [0,2,3] :param permutations: :return: /
-
get_data_at_index
(index, ignore_attributes=None, none_if_error=False)[source]¶ Same as parent, with additional kwargs
Parameters: - index –
- ignore_attributes – ignore attributes to deserialize (list)
- none_if_error –
Returns:
-