Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zephyr layout #190

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Zephyr layout #190

merged 1 commit into from
Nov 3, 2021

Conversation

boothby
Copy link
Collaborator

@boothby boothby commented Nov 2, 2021

No description provided.

@@ -172,7 +172,7 @@ def _parse_layout_parameter(S, T, layout, layout_kwargs):
T_layout = t_layout
else:
# Use the dnx_layout if possible
if T.graph.get("family") in ("chimera", "pegasus"):
if T.graph.get("family") in ("chimera", "pegasus", "zephyr"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps create an Enum for known families? Should prevent typos.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't disagree, but to do that properly, we'd probably want to define that enum in dwave_networkx. How important do you think this is?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I don't think it's critical, as in a blocker of this PR. I'll open an issue.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly related; leaving this here so it doesn't get lost.

Chatting with Kelly we were considering the following unified scheme

topology = dnx.Topology("zephyr")
g = topology.generator(16)
topology.plotter(g)

to avoid tedious if elif logic that tends to appear everywhere:

if topology == 'pegasus':
    generator = pegasus_graph
    plotter = draw_pegasus
elif topology == 'zephyr':
    generator = zephyr_graph
    plotter = draw_zephyr

g = generator(5)
plotter(g)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants