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

Add Branches, Dup; reimplement Parallel #155

Merged
merged 7 commits into from
Jun 10, 2019

Conversation

randomir
Copy link
Member

@randomir randomir commented Jun 8, 2019

No description provided.

hybrid/flow.py Outdated Show resolved Hide resolved
hybrid/flow.py Outdated Show resolved Hide resolved

Args:
*branches ([:class:`~hybrid.core.Runnable`]):
Runnable branches listed as positional arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

Capitalization is inconsistent. Here "branches" but above "Branches". I'd go with branches in all descriptions except references like :class:~hybrid.core.Runnable because future updates will likely do that (no one reads it all before updating locally) and then where does it all end?

Copy link
Member Author

Choose a reason for hiding this comment

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

branches -> plural of noun branch
Branches -> runnable component composed of multiple branches, each branch being of Branch type

That's my reasoning, is it incorrectly applied somewhere?

hybrid/flow.py Outdated Show resolved Hide resolved
@@ -260,6 +367,22 @@ def halt(self):
Race = RacingBranches


class Dup(Runnable, traits.SIMO):
"""Duplicates input :class:`~hybrid.core.State`, n times, into output
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not Copy or Duplicate?

Copy link
Member Author

@randomir randomir Jun 10, 2019

Choose a reason for hiding this comment

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

I like Dup for now. Short and sweet. It's probably temporary anyway.

Copy link
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

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

lgtm


def __init__(self, *branches, **runopts):
super(Branches, self).__init__(**runopts)
self.branches = tuple(branches)
Copy link
Member

Choose a reason for hiding this comment

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

*args maps to a tuple by default

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, I tupleized out of habit. :)

@randomir randomir merged commit df1fab5 into dwavesystems:master Jun 10, 2019
@randomir randomir deleted the add-branches branch June 10, 2019 17:59
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