Add dwave.samplers and dwave.composite namespace#21
Add dwave.samplers and dwave.composite namespace#21arcondello wants to merge 2 commits intodwavesystems:masterfrom
Conversation
72b4a55 to
8149fa1
Compare
8149fa1 to
c2ccfd4
Compare
Add files via upload
| else: | ||
| exec(open("./dwaveoceansdk/package_info.py").read()) | ||
|
|
||
| os.chdir(os.path.dirname(os.path.abspath(__file__))) |
There was a problem hiding this comment.
No idea, probably don't
| from pkg_resources import iter_entry_points | ||
|
|
||
| # add the samplers to the module from entrypoints, name conflicts override | ||
| globals().update((ep.name, ep.load()) for ep in iter_entry_points('dwave.samplers')) |
There was a problem hiding this comment.
Oh, since now we have samplers in Hybrid as well, maybe we want to differentiate those from dimod samplers?
There was a problem hiding this comment.
Something like:
dwave.dimod.samplers
dwave.hybrid.samplers
Or think of a way to reconciliate the two. Same goes for dwave.composites.
There was a problem hiding this comment.
how about
dwave.samplers
dwave.composites
dwave.runnables # this could be further subdivided
There was a problem hiding this comment.
I don't love it, but it could work.
On a somewhat related note, I'm getting fond of from dwave import dimod, hybrid.
There was a problem hiding this comment.
Are you proposing making dimod and hybrid into namespace packages? That would be easy to do, but at some point it would make sense to just make them all into a monolith package.
Or do you mean like the above where just the samplers/composites are present? I think it would be extremely confusing for from dwave import hybrid, dimod to contain different contents/structure than import hybrid, dimod.
There was a problem hiding this comment.
The former. I'm toying with the idea.
Create a namespace for Samplers and Composites populated by entry points.
We could also consider having this as a separate package rather than part of the SDK.