Closed ZLLentz closed 2 years ago
CI failure is pre-commit failures- this repo hasn't been touched since we updated our CI to run the pre-commit checks. I'll handle that before seeking a merge here, probably in a separate PR tomorrow.
rebased on top of the pre-commit update PR
Description
Delay the
xraydb
import until it is first used.Motivation and Context
Importing
xraydb
is slow and is not guaranteed to be used on execution of the progam. Yes, the most useful calculations here all route through it, but consider the cases where:If it was just item 1 I would want to do this in
pcdsdevices
, but since there are methods in here that don't intersectxraydb
I think it's appropriate to do it in this module.The speedup is about 0.7s for applications that don't use these methods, so it's probably worth it.
The reason we have a speedup is because
xraydb
importssqlalchemy
which has a slow import, among other things.How Has This Been Tested?
Interactively only Tests still pass locally
Where Has This Been Documented?
N/A