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

chore: use 'parent' instead of 'father' in bfs() and dfs() #1523

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Sep 23, 2024

Fix #880

It's not breaking anything as the functions still also return the "father" field.

Copy link
Contributor

aviator-app bot commented Sep 23, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@maelle maelle added the lifecycle Deprecating old APIs label Sep 23, 2024
Copy link
Member

@szhorvat szhorvat left a comment

Choose a reason for hiding this comment

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

This just renames father to parent, right? I don't think my review is needed here (I wanted to do this for a long time).

@maelle
Copy link
Contributor Author

maelle commented Sep 24, 2024

This way you saw it's not even a breaking change 😸

Copy link
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks!

R/structural.properties.R Outdated Show resolved Hide resolved
R/structural.properties.R Show resolved Hide resolved
R/structural.properties.R Outdated Show resolved Hide resolved
@@ -2150,6 +2155,13 @@ bfs <- function(
}
}

if (lifecycle::is_present(father)) {
lifecycle::deprecate_warn("2.0.4", "bfs(father)", "bfs(parent)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprisingly, this code works, but the following is a bit more correct because parent and father are argument names:

Suggested change
lifecycle::deprecate_warn("2.0.4", "bfs(father)", "bfs(parent)")
lifecycle::deprecate_warn("2.0.4", "bfs(father = )", "bfs(parent = )")

pred = TRUE,
succ = TRUE,
dist = TRUE
)
})
})

test_that("bfs() deprecated argument", {
test_that("bfs() deprecated arguments", {
g <- graph_from_literal(a - +b - +c, z - +a, d)
Copy link
Contributor

Choose a reason for hiding this comment

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

#673 would take care of the style here. Can we somehow add this to the package (with .Rbuildignore) and configure/document the usage?

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Successfully merging this pull request may close these issues.

Use 'parent' instead of 'father'
3 participants