Skip to content

Commit 0ef968a

Browse files
jonasvddjvdd
andauthored
Feat/dependabot alerts (#340)
* 🧑‍🔧 Update dependencies: upgrade black to 24.8.0 and Flask-Cors to 4.0.2 * 🧑‍🔧 more vulnerability-related package updates * 📏 align formatting with updated black version * 🧹 --------- Co-authored-by: jeroen <boebievdd@gmail.com>
1 parent 7106d68 commit 0ef968a

File tree

11 files changed

+75
-77
lines changed

11 files changed

+75
-77
lines changed

examples/dash_apps/04_minimal_cache_overview.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def plot_graph(_):
103103
)
104104

105105

106-
# --- FigureResampler update callback ---
106+
# ------ FigureResampler update callback ------
107+
107108

108109
# The plotly-resampler callback to update the graph after a relayout event (= zoom/pan)
109110
# As we use the figure again as output, we need to set: allow_duplicate=True

examples/dash_apps/05_cache_overview_subplots.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def plot_graph(_):
140140

141141
# --- FigureResampler update callback ---
142142

143+
143144
# The plotly-resampler callback to update the graph after a relayout event (= zoom/pan)
144145
# As we use the figure again as output, we need to set: allow_duplicate=True
145146
@app.callback(

examples/dash_apps/11_sine_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def construct_display_graph(n, exp, n_added_graphs) -> FigureResampler:
182182

183183
# --- FigureResampler update callback ---
184184

185+
185186
# The plotly-resampler callback to update the graph after a relayout event (= zoom/pan)
186187
# As we use the figure again as output, we need to set: allow_duplicate=True
187188
@app.callback(

examples/dash_apps/12_file_selector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def plot_graph(n_clicks, *folder_list):
109109

110110
# --------- FigureResampler update callback ---------
111111

112+
112113
# The plotly-resampler callback to update the graph after a relayout event (= zoom/pan)
113114
# As we use the figure again as output, we need to set: allow_duplicate=True
114115
@app.callback(

examples/dash_apps/13_coarse_fine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
TODO: add an rectangle on the coarse graph
1111
1212
"""
13+
1314
from __future__ import annotations
1415

1516
__author__ = "Jonas Van Der Donckt"

plotly_resampler/aggregation/gap_handler_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def insert_fill_value_between_gaps(
9696
# Set the NaN values
9797
# We add the gap index offset (via the np.arange) to the indices to account for
9898
# the repeats (i.e., expanded y_agg array).
99-
y_agg_exp_nan[
100-
np.where(gap_mask)[0] + np.arange(gap_mask.sum())
101-
] = self.fill_value
99+
y_agg_exp_nan[np.where(gap_mask)[0] + np.arange(gap_mask.sum())] = (
100+
self.fill_value
101+
)
102102

103103
return y_agg_exp_nan, idx_exp_nan

plotly_resampler/figure_resampler/figure_resampler_interface.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,7 @@ def _parse_get_trace_props(
597597
hf_y = (
598598
trace["y"]
599599
if hasattr(trace, "y") and hf_y is None
600-
else hf_y.values
601-
if isinstance(hf_y, (pd.Series, pd.Index))
602-
else hf_y
600+
else hf_y.values if isinstance(hf_y, (pd.Series, pd.Index)) else hf_y
603601
)
604602
# NOTE: the if will not be triggered for a categorical series its values
605603
if not hasattr(hf_y, "dtype"):
@@ -608,17 +606,21 @@ def _parse_get_trace_props(
608606
hf_text = (
609607
hf_text
610608
if hf_text is not None
611-
else trace["text"]
612-
if hasattr(trace, "text") and trace["text"] is not None
613-
else None
609+
else (
610+
trace["text"]
611+
if hasattr(trace, "text") and trace["text"] is not None
612+
else None
613+
)
614614
)
615615

616616
hf_hovertext = (
617617
hf_hovertext
618618
if hf_hovertext is not None
619-
else trace["hovertext"]
620-
if hasattr(trace, "hovertext") and trace["hovertext"] is not None
621-
else None
619+
else (
620+
trace["hovertext"]
621+
if hasattr(trace, "hovertext") and trace["hovertext"] is not None
622+
else None
623+
)
622624
)
623625

624626
hf_marker_size = (
@@ -1114,9 +1116,11 @@ def add_traces(
11141116

11151117
# Convert each trace into a BaseTraceType object
11161118
data = [
1117-
self._data_validator.validate_coerce(trace)[0]
1118-
if not isinstance(trace, BaseTraceType)
1119-
else trace
1119+
(
1120+
self._data_validator.validate_coerce(trace)[0]
1121+
if not isinstance(trace, BaseTraceType)
1122+
else trace
1123+
)
11201124
for trace in data
11211125
]
11221126

@@ -1137,7 +1141,7 @@ def add_traces(
11371141
limit_to_views = [limit_to_views] * len(data)
11381142

11391143
zipped = zip(data, max_n_samples, downsamplers, gap_handlers, limit_to_views)
1140-
for (i, (trace, max_out, downsampler, gap_handler, limit_to_view)) in enumerate(
1144+
for i, (trace, max_out, downsampler, gap_handler, limit_to_view) in enumerate(
11411145
zipped
11421146
):
11431147
if (

poetry.lock

Lines changed: 39 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ numpy = [
4848
]
4949
orjson = "^3.10.0" # Faster json serialization (from 3.10 onwards f16 is supported)
5050
# Optional dependencies
51-
Flask-Cors = { version = "^3.0.10", optional = true }
51+
Flask-Cors = { version = "^4.0.2", optional = true }
5252
# Lock kaleido dependency until https://github.com/plotly/Kaleido/issues/156 is resolved
5353
kaleido = {version = "0.2.1", optional = true}
5454
tsdownsample = ">=0.1.3"
@@ -58,7 +58,7 @@ tsdownsample = ">=0.1.3"
5858
inline_persistent = ["kaleido", "Flask-Cors"]
5959

6060
[tool.poetry.dev-dependencies]
61-
pytest = "^6.2.5"
61+
pytest = "^7.2.0"
6262
pytest-cov = "^3.0.0"
6363
selenium = "4.2.0"
6464
pytest-selenium = "^2.0.1"
@@ -72,7 +72,7 @@ ipywidgets = "^7.7.1" # needs to be v7 in order to support serialization
7272
memory-profiler = "^0.60.0"
7373
line-profiler = "^4.0"
7474
ruff = "^0.0.262"
75-
black = "^22.6.0"
75+
black = "^24.3.0"
7676
pytest-lazy-fixture = "^0.6.3"
7777
# yep = "^0.4" # c code profiling
7878
mkdocs = "^1.5.3"

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Fixtures and helper functions for testing"""
22

3-
43
import os
54
from typing import Union
65

@@ -71,6 +70,7 @@ def driver():
7170
driver = webdriver.Chrome(
7271
options=options,
7372
# executable_path="/home/jeroen/chromedriver",
73+
# executable_path="/home/jonas/Documents/chromedriver-linux64/chromedriver",
7474
desired_capabilities=d,
7575
)
7676
# driver = webdriver.Firefox(executable_path='/home/jonas/git/gIDLaB/plotly-dynamic-resampling/geckodriver')

0 commit comments

Comments
 (0)