Skip to content

Make plot detection in docstrings more flexible #59

Closed
@florian-wagner

Description

@florian-wagner

I was wondering why some of my docstring examples are not rendered, until I found that import matplotlib.pyplot as plt works, while from matplotlib import pyplot as plt does not, since numpydoc explicitly checks if a string contains import matplotlib.

Aside from import conventions, it would be desirable to have a more flexible plot detection, since a lot of projects have high-level wrappers around matplotlib. For example, our project has a "show" function, which plots simulation results on arbitrary finite element meshes (and imports mpl internally).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions