bifacial_radiance
Contents
bifacial_radiance#
[1]:
import utils
import pandas as pd
from bokeh.plotting import figure, show
from bokeh.models import HoverTool
from bokeh.transform import jitter
from bokeh.io import output_notebook
[2]:
output_notebook()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 output_notebook()
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/output.py:124, in output_notebook(resources, verbose, hide_banner, load_timeout, notebook_type)
122 # verify notebook_type first in curstate().output_notebook
123 curstate().output_notebook(notebook_type)
--> 124 run_notebook_hook(notebook_type, "load", resources, verbose, hide_banner, load_timeout)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:474, in load_notebook(resources, verbose, hide_banner, load_timeout)
471 jl_js = _loading_js(bundle, element_id, load_timeout, register_mime=False)
473 if html is not None:
--> 474 publish_display_data({'text/html': html})
475 publish_display_data({
476 JS_MIME_TYPE : nb_js,
477 LOAD_MIME_TYPE : jl_js,
478 })
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
ReadTheDocs#
[3]:
df = utils.get_rtd_analytics_data('bifacial-radiance')
data_period = df['Date'].min().strftime('%Y-%m-%d') + ' to ' + df['Date'].max().strftime('%Y-%m-%d')
[4]:
total_by_version = df.groupby('Version')['Views'].sum().reset_index()
p = figure(x_range=total_by_version['Version'], height=350, tooltips=[("Version", "@Version"), ("Views", "@Views")],
title=f"Page views by RTD version ({data_period})",)
p.vbar(x='Version', top='Views', width=0.75, source=total_by_version,
line_color='white')
p.xaxis.major_label_orientation = 3.14/2
p.yaxis.axis_label = 'Total page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[4], line 9
7 p.xaxis.major_label_orientation = 3.14/2
8 p.yaxis.axis_label = 'Total page views'
----> 9 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[5]:
daily_views = df.pivot_table(values='Views', index='Date', columns='Version', aggfunc='sum')[['stable', 'latest']].fillna(0)
p = figure(x_axis_type="datetime", height=350, title=f"Daily views by RTD version")
hover_tool = HoverTool(tooltips=[('Date', '@x{%Y-%m-%d}'), ('Views', '@y')],
formatters={'@x': 'datetime'})
hover_tool.point_policy = 'snap_to_data'
p.add_tools(hover_tool)
p.line(daily_views.index, daily_views['stable'], legend_label='stable')
p.line(daily_views.index, daily_views['latest'], legend_label='latest', color='#ff7f0e')
p.yaxis.axis_label = 'Daily page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[5], line 11
9 p.line(daily_views.index, daily_views['latest'], legend_label='latest', color='#ff7f0e')
10 p.yaxis.axis_label = 'Daily page views'
---> 11 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[6]:
df2 = df.loc[(df['Version'] == 'latest'), :].copy()
pathviews = df2.groupby('Path')['Views'].sum().reset_index()
pathviews['Path'] = pathviews['Path'].str.replace('%20', ' ')
pathviews['Path'] = pathviews['Path'].str[:60] # excessively long labels break the plots
[7]:
n = 20
subset = pathviews.sort_values('Views', ascending=False)[:n]
p = figure(y_range=subset['Path'], height=400, tooltips=[("URL", "@Path"), ("Views", "@Views")],
title=f"Views by URL (Top {n}, {data_period})")
p.hbar(y='Path', right='Views', source=subset, height=0.75,
line_color='white')
p.xaxis.axis_label = 'Total page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 8
5 p.hbar(y='Path', right='Views', source=subset, height=0.75,
6 line_color='white')
7 p.xaxis.axis_label = 'Total page views'
----> 8 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[8]:
prefixes = ['tutorials', 'generated']
pathviews['Prefix'] = pathviews['Path'].str.split("/").str[1]
groupviews = pathviews.loc[pathviews['Prefix'].isin(prefixes), :].groupby('Prefix')['Views'].sum().loc[prefixes].sort_values().reset_index()
p = figure(x_range=groupviews['Prefix'], height=350, tooltips=[("Section", "@Prefix"), ("Views", "@Views")],
title=f"Page views by docs section ({data_period})")
p.vbar(x='Prefix', top='Views', width=0.5, source=groupviews)
p.yaxis.axis_label = 'Total page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[8], line 9
7 p.vbar(x='Prefix', top='Views', width=0.5, source=groupviews)
8 p.yaxis.axis_label = 'Total page views'
----> 9 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[9]:
subset = pathviews.loc[pathviews['Prefix'].isin(prefixes), :]
p = figure(x_range=prefixes, height=350, tooltips=[("URL", "@Path"), ("Views", "@Views")],
title=f"Page views by docs page ({data_period})")
p.scatter(x=jitter('Prefix', width=0.1, range=p.x_range, distribution='normal'),
y='Views', source=subset)
p.yaxis.axis_label = 'Total page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[9], line 8
5 p.scatter(x=jitter('Prefix', width=0.1, range=p.x_range, distribution='normal'),
6 y='Views', source=subset)
7 p.yaxis.axis_label = 'Total page views'
----> 8 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[10]:
for prefix in prefixes:
subset = pathviews.loc[pathviews['Prefix'] == prefix, :]
subset = subset.loc[~subset['Path'].str.endswith('/index.html'), :]
subset = subset.sort_values('Views', ascending=False)[:n]
subset['Path_Clean'] = subset['Path'].str.replace('^/'+prefix+'/', '', regex=True)
extra = f"Top {n}, " if len(subset) == n else ''
p = figure(y_range=subset['Path_Clean'], width=700, height=400, tooltips=[("URL", "@Path"), ("Views", "@Views")],
title=f"{prefix} ({extra}{data_period})")
p.hbar(y='Path_Clean', right='Views', source=subset, height=0.75,
line_color='white')
p.xaxis.axis_label = 'Total page views'
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[10], line 13
10 p.hbar(y='Path_Clean', right='Views', source=subset, height=0.75,
11 line_color='white')
12 p.xaxis.axis_label = 'Total page views'
---> 13 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
GitHub#
[11]:
gh = utils.get_github_stars('nrel/bifacial_radiance')
[12]:
p = utils.plot_github_stars_timeseries(gh)
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[12], line 2
1 p = utils.plot_github_stars_timeseries(gh)
----> 2 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[13]:
contributor_ts, _ = utils.get_github_contributor_timeseries("nrel/bifacial_radiance")
p = utils.plot_github_contributors_timeseries(contributor_ts)
show(p)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[13], line 3
1 contributor_ts, _ = utils.get_github_contributor_timeseries("nrel/bifacial_radiance")
2 p = utils.plot_github_contributors_timeseries(contributor_ts)
----> 3 show(p)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:144, in show(obj, browser, new, notebook_handle, notebook_url, **kwargs)
141 state = curstate()
143 if isinstance(obj, LayoutDOM):
--> 144 return _show_with_state(obj, state, browser, new, notebook_handle=notebook_handle)
146 def is_application(obj: Any) -> TypeGuard[Application]:
147 return getattr(obj, '_is_a_bokeh_application_class', False)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/showing.py:191, in _show_with_state(obj, state, browser, new, notebook_handle)
189 if state.notebook:
190 assert state.notebook_type is not None
--> 191 comms_handle = run_notebook_hook(state.notebook_type, 'doc', obj, state, notebook_handle)
192 shown = True
194 if state.file or not shown:
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:357, in run_notebook_hook(notebook_type, action, *args, **kwargs)
355 if _HOOKS[notebook_type][action] is None:
356 raise RuntimeError(f"notebook hook for {notebook_type!r} did not install {action!r} action")
--> 357 return _HOOKS[notebook_type][action](*args, **kwargs)
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:576, in show_doc(obj, state, notebook_handle)
573 comms_target = make_id() if notebook_handle else None
574 (script, div, cell_doc) = notebook_content(obj, comms_target)
--> 576 publish_display_data({HTML_MIME_TYPE: div})
577 publish_display_data({JS_MIME_TYPE: script, EXEC_MIME_TYPE: ""}, metadata={EXEC_MIME_TYPE: {"id": obj.id}})
579 # Comms handling relies on the fact that the cell_doc returned by
580 # notebook copy has models with the same IDs as the original curdoc
581 # they were copied from
File /opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/bokeh/io/notebook.py:487, in publish_display_data(data, metadata, source, transient, **kwargs)
485 # This import MUST be deferred or it will introduce a hard dependency on IPython
486 from IPython.display import publish_display_data
--> 487 publish_display_data(data, metadata, source, transient=transient, **kwargs)
TypeError: publish_display_data() takes from 1 to 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given
[14]:
contributors = utils.get_github_contributors('nrel/bifacial_radiance')
[15]:
mosaic = utils.make_github_contributors_mosaic(contributors)
mosaic
[15]: