Skip to content

Replace backend_driver by new example runner. - #17226

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
anntzer:driver
May 8, 2020
Merged

tacaswell merged 1 commit into
matplotlib:masterfrom
anntzer:driver

Conversation

@anntzer

@anntzer anntzer commented Apr 23, 2020

Copy link
Copy Markdown
Contributor

backend_driver has been really outdated for a long time. Replace it by
a new script running all or a subset of the examples scripts.

Supersedes #8069 (@dstansby).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Comment thread tools/run_examples.py Resolved
Comment thread tools/run_examples.py Outdated
help="examples to run; defaults to all examples (except *_sgskip.py)")
args = parser.parse_args()

root = (Path(__file__).parent / "../examples").resolve()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.parent and ..?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the first parent is basically dirname(); I guess the other option would be .parents[1] / "examples" but I always find it hard to get the right index in the brackets...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could do .parent.parent, maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, that's fine too

@efiring

efiring commented May 8, 2020

Copy link
Copy Markdown
Member

Shouldn't it be possible to run this with no arguments?

(mpl1) ~/work/programs/py/mpl/matplotlib/tools $ python run_examples.py
Traceback (most recent call last):
  File "run_examples.py", line 91, in <module>
    main()
  File "run_examples.py", line 66, in main
    width = max(len(str(relpath)) for relpath in relpaths)
ValueError: max() arg is an empty sequence

backend_driver has been really outdated for a long time.  Replace it by
a new script running all or a subset of the examples scripts.
@anntzer

anntzer commented May 8, 2020

Copy link
Copy Markdown
Contributor Author

oops, should be fixed now.

@tacaswell
tacaswell merged commit b786dcd into matplotlib:master May 8, 2020
@anntzer
anntzer deleted the driver branch May 8, 2020 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants