Skip to content

Commit

Permalink
Misc cleanup (#392)
Browse files Browse the repository at this point in the history
This update a few config due to new package versions and silence a few
messages.
  • Loading branch information
Carreau committed Mar 1, 2024
2 parents f56cd52 + 7795884 commit 74e8a3f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
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

0 comments on commit 74e8a3f

Please sign in to comment.