tts-data-utils 0.7.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tts_data_utils/__init__.py +0 -0
- tts_data_utils/core/__init__.py +0 -0
- tts_data_utils/core/container_history.py +79 -0
- tts_data_utils/core/data_container.py +2102 -0
- tts_data_utils/core/data_item.py +487 -0
- tts_data_utils/core/diff.py +155 -0
- tts_data_utils/core/generic.py +78 -0
- tts_data_utils/core/lorem_utils.py +206 -0
- tts_data_utils/core/visual_diff.py +148 -0
- tts_data_utils/invulnerable_data_manager/__init__.py +0 -0
- tts_data_utils/invulnerable_data_manager/batch.py +176 -0
- tts_data_utils/invulnerable_data_manager/invulnerable_data_manager.py +171 -0
- tts_data_utils/invulnerable_data_manager/utilities.py +151 -0
- tts_data_utils/multimission/__init__.py +0 -0
- tts_data_utils/multimission/alarms.py +109 -0
- tts_data_utils/multimission/eha.py +253 -0
- tts_data_utils/multimission/evr.py +340 -0
- tts_data_utils/multimission/evr_gaps.py +148 -0
- tts_data_utils/multimission/expected_lad.py +161 -0
- tts_data_utils/multimission/planning_rule.py +106 -0
- tts_data_utils/multimission/taco.py +53 -0
- tts_data_utils/test/__init__.py +0 -0
- tts_data_utils/test/core/__init__.py +0 -0
- tts_data_utils/test/core/test_data_container.py +403 -0
- tts_data_utils/test/core/test_data_item.py +92 -0
- tts_data_utils/test/core/test_diff.py +173 -0
- tts_data_utils/test/core/test_files/diff/diff_dict/actual_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_dict/expected_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_dict/left.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_dict/right.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_list/actual_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_list/expected_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_list/left.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_list/right.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_list_size/actual_diff.csv +33 -0
- tts_data_utils/test/core/test_files/diff/diff_list_size/expected_diff.csv +33 -0
- tts_data_utils/test/core/test_files/diff/diff_list_size/left.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_list_size/right.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_simple_types/actual_diff.csv +17894 -0
- tts_data_utils/test/core/test_files/diff/diff_simple_types/expected_diff.csv +17894 -0
- tts_data_utils/test/core/test_files/diff/diff_simple_types/left.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_simple_types/right.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_type/actual_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_type/expected_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/diff/diff_type/left.csv +637 -0
- tts_data_utils/test/core/test_files/diff/diff_type/right.csv +637 -0
- tts_data_utils/test/core/test_files/diff/same_not_same/actual_diff.csv +5135 -0
- tts_data_utils/test/core/test_files/visdiff/adjacent_insert_delete.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/insert_and_delete.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/no_diff.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/overlapping_insert_delete.html +1541 -0
- tts_data_utils/test/core/test_files/visdiff/replace.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/replace_with_delete.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/simple_delete.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/simple_insert.html +1581 -0
- tts_data_utils/test/core/test_files/visdiff/stressing_case.html +2061 -0
- tts_data_utils/test/core/test_filters.py +319 -0
- tts_data_utils/test/core/test_generic_container.py +22 -0
- tts_data_utils/test/core/test_history.py +44 -0
- tts_data_utils/test/core/test_visdiff.py +193 -0
- tts_data_utils/test/invulnerable_data_manager/test_invulnerable_data_manager.py +150 -0
- tts_data_utils/test/multimission/__init__.py +0 -0
- tts_data_utils/test/multimission/evr/__init__.py +0 -0
- tts_data_utils/test/multimission/evr/test_evr.py +29 -0
- tts_data_utils/test/multimission/evr/test_files/actual_evr_gaps.csv +12 -0
- tts_data_utils/test/multimission/evr/test_files/evrs_with_gaps.csv +30 -0
- tts_data_utils/test/multimission/evr/test_files/expected_evr_gaps.csv +12 -0
- tts_data_utils/util.py +104 -0
- tts_data_utils-0.7.3.dist-info/METADATA +81 -0
- tts_data_utils-0.7.3.dist-info/RECORD +72 -0
- tts_data_utils-0.7.3.dist-info/WHEEL +5 -0
- tts_data_utils-0.7.3.dist-info/top_level.txt +1 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import pdb
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
|
|
4
|
+
from tts_data_utils.core.data_container import DataContainer
|
|
5
|
+
from tts_data_utils.core.data_item import DataItem
|
|
6
|
+
|
|
7
|
+
from jpl_time import Time
|
|
8
|
+
|
|
9
|
+
class DataContainerHistoryItem(DataItem):
|
|
10
|
+
"""
|
|
11
|
+
DataItem to go with DataContainerHistoryContainer
|
|
12
|
+
|
|
13
|
+
:param Action: Which action was taken at the step represented in this row?
|
|
14
|
+
:type Action: str
|
|
15
|
+
|
|
16
|
+
:param Description: Description of the action taken at the step represented in this row
|
|
17
|
+
:type Description: str
|
|
18
|
+
|
|
19
|
+
:param Ending Count: Number of records after the action was taken
|
|
20
|
+
:type Ending Count: int
|
|
21
|
+
|
|
22
|
+
:param Starting Count: Number of records before the action was taken
|
|
23
|
+
:type Starting Count: int
|
|
24
|
+
|
|
25
|
+
:param Percent Remaining: Percentage of records at this step relative to previous step
|
|
26
|
+
:type Percent Remaining: float
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
DICT_VALID_KEYS = [
|
|
31
|
+
('Action', str),
|
|
32
|
+
('Description', str),
|
|
33
|
+
('Ending Count', (int, float, str)),
|
|
34
|
+
('Starting Count', (int, float, str)),
|
|
35
|
+
('Percent Remaining', (int, float, str))
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
def __sub_init(self):
|
|
39
|
+
return
|
|
40
|
+
|
|
41
|
+
def time(self):
|
|
42
|
+
return
|
|
43
|
+
|
|
44
|
+
class DataContainerHistoryContainer(DataContainer):
|
|
45
|
+
"""
|
|
46
|
+
A special container that is added by default to all data containers (except history
|
|
47
|
+
containers to avoid infinite recursion).
|
|
48
|
+
|
|
49
|
+
As containers are filtered, appended, and sliced, it can become difficult to trace
|
|
50
|
+
how a particular came to be. The DataContainerHistoryContiner tracks actions that
|
|
51
|
+
have been taken in order to build a container from its initial metadata and including
|
|
52
|
+
each manipulation that happens going forward.
|
|
53
|
+
|
|
54
|
+
Data Container history is not meant to make previous states of the container
|
|
55
|
+
reproducable, but just to offer a crutch in debugging code.
|
|
56
|
+
|
|
57
|
+
The number of records is also provided to enable some level of data analysis based
|
|
58
|
+
on filtering values.
|
|
59
|
+
|
|
60
|
+
:param name: The name of this instantiation of the data container.
|
|
61
|
+
:type name: str
|
|
62
|
+
|
|
63
|
+
:param metadata: Dictionary of open-ended metadata that can be provided in extensions of DataContainer
|
|
64
|
+
:type metadata: dict
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
NAME = 'data container history'
|
|
68
|
+
DATA_ITEM_CLS = DataContainerHistoryItem
|
|
69
|
+
|
|
70
|
+
def __init__(self, name, metadata):
|
|
71
|
+
super().__init__()
|
|
72
|
+
self.name = name
|
|
73
|
+
self.metadata = metadata
|
|
74
|
+
self.records = []
|
|
75
|
+
self._repr_cols = ['Action', 'Description', 'Starting Count', 'Ending Count', 'Percent Remaining']
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def repr_cols(self):
|
|
79
|
+
return self._repr_cols
|