File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
src/easydiffraction/plotting/plotters Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -107,26 +107,20 @@ def plot(
107107
108108 # Show the figure
109109
110- # This can lead to warnings in Jupyter notebooks:
111- # WARNING: skipping unknown output mime type: application/vnd.plotly.v1+json [mystnb.unknown_mime_type]
112- if is_notebook () or is_pycharm () or display is None or HTML is None :
113- print (
114- f'----DEBUG----: fig.show(): is_notebook()={ is_notebook ()} , is_pycharm()={ is_pycharm ()} , '
115- f'display={ display } , HTML={ HTML } '
116- )
110+ # The standard `fig.show()` method method triggers the following
111+ # warning during the DMSC Summer School 2025 book build process:
112+ # WARNING: skipping unknown output mime type:
113+ # application/vnd.plotly.v1+json [mystnb.unknown_mime_type]
114+ # So, instead, we will use `pio.to_html()` to convert the figure
115+ # to HTML and keep `fig.show()` in PyCharm only.
116+
117+ if is_pycharm () or display is None or HTML is None :
117118 fig .show (config = config )
118-
119- # If IPython is available, we can convert the figure to HTML and
120- # display it in the notebook.
121119 else :
122- # Convert figure to HTML
123120 html_fig = pio .to_html (
124121 fig ,
125122 include_plotlyjs = 'cdn' ,
126123 full_html = False ,
127124 config = config ,
128125 )
129-
130- # Display it in the notebook
131- print ('----DEBUG----: display(HTML(html_fig))' )
132126 display (HTML (html_fig ))
You can’t perform that action at this time.
0 commit comments