root-11 / graph-theory

A simple graph library
MIT License
82 stars 19 forks source link

Consider (optionally?) lazily delaying graphics imports #32

Closed fiendish closed 1 year ago

fiendish commented 1 year ago

I know that pep8 says imports should always be at the top, but the plot_3d import here is quite slow and delays startup noticeably for short scripts https://github.com/root-11/graph-theory/blob/d64a40de1a95eb7f0482bdb7f42e415d9040a8b2/graph/__init__.py#L7

Maybe consider moving it down to the plot function where plot_3d is actually called?

root-11 commented 1 year ago

Done in #52d4ee74c66f656d29524293730bed33eccc902d Releasing as 2022.4.2 in a few minutes.