-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
132 lines (80 loc) · 3.69 KB
/
conftest.py
File metadata and controls
132 lines (80 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import numpy as np
class Complete():
def __init__(self):
self.complete_dict = self.complete_dict()
def __getitem__(self, key):
return self.complete_dict[key]
def complete_dict(self):
complete_datasets = {"keys":self.complete_keys_dataset(), "data":self.complete_dataset()}
return complete_datasets
def complete_dataset(self):
array_shape = (42,67,10,4096)
#create complete datasets
complete_array = np.arange(np.asarray(array_shape).prod()).reshape(array_shape)
complete_dict = {"dset_1": complete_array}
#dataset_dict = {"data": complete_array}
return complete_dict
def complete_keys_dataset(self):
#create complete datasets
complete_array = np.arange(2814).reshape((42,67,1,1))
complete_dict = {"key_1":complete_array}
#dataset_dict = {"keys": complete_array}
return complete_dict
def refresh(self):
return
class Incomplete():
def __init__(self):
self.incomplete_dict = self.incomplete_dict()
def __getitem__(self, key):
return self.incomplete_dict[key]
def incomplete_dict(self):
incomplete_datasets = {"keys":self.incomplete_keys_dataset(), "data":self.incomplete_dataset()}
return incomplete_datasets
def incomplete_dataset(self):
array_shape = (42,67,10,4096)
#create complete datasets
incomplete_array = np.arange(1, np.asarray(array_shape).prod()+1)
incomplete_array[array_shape[-1]*array_shape[-2]*2000:] = 0
incomplete_dict = {"dset_1": incomplete_array}
#dataset_dict = {"data": complete_array}
return incomplete_dict
def incomplete_keys_dataset(self):
#create complete datasets
incomplete_array = np.arange(1, 2814+1)
incomplete_array[2000:] = 0
incomplete_array.reshape((42,67,1,1))
incomplete_dict = {"key_1":incomplete_array}
#dataset_dict = {"keys": complete_array}
return incomplete_dict
def refresh(self):
return
class MultipleIncomplete():
def __init__(self):
self.incomplete_dict = self.incomplete_dict()
def __getitem__(self, key):
return self.incomplete_dict[key]
def incomplete_dict(self):
incomplete_datasets = {"keys":self.multiple_incomplete_keys_dataset(), "data":self.multiple_incomplete_dataset()}
return incomplete_datasets
def multiple_incomplete_dataset(self):
array_shape = (42,67,10,4096)
#create complete datasets
complete_array = np.arange(np.asarray(array_shape).prod()).reshape(array_shape)
array_shape = (42,67,10,4096)
#create complete datasets
incomplete_array = np.arange(1, np.asarray(array_shape).prod()+1)
incomplete_array[array_shape[-1]*array_shape[-2]*2000:] = 0
incomplete_dict = {"dset_1": incomplete_array, "dset_2": complete_array}
#dataset_dict = {"data": complete_array}
return incomplete_dict
def multiple_incomplete_keys_dataset(self):
#create complete datasets
incomplete_array = np.arange(1, 2814+1)
incomplete_array[2000:] = 0
incomplete_array.reshape((42,67,1,1))
complete_array = np.arange(2814).reshape((42,67,1,1))
incomplete_dict = {"key_1":incomplete_array, "key_2": complete_array}
#dataset_dict = {"keys": complete_array}
return incomplete_dict
def refresh(self):
return