Skip to content

fix: improve netzschleuder internals #40

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

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

Conversation

schochastics
Copy link
Contributor

fix #38

Copy link
Contributor

@maelle maelle left a comment

Choose a reason for hiding this comment

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

Some unsollicited feedback 😸

@@ -129,10 +133,10 @@ ns_metadata <- function(name, collection = FALSE) {
"i" = "see {.url {collection_url}}"
)
)
} else if (net_ident[[1]] == net_ident[[2]]) {
} else if (net_ident[["collection"]] == net_ident[["network"]]) {
return(raw)
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't some of the else if in this file be removed to instead just have if's?

if bla
return thing
if blop
return thing

@@ -163,14 +167,15 @@ ns_df <- function(name, token = NULL, size_limit = 1) {
}
meta <- name
net_ident <- c(meta[["collection_name"]], meta[["nets"]])
names(net_ident) <- c("collection", "network")
Copy link
Contributor

Choose a reason for hiding this comment

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

could the names be added in the previous call?

net_ident <- c(
  collection = meta[["collection_name"]],
  network = meta[["nets"]]
)


on.exit(close(con_edge))
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to take a dependency on withr and use withr::local_connection()? Or to define a helper since we'd call it at least four times?

@schochastics
Copy link
Contributor Author

Thank you! I will have a look at this soonish (I actually forgot about this PR...)

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.

Improve Netzschleuder code
2 participants