-
Notifications
You must be signed in to change notification settings - Fork 246
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
Gh 2758 fix tidyverse #3463
base: develop
Are you sure you want to change the base?
Gh 2758 fix tidyverse #3463
Conversation
@@ -44,9 +46,9 @@ split_inputs.SIPNET <- function(settings, start.time, stop.time, inputs, overwri | |||
|
|||
#@Hamze, I added the Date variable by using year, doy, and hour and filtered the clim based that and then removed it afterwards. | |||
dat<-input.dat %>% | |||
dplyr::mutate(Date = strptime(paste(V2, V3), format = "%Y %j", tz = "UTC")%>% as.POSIXct()) %>% | |||
dplyr::mutate(Date = as.POSIXct(paste0(Date, ceiling(V4), ":00"), format = "%Y-%m-%d %H:%M", tz = "UTC")) %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also thoughts on how the mutate is being used twice here , which may be overwriting the Date !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right that it's overwriting, but that's OK. The first call sets the date with no hour set (I think technically this gets treated as exactly midnight, but datetimes are complicated and I could be wrong), then the second call converts the result of the first call so that it includes the hour (and minute, but that's set to zero).
I don't know exactly what the previous author did it in two steps and bet it'd be possible to find a cleaner way to write it, but given this is a maintenance fix I think you're right to just add the .data
and leave the rest of the line as it is.
paste0(formatted_start, | ||
"-", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change! I think this makes the inner paste0 redundant too:
paste0(formatted_start, | |
"-", | |
formatted_start, "-", formatted_stop, ".clim") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct !! , i have already removed it to check the redundancy thing ! i will push the changes
"-", | ||
stop.time%>% as.character() %>% gsub(' ',"_",.)), ".clim") | ||
formatted_stop), ".clim") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatted_stop), ".clim") |
(Only if accepting the suggestion above, of course)
@@ -44,9 +46,9 @@ split_inputs.SIPNET <- function(settings, start.time, stop.time, inputs, overwri | |||
|
|||
#@Hamze, I added the Date variable by using year, doy, and hour and filtered the clim based that and then removed it afterwards. | |||
dat<-input.dat %>% | |||
dplyr::mutate(Date = strptime(paste(V2, V3), format = "%Y %j", tz = "UTC")%>% as.POSIXct()) %>% | |||
dplyr::mutate(Date = as.POSIXct(paste0(Date, ceiling(V4), ":00"), format = "%Y-%m-%d %H:%M", tz = "UTC")) %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right that it's overwriting, but that's OK. The first call sets the date with no hour set (I think technically this gets treated as exactly midnight, but datetimes are complicated and I could be wrong), then the second call converts the result of the first call so that it includes the hour (and minute, but that's set to zero).
I don't know exactly what the previous author did it in two steps and bet it'd be possible to find a cleaner way to write it, but given this is a maintenance fix I think you're right to just add the .data
and leave the rest of the line as it is.
I think everything in that loop should be OK -- looks like the one it's complaining about is the
|
Thankyou !! @infotroph for suggestions and review , on it and i will push the changes incorporating the suggestions !! |
@infotroph I have made changes as per the suggestions and also applied the following to ensure smooth operation: *Edited DESCRIPTION to add rlang to the Imports section While doing this, I noticed that devtools::document() created some duplicate files (with 2 appended to their names). I believe these are safe to remove, but I’d like your thoughts on this before proceeding. What are your views? |
Yep, I agree. Those look to me like they came from some kind of local hiccup, and either way we don't want them in this PR. Do they come back if you |
@infotroph i have checked , it is not creating redundant files on running again as i checked , i have removed those copied files . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshagr70 Thanks, this now looks good. Do you want to tackle the year
in model2netcdf.SIPNET as part of this PR or should I merge this now and we come back to that later?
@infotroph Its already being tackled in this PR , i forgot to update the reference.log , now its well updated i have fixed that part as well !! |
Fixes a part of issue #2758 ,

##Updated the .R files to fix no visible binding errors for variables .
##Updated reference.log file .
##Added import for .data
Remaining - variable "year" still accounts under the no visible binding call , the only part where i found it to be referenced is inside the for loop , @infotroph need your suggestion on fixing the issue for this variable .