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

expose convert_edgelist (#56) #74

Merged
merged 4 commits into from
Feb 23, 2023
Merged

expose convert_edgelist (#56) #74

merged 4 commits into from
Feb 23, 2023

Conversation

schochastics
Copy link
Member

Turned it into a generic function that works with rang and ranglet objects.

@chainsawriot
Copy link
Collaborator

@schochastics If you prefer

el <- do.call("rbind",lapply(x$ranglets,convert_edgelist))

can be replaced by

el <- vctrs::vec_rbind(lapply(x$ranglets,convert_edgelist))

now, probably slightly faster and more robust.

@codecov-commenter
Copy link

Codecov Report

Merging #74 (17afdfa) into v0.2 (fabb92d) will increase coverage by 0.98%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             v0.2      #74      +/-   ##
==========================================
+ Coverage   92.51%   93.49%   +0.98%     
==========================================
  Files           5        6       +1     
  Lines         641      646       +5     
==========================================
+ Hits          593      604      +11     
+ Misses         48       42       -6     
Impacted Files Coverage Δ
R/resolve.R 90.03% <ø> (+1.81%) ⬆️
R/edgelist.R 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@schochastics
Copy link
Member Author

ah nice will do that

@schochastics
Copy link
Member Author

schochastics commented Feb 23, 2023

hmm that didnt work
vctrs::vec_rbind doesnt seem to support a list of data frames as input?
@chainsawriot should I revert, or did I do something wrong?

@chainsawriot
Copy link
Collaborator

@schochastics Sorry, I checked and it doesn't work as I said. Please revert.

@schochastics
Copy link
Member Author

@chainsawriot done. Happy that my faithful companion do.call for so many years remains useful

@chainsawriot
Copy link
Collaborator

chainsawriot commented Feb 23, 2023

Well

### but need to import the triple bang
vctrs::vec_rbind(!!!(lapply(graph$ranglets, convert_edgelist)))

Rather than being smart like this, I rather opt for being familiar. Please keep the do.call.

@chainsawriot chainsawriot merged commit 6739512 into gesistsa:v0.2 Feb 23, 2023
@schochastics
Copy link
Member Author

haha I was actually wondering if a series of "!" could solve this issue. Well, TIL

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