Skip to content

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Oct 3, 2025

No description provided.

R_igraph_degree,
if (is.logical(loops)) {
lifecycle::deprecate_soft(
"2.1.5",
Copy link
Contributor

Choose a reason for hiding this comment

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

2.2.0?

@szhorvat
Copy link
Member

szhorvat commented Oct 3, 2025

LGTM. Note that I did not take a careful look at the code, I just checked if it seemed to do what I expected.

I have one comment: I am not sure whether TRUE/FALSE should be deprecated. Perhaps it's not bad to keep allowing these, with the current interpretation (TRUE = twice, FALSE = none). I'll leave the decision to you.

Some functions do have a different kind of "loops" parameter which only takes TRUE/FALSE. Perhaps it's nicer to stay a bit more consistent with those functions. To be clear, for most of these functions twice/once/none wouldn't even make sense, which is why they stay with TRUE/FALSE. An example is some graph generators. Twice/once/none is mostly used with functions that convert a graph to a different representation (adjacency matrix, adjacency list) or compute a quantity that is affected by this interpretation (degree is probably the only one).

I don't personally have a strong opinion whether TRUE/FALSE should be deprecated or kept supported.

@maelle
Copy link
Contributor Author

maelle commented Oct 9, 2025

Thanks both!

@szhorvat to me it's "cleaner" when an argument only takes one kind of values although I know there are plenty of well justified exceptions to that.

@maelle maelle merged commit df4245a into b-next Oct 9, 2025
@maelle maelle deleted the degree branch October 9, 2025 09:41
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