plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.39k stars 2.56k forks source link

Move renderer optional imports into function calls #4856

Open marthacryan opened 3 weeks ago

marthacryan commented 3 weeks ago

There are some optional imports in the _renderers.py file in plotly/io that could slow down startup time when the packages aren't present. See https://github.com/plotly/plotly.py/pull/4823#discussion_r1834473662

alexcjohnson commented 3 weeks ago

To be clear, the big drain is if these packages are installed in the system but are not imported for any purpose other than us reading their version numbers. In that case we should wait to import them until we actually need that version number.

gvwilson commented 3 weeks ago

@marthacryan is this small enough that we can sneak it into 6.0 or should it be 6.1? (reluctant to keep adding "little things" to the current release, but if this gives us a performance boost…)