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

added tools for cache persistent status messages #177

Merged
merged 7 commits into from
Jul 25, 2023

Conversation

tscheypidi
Copy link
Member

@tscheypidi tscheypidi commented Jul 24, 2023

added getMadratMessage, putMadratMessage and resetMadratMessages for cache persistent status messages

Copy link
Contributor

@pfuehrlich-pik pfuehrlich-pik left a comment

Choose a reason for hiding this comment

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

This is only a partial review, will continue later.

R/putMadratMessage.R Show resolved Hide resolved
#' 2) messages are always stored in lists with messages split by function calls
#' where the message was triggered.
#'
#' @param name The category in which the message should be stored
Copy link
Contributor

Choose a reason for hiding this comment

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

What categories do you mean here? The example puts "test" here, but I'm still not sure how to use this. It is an arbitrary string chosen by the user?

@@ -0,0 +1,31 @@
#' Tool: getMadratMessage
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me think it is a function with the "tool" prefix, but it is not. So maybe delete the "Tool: " here?

Suggested change
#' Tool: getMadratMessage
#' getMadratMessage

R/getMadratMessage.R Show resolved Hide resolved
R/resetMadratMessages.R Show resolved Hide resolved
R/resetMadratMessages.R Show resolved Hide resolved
R/resetMadratMessages.R Outdated Show resolved Hide resolved
@@ -55,6 +55,7 @@ cacheGet <- function(prefix, type, args = NULL, graph = NULL, ...) {
x[[elem]] <- .terraLoad(x[[elem]])
}
}
putMadratMessage(value = attr(x, "madratMessage"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected that the message is also printed here, is there a reason why not?

Copy link
Member Author

Choose a reason for hiding this comment

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

well, with this procedure you can store various types of information. For some you might want to have them reported at some point for others you might not. As it is unclear what should happen with this information I would not print it here.

@tscheypidi tscheypidi merged commit 013737f into pik-piam:master Jul 25, 2023
1 check passed
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