You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems sphinx-gallery has a problem with aliases and does not produce any example file for them?
class Foo(object):
"""
Foo is used for fooing and provides fooing methods
"""
AliasOfFoo = Foo
This would result in an example file Foo.examples being created. But no AliasOfFoo.examples.
However, since Sphinx generates an automodule rst page for both classes the AliasOfFoo.rst tries to include AliasOfFoo.examples via .. include:: AliasOfFoo.examples.
Finally this results in an error
Problems with "include" directive path:
InputError: No such file or directory: .../AliasOfFoo.examples
I suppose one can work around by not creating any gallery for those Aliases at all,
{% if objname not in ['AliasOfFoo', 'OtherAlias', 'NextAlias'] %}
.. include:: {{module}}.{{objname}}.examples
.. raw:: html
<div class="clearer"></div>
{% endif %}
but that is for sure not ideal, because (1) we loose the galleries, (2) we clutter the autosummary template with content specific stuff.
Sounds like a bug indeed and I am afraid I don't have any suggestions off the top of my head as how to solve or work around it. A PR fixing this would be welcome!
I am going to be frank: this is unlikely to be a priority until 0.14 is released.
If you had time to set-up a reproducible example outside of matplotlib, it would greatly help anyone to work on trying to fix this.
There are two folders, one works just fine, the other contains a line creating an Alias class
MyClassAlias = MyClass
This will lead to the error being raised
D:\xyz\abc\dev\sphinx-mwe\sphinx-mwe-bug\doc\source\_as_gen\module.MyClassAlias.rst:12:
WARNING: Problems with "include" directive path:
InputError: [Errno 2] No such file or directory: 'source/_as_gen/module.MyClassAlias.examples'.
I found out that when creating an example which actually uses the MyClassAlias class, this error does not occur. But of course we do not have examples for all those aliases around.
It seems sphinx-gallery has a problem with aliases and does not produce any example file for them?
This would result in an example file
Foo.examples
being created. But noAliasOfFoo.examples
.However, since Sphinx generates an automodule rst page for both classes the
AliasOfFoo.rst
tries to includeAliasOfFoo.examples
via.. include:: AliasOfFoo.examples
.Finally this results in an error
This problem occurs in the case of the matplotlib documentation (matplotlib/matplotlib#11079), e.g. mpl_toolkits/axes_grid1/axes_grid.py#L770.
The text was updated successfully, but these errors were encountered: