mendeleev icon indicating copy to clipboard operation
mendeleev copied to clipboard

Defer loading element data until attribute access

Open paulromano opened this issue 1 year ago • 3 comments

Here's my quick attempt to reduce the overall import time by deferring the autoload of element data until one actually accesses the corresponding attribute from the mendeleev module, e.g. mendeleev.Li. This seems to work pretty well in my limited testing. The only downside I can see is that the attribute names (H, He, etc.) won't show up in an autocomplete from an IDE. @lmmentel Let me know what you think of this approach.

Fixes #118

paulromano avatar Jun 29 '23 03:06 paulromano