Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc cleanup #392

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/astropy.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[global]
module = 'astropy'
logo = "img/astropy_project_logo.svg"
exclude = [ "astropy.utils.misc:OrderedDescriptorContainer",
exclude = [
# VisitTargetNotImplementedError
"astropy.utils.data:download_file",
#"ExecError-<class 'ValueError'>": [
Expand Down
1 change: 0 additions & 1 deletion examples/dask.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exclude = [ "dask.utils:Dispatch",
# target not implemented
'dask.highlevelgraph:HighLevelGraph.visualize',
'dask.array.overlap:map_overlap',
'dask.order:graph_metrics',
# AssertionError : Serialisation proble
"dask.array.routines:matmul",
"dask.array.routines:rot90",
Expand Down
6 changes: 6 additions & 0 deletions examples/matplotlib.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ execute_exclude_patterns = [
"matplotlib._api:check_isinstance",
"matplotlib._api:check_in_list",
"matplotlib._api:check_getitem",
# examples are not meant to be executed,
# contain undefined variables
"matplotlib.axes._axes:Axes.text"
# Method in example used as standalone function,-> missing self
"matplotlib.axes._axes:Axes.axhline",
"matplotlib.axes._axes:Axes.axvline"
]
examples_exclude = [
# jedi inference issue
Expand Down
8 changes: 7 additions & 1 deletion papyri/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,12 @@ def debugprint(*args):
docstring=example_code,
)
if config.execute_doctests:
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message="is non-interactive, and thus cannot be shown",
category=UserWarning,
)
doctest_runner.run(doctests, out=debugprint, clear_globs=False)
doctest_runner.globs.update(doctests.globs)
example_section_data.extend(
Expand All @@ -1403,7 +1409,7 @@ def debugprint(*args):
# TODO fix this if plt.close not called and still a lingering figure.
fig_managers = _pylab_helpers.Gcf.get_all_fig_managers()
if len(fig_managers) != 0:
print_(f"Unclosed figures in {qa}!!")
# print_(f"Unclosed figures in {qa}!!")
plt.close("all")

return processed_example_data(example_section_data), doctest_runner.figs
Expand Down
2 changes: 1 addition & 1 deletion papyri/vref.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __setitem__(self, key, value):
super().__setitem__(key, value)
assert (
key not in self.ordered_sections
), f"assert {key} not in {self.ordered_sections}, {super().__getitem__(key)}, {value}"
), f"assert {key!r} not in {self.ordered_sections}, {super().__getitem__(key)}, {value}"
self.ordered_sections.append(key)

def _guess_header(self, header):
Expand Down
Loading