-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaesd-records.data.html
171 lines (167 loc) · 9.41 KB
/
aesd-records.data.html
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module aesd-records.data</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="aesd-records.html"><font color="#ffffff">aesd-records</font></a>.data</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/Users/mrossol/Documents/Design_Studio/aesd-records/aesd-records/data.py">/Users/mrossol/Documents/Design_Studio/aesd-records/aesd-records/data.py</a></font></td></tr></table>
<p><tt>Package for data requests<br>
<br>
Created by: Michael Rossol Feb. 2017</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="numpy.html">numpy</a><br>
</td><td width="25%" valign=top><a href="pandas.html">pandas</a><br>
</td><td width="25%" valign=top><a href="aesd-records.records_def_4_pb2.html">aesd-records.records_def_4_pb2</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-empty_data_chunk"><strong>empty_data_chunk</strong></a>(records_data)</dt><dd><tt>Check to see if data chunk is empty<br>
Parameters<br>
----------<br>
records_data : 'proto.data'<br>
proto data message from Response type<br>
<br>
Returns<br>
-------<br>
empty : 'bool'<br>
Returns True if data chunk is empty, else False</tt></dd></dl>
<dl><dt><a name="-from_list"><strong>from_list</strong></a>(record_table)</dt><dd><tt>Extract record data from RecordTable list<br>
Parameters<br>
----------<br>
record_table : 'proto.RecordTable'<br>
proto RecordTable message from RecordData style<br>
<br>
Returns<br>
-------<br>
'list'<br>
list of value in record_table: either floats, ints, or strings</tt></dd></dl>
<dl><dt><a name="-from_record"><strong>from_record</strong></a>(record)</dt><dd><tt>Extract variable id and value from Record<br>
Parameters<br>
----------<br>
record_list : 'proto.Record'<br>
proto Record message from RecordList records<br>
<br>
Returns<br>
-------<br>
'dict'<br>
Dictionary matching var_id to value for all VarValues in record</tt></dd></dl>
<dl><dt><a name="-from_record_data"><strong>from_record_data</strong></a>(record_data)</dt><dd><tt>Create request for records data<br>
Parameters<br>
----------<br>
records_data : 'proto.data'<br>
proto data message from Response type<br>
<br>
Returns<br>
-------<br>
'ndarray' or 'pd.DataFrame'<br>
Return records_data as either and ndarray or pd.DataFrame</tt></dd></dl>
<dl><dt><a name="-from_record_list"><strong>from_record_list</strong></a>(record_list)</dt><dd><tt>Extract record data from RecordList<br>
Parameters<br>
----------<br>
record_list : 'proto.RecordList'<br>
proto RecordList message from RecordData style<br>
<br>
Returns<br>
-------<br>
'pd.DataFrame'<br>
DataFrame with record_ids as indexes and var_ids as columns</tt></dd></dl>
<dl><dt><a name="-from_record_table"><strong>from_record_table</strong></a>(record_table)</dt><dd><tt>Extract record data from RecordTable<br>
Parameters<br>
----------<br>
record_table : 'proto.RecordTable'<br>
proto RecordTable message from RecordData style<br>
<br>
Returns<br>
-------<br>
'ndarray' or 'pd.DataFrame'<br>
array or pd.DataFrame of data rec_ids x var_ids in shape</tt></dd></dl>
<dl><dt><a name="-from_value"><strong>from_value</strong></a>(value)</dt><dd><tt>Extract variable value from VarValue<br>
Parameters<br>
----------<br>
value : 'proto.VarValue'<br>
proto VarValue message from Records variables<br>
<br>
Returns<br>
-------<br>
'float', 'int', or 'string'<br>
variable value</tt></dd></dl>
<dl><dt><a name="-handle_data_response"><strong>handle_data_response</strong></a>(response)</dt><dd><tt>Extracts records_data from each server response message<br>
Parameters<br>
----------<br>
response : 'list'<br>
list of proto Response messages<br>
<br>
Returns<br>
-------<br>
'pd.DataFrame'<br>
Concatinated data from each response message</tt></dd></dl>
<dl><dt><a name="-request_records_data"><strong>request_records_data</strong></a>(model_id, request_id, max_records=1000, variable_ids=None, bookmark_id=None, version=4)</dt><dd><tt>Create request for records data<br>
Parameters<br>
----------<br>
model_id : 'string'<br>
Id of model for which to requst records_data<br>
request_id : 'int'<br>
Unique request id<br>
max_records : 'int'<br>
Number or records being request<br>
Default=0, will return all records<br>
variable_ids : 'list'<br>
List of variable ids (ints) to be requested<br>
Will be returned in same order as request<br>
Default=None, all variables will be returned (order?)<br>
bookmark_id : 'int'<br>
Request records_data based on bookmark id<br>
version : 'int'<br>
Google protobuf version, default = 4<br>
<br>
Returns<br>
-------<br>
request : 'proto.Request'<br>
proto Request message for records_data</tt></dd></dl>
<dl><dt><a name="-request_work"><strong>request_work</strong></a>(model_id, inputs, request_id, version=4)</dt><dd><tt>Create request for records data<br>
Parameters<br>
----------<br>
model_id : 'string'<br>
Id of model for which to requst records_data<br>
inputs : 'dict'<br>
Dictionary of {var_id: value} pairs<br>
request_id : 'int'<br>
Unique request id<br>
version : 'int'<br>
Google protobuf version, default = 4<br>
<br>
Returns<br>
-------<br>
request : 'proto.Request'<br>
proto Request message for records_data</tt></dd></dl>
<dl><dt><a name="-set_var_value"><strong>set_var_value</strong></a>(var_id, value)</dt><dd><tt>set proto.VarValue message<br>
Parameters<br>
----------<br>
var_id : 'int'<br>
input var_id<br>
value : 'float'|'int'|'string'<br>
input value<br>
<br>
Returns<br>
-------<br>
var_value : 'proto.VarValue'<br>
Filled proto.VarValue message</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__all__</strong> = ['request_records_data', 'from_record_data', 'from_record_list', 'from_record', 'from_value', 'from_record_table', 'from_list', 'empty_data_chunk', 'handle_data_response', 'request_work', 'set_var_value']</td></tr></table>
</body></html>