部分移植

This commit is contained in:
2025-10-19 00:01:53 +08:00
parent e77210efc6
commit ace6197231
12 changed files with 122 additions and 108 deletions

View File

@@ -0,0 +1,16 @@
from .nucleon import Nucleon
from .electron import Electron
import heurams.services.hasher as hasher
import pathlib
import toml
import json
def loader_nucleon(path: pathlib.Path, fmt = "toml"):
with open(path, "r") as f:
dictdata = dict()
toml.load(f, dictdata) # type: ignore
lst = list()
for item, attr in dictdata.items():
if item == "__metadata__":
continue
lst.append(Nucleon(hasher.hash(item), attr))