Skip to content

Commit

Permalink
fix(rtd): Correct doc rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinci1it2000 committed Nov 3, 2022
1 parent 2021156 commit 82c9924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions schedula/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,8 @@ def set_default_value(self, data_id, value=EMPTY, initial_dist=0.0):
A dispatcher with a data node named `a`::
>>> dsp = Dispatcher(name='Dispatcher')
>>> import schedula as sh
>>> dsp = sh.Dispatcher(name='Dispatcher')
...
>>> dsp.add_data(data_id='a')
'a'
Expand All @@ -1068,7 +1069,7 @@ def set_default_value(self, data_id, value=EMPTY, initial_dist=0.0):
Remove the default value of `a` node::
>>> dsp.set_default_value('a', value=EMPTY)
>>> dsp.set_default_value('a', value=sh.EMPTY)
>>> dsp.default_values
{}
"""
Expand Down
4 changes: 3 additions & 1 deletion schedula/ext/dispatcher/documenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _plot(lines, dsp, dot_view_opt, documenter, dsp_opt):
executor = dot_view_opt.get('executor', 'async')
if osp.isdir(dspdir):
fpath = glob.glob(osp.join(dspdir, '*.gv'))[0]
else:
elif hasattr(dsp, 'plot'):
smap = dsp.plot(**dot_view_opt)
folder = next(iter(smap))
fpath = osp.join(dspdir, '%s.gv' % folder.sitemap.foldername)
Expand All @@ -153,6 +153,8 @@ def _plot(lines, dsp, dot_view_opt, documenter, dsp_opt):
directory=dspdir, index=index, viz_js=viz_js, executor=executor
)
dot.save(fpath, directory='')
else:
return

dsource = osp.dirname(osp.join(env.srcdir, env.docname))
p = osp.relpath(fpath, dsource).replace('\\', '/')
Expand Down

0 comments on commit 82c9924

Please sign in to comment.