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

refactor: use 'better' logic for updating vertex attributes #1330

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

maelle
Copy link
Contributor

@maelle maelle commented Mar 29, 2024

Fix #1327

@maelle maelle added the upkeep maintenance, infrastructure, and similar label Mar 29, 2024

This comment was marked as outdated.

R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
R/attributes.R Outdated Show resolved Hide resolved
@krlmlr krlmlr marked this pull request as ready for review April 9, 2024 13:17
@krlmlr krlmlr marked this pull request as draft April 9, 2024 13:18
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, looks good.

@clpippel: what do you think?

tmp[index] <- value[[i]]
value[[i]] <- tmp
}
index_is_natural_sequence <- (length(index) == vcount(graph) && all(index == V(graph)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
index_is_natural_sequence <- (length(index) == vcount(graph) && all(index == V(graph)))
index_is_natural_sequence <- (length(index) == vcount(graph) && identical(index, seq_len(vcount(graph))))

@krlmlr krlmlr changed the title refactor: use 'better' logic refactor: use 'better' logic for updating vertex attributes May 23, 2024
@maelle maelle added this to the 2.0.4 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor puzzling loop in attributes.R
2 participants