metagraph-dev / metagraph

Multi-target API for graph analytics with Dask
https://metagraph.readthedocs.io/en/latest/
Apache License 2.0
27 stars 7 forks source link

Save reference to Resolver in ConcreteAlgorithm? #180

Open seibert opened 3 years ago

seibert commented 3 years ago

I noticed that we copy ConcreteAlgorithms when registered in the resolver:

https://github.com/metagraph-dev/metagraph/blob/main/metagraph/core/resolver.py#L572-L573

This means we could, at time of registration, set an attribute on the ConcreteAlgorithm to the resolver without causing any issue if there are for some reason two resolvers with the same algorithm registered to both? Having that reference would simplify the logic here:

https://github.com/metagraph-dev/metagraph/blob/main/metagraph/core/plugin.py#L618-L628

As it would no longer require the resolver to be passed as an explicit argument. This is the trick I used in #166, but I would like to generalize it, if it makes sense.

@jim22k: Thoughts?