Skip to content

Commit 871d3bb

Browse files
authored
ci: Remove unused dependency from demo image (#113)
* ci: Remove unused dependency from demo image * linter
1 parent bf3ad5e commit 871d3bb

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
psycopg2-binary==2.9.9
2-
tsfresh==0.20.1
3-
alibi-detect==0.11.4
2+
alibi-detect==0.11.4

stacks/signal-processing/tsdb.ipynb

+9-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"# The following libraries have already been included in the jupyter image: see here demos/signal-processing/Dockerfile-jupyter\n",
1111
"# These are just left in as examples to show how other libraries can be added.\n",
1212
"#!pip install psycopg2-binary\n",
13-
"#!pip install -U tsfresh\n",
1413
"#!pip install alibi-detect"
1514
]
1615
},
@@ -103,18 +102,18 @@
103102
"while True:\n",
104103
" clear_output(wait=True)\n",
105104
" display('Iteration: '+str(i))\n",
106-
" \n",
105+
"\n",
107106
" sql = f\"\"\"\\\n",
108107
" SELECT time, {', '.join(cols)}\n",
109-
" from conditions \n",
108+
" from conditions\n",
110109
" where (timestamp '{last_time}' = timestamp '1970-01-01' or time > timestamp '{last_time}') and time < now()\n",
111-
" order by time asc \n",
110+
" order by time asc\n",
112111
" limit 1000\n",
113112
" \"\"\"\n",
114-
" \n",
113+
"\n",
115114
" df = pd.read_sql_query(sql, engine)\n",
116115
" df_scores = df[['time']].copy()\n",
117-
" \n",
116+
"\n",
118117
" od = SpectralResidual(\n",
119118
" threshold=1.,\n",
120119
" window_amp=20,\n",
@@ -125,21 +124,21 @@
125124
" n_est_points=10,\n",
126125
" n_grad_points=5\n",
127126
" )\n",
128-
" \n",
127+
"\n",
129128
" for col in cols:\n",
130129
" result = od.predict(\n",
131130
" df[col].to_numpy(),\n",
132131
" t=None,\n",
133132
" return_instance_score=True\n",
134133
" )\n",
135134
" df_scores[col+'_score'] = result['data']['instance_score'].tolist()\n",
136-
" \n",
135+
"\n",
137136
" df_scores.to_sql('scores_sr', engine, index=False, if_exists='append')\n",
138-
" \n",
137+
"\n",
139138
" # get last timestamp to use for next offset\n",
140139
" last_time = pd.to_datetime(df.time.tail(1).values[0]).strftime('%Y-%m-%d %H:%M:%S.%f %Z')\n",
141140
" print(f'Next offset: {last_time}, fetched: {df_scores.r1_score.size}')\n",
142-
" \n",
141+
"\n",
143142
" time.sleep(12)\n",
144143
" i += 1"
145144
]

0 commit comments

Comments
 (0)