Skip to content

Commit f71b87f

Browse files
committed
add monkey patch for plotly, to address issue plotly/plotly.py#4100
1 parent 2dbb04f commit f71b87f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

refl1d/webview/server/webserver.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@
4747
bumps.cli.install_plugin(refl1d.fitplugin)
4848

4949
from .fit_thread import FitThread, EVT_FIT_COMPLETE, EVT_FIT_PROGRESS
50+
51+
### BEGIN PATCH
52+
# patch the plotly library to disable levenshtein lookup for missing strings
53+
# which is taking a ridiculous amount of time in make_subplots
54+
# See: https://github.com/plotly/plotly.py/issues/4100
55+
def disable_find_closest_string(string, strings):
56+
raise ValueError()
57+
58+
import _plotly_utils.utils
59+
_plotly_utils.utils.find_closest_string = disable_find_closest_string
60+
### END PATCH
61+
5062
from .profile_plot import plot_sld_profile_plotly
5163
from .varplot import plot_vars
5264
# from .state_hdf5_backed import State

0 commit comments

Comments
 (0)