@kleinhenz I'm just perusing through the code and making issues as I go btw. Hope this is ok. Just trying to understand it better and help improve where I can 😊
from functools import cache
@cache
def get_element_data():
fname = importlib.resources.files("aimmdb") / "data" / "elements.json"
with open(fname, "r") as f:
data = json.load(f)
return data
instead of using global. Less lines of code and safer.
@kleinhenz I'm just perusing through the code and making issues as I go btw. Hope this is ok. Just trying to understand it better and help improve where I can 😊
https://github.com/AI-multimodal/aimmdb/blob/673b5ce88ef21ec259c5a262712e58ad9c31e2a6/aimmdb/utils.py#L40
Nitpick: I think you can do something like
instead of using
global
. Less lines of code and safer.