Utils¶
df_row_to_influxdb_point(row)
¶
Function to convert a DataFrame row to an InfluxDB Point
Source code in inference_model/utils.py
93 94 95 96 97 98 99 100 101 |
|
dill_dump(file_loc, content)
¶
Helper function to open/close dill file and dump content into it, otherwise the python outputs warning that the file remains opened
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_loc
|
str
|
location of the file |
required |
content
|
object
|
data that will be saved to dill, usually dictionary |
required |
Source code in inference_model/utils.py
36 37 38 39 40 41 42 43 44 45 |
|
dill_load(file_loc)
¶
Helper function to open/close dill file, otherwise the python outputs warning that the file remains opened
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_loc
|
str
|
location of the file |
required |
Source code in inference_model/utils.py
22 23 24 25 26 27 28 29 30 31 32 33 |
|
handle_redis_message(message)
¶
Handle Redis channel messages: 1. decode messages from Redis channel 2. make a prediction 3. convert pandas rows to influxdb points 4. write into the influxdb
Source code in inference_model/utils.py
78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
intsec(list1, list2)
¶
Simple intesection of two lists. Args: list1 (list): list1 list2 (list): list2 Returns: list (list): intersection of lists
Source code in inference_model/utils.py
11 12 13 14 15 16 17 18 19 |
|