Skip to content

Commit 221bf7b

Browse files
committed
Cleanup flake8 warnings outside of streamz module
1 parent 4f0a7d3 commit 221bf7b

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/source/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,3 @@
163163
author, 'Streamz', 'Support for pipelines managing continuous streams of data.',
164164
'Miscellaneous'),
165165
]
166-
167-
168-

examples/map_failure_modes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ async def main(run_flags):
2828
s_sync.sink(print, sync_source.name)
2929

3030
async_stopping_source = make_counter("async stopping")
31-
s_async_stop = async_stopping_source.rate_limit("500ms").map_async(flaky_async, async_stopping_source, stop_on_exception=True)
31+
s_async_stop = (async_stopping_source
32+
.rate_limit("500ms")
33+
.map_async(flaky_async, async_stopping_source, stop_on_exception=True))
3234
s_async_stop.sink(print, async_stopping_source.name)
3335

3436
if run_flags[0]:

examples/river_kmeans.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
import random
33
import time
44

5+
import holoviews as hv
56
import pandas as pd
6-
7+
import panel as pn
8+
from hvplot import streamz # noqa: F401 # this monkeypatches streamz.dataframe
9+
from panel.pane.holoviews import HoloViews
10+
from river import cluster
711
from streamz import Stream
8-
import hvplot.streamz
912
from streamz.river import RiverTrain
10-
from river import cluster
11-
import holoviews as hv
12-
from panel.pane.holoviews import HoloViews
13-
import panel as pn
13+
1414
hv.extension('bokeh')
1515

1616
model = cluster.KMeans(n_clusters=3, sigma=0.1, mu=0.5)
1717
centres = [[random.random(), random.random()] for _ in range(3)]
1818
count = [0]
1919

20+
2021
def gen(move_chance=0.05):
2122
centre = int(random.random() * 3) # 3x faster than random.randint(0, 2)
2223
if random.random() < move_chance:
@@ -101,7 +102,6 @@ def start(event):
101102

102103
def stop(event):
103104
print(count, "events")
104-
global t0
105105
t_spent = time.time() - t0
106106
print("frequency", count[0] / t_spent, "Hz")
107107
print("Current centres", centres)
@@ -128,5 +128,6 @@ def stop(event):
128128
print("Output centres", [list(c.values()) for c in model.centers.values()])
129129
s.stop()
130130

131+
131132
if __name__ == "__main__":
132133
main(viz=True)

examples/scrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def links_of_page(content_page):
1414
domain = '%s://%s' % (uri.scheme, uri.netloc)
1515
try:
1616
soup = BeautifulSoup(content, features="html.parser")
17-
except:
17+
except Exception:
1818
return []
1919
else:
2020
links = [link.get('href') for link in soup.find_all('a')]

0 commit comments

Comments
 (0)