-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I would like to propose an option to save dataclass objects into field-wise attributes, and automatically loads into the original object using the code like this:
import importlib
def resolve_class(path: str):
module_name, qualname = path.split(":")
module = importlib.import_module(module_name)
obj = module
for part in qualname.split("."):
obj = getattr(obj, part)
return obj
cls = resolve_class("mypkg.models:MyClass")
instance = cls(...)This option can offer two benefits:
- Enhances compatibility between different environments. (Current
cloudpickle"can only be used to send objects between the exact same version of Python." from the doc) - By default, one can search nodes or edges by their attributes of dataclasses (Usecase: Splitting bbox and masks #119).
Prerequisite
- Built-in and user-defined metadata store API #192 will be useful to store the class information for the composite fields.
- Explicit
dtypefor the node and edge attrs? #193 will be useful to ensure that the graph knows the dtype atnode_attr_keyetc.
Metadata
Metadata
Assignees
Labels
No labels