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

PG loop argument wrapper #36

Merged
merged 9 commits into from
Jun 28, 2019

Conversation

Banana1530
Copy link
Collaborator

No description provided.

Copy link
Member

@michaelweylandt michaelweylandt left a comment

Choose a reason for hiding this comment

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

Looks good - just a few minor things.

@@ -26,11 +26,16 @@ test_that("Test for arguments names", {
args <- names(cluster(w = matrix(1)))
test_args <- c(test_args, args)

# Test
# Test prox argumetns
Copy link
Member

Choose a reason for hiding this comment

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

Typo: "arguments"

@@ -275,3 +275,16 @@ cluster <- function(w = NULL, ADMM = FALSE,
class(arglist) <- "moma_sparsity"
return(arglist)
}

moma_pg_setting <- function(EPS = 1e-10, MAX_ITER = 1000,
Copy link
Member

Choose a reason for hiding this comment

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

I'm a fan of putting the ... as the first argument for functions like this and throwing an error if length(list(...)) != 0 - that forces users to specify all arguments by name instead of relying on position. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's genius! Added.

@@ -275,3 +275,16 @@ cluster <- function(w = NULL, ADMM = FALSE,
class(arglist) <- "moma_sparsity"
return(arglist)
}

moma_pg_setting <- function(EPS = 1e-10, MAX_ITER = 1000,
Copy link
Member

Choose a reason for hiding this comment

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

Possibly settings (plural) would be a better name.

@Banana1530 Banana1530 force-pushed the pgloopsettingwrapper branch from c5ac406 to d6c6f35 Compare June 27, 2019 10:58
@Banana1530 Banana1530 force-pushed the pgloopsettingwrapper branch from d6c6f35 to 3f81cf8 Compare June 27, 2019 12:33
@michaelweylandt
Copy link
Member

There's a lot of style churn in the test files. Is this formatting stuff not included in #33 or something else?

Copy link
Member

@michaelweylandt michaelweylandt left a comment

Choose a reason for hiding this comment

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

LGTM

@Banana1530
Copy link
Collaborator Author

Banana1530 commented Jun 28, 2019

I think it was because styler is a bit unstable (not sure). Before I added new tests in the PR, I ran style_dir() and nothing was changed. However after adding new tests, it changed the previously formatted part out of no reason.

Anyway current format in tests files is good.

@Banana1530 Banana1530 merged commit a43b7ff into DataSlingers:master Jun 28, 2019
@Banana1530 Banana1530 deleted the pgloopsettingwrapper branch July 26, 2019 06:46
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.

2 participants