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

[WIP] Add option on how to handle orphans when arranging nodes #661

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kbrock
Copy link
Collaborator

@kbrock kbrock commented Mar 29, 2023

Fixes #539

@brendon is this what you had in mind?
How do you usually get into this method?

read: I'm wondering where we want to pass add_orphans: false

Copy link
Contributor

@brendon brendon left a comment

Choose a reason for hiding this comment

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

Looks good. Would definitely need a test or two to ensure it's working as it's such a mind-job every time reading that code :D

@@ -40,14 +40,14 @@ def arrange options = {}
# @param nodes [Array[Node]] nodes to be arranged
# @returns Hash{Node => {Node => {}, Node => {}}}
# If a node's parent is not included, the node will be included as if it is a top level node
def arrange_nodes(nodes)
def arrange_nodes(nodes, add_orphans: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might make more sense to call is rootify_orphans or perhaps in the reverse discard_orphans?

@kbrock
Copy link
Collaborator Author

kbrock commented Jul 17, 2023

WIP: functionality complete. need tests

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.

arrange that discards orphans
2 participants