Skip to content

Commit

Permalink
Modified module.R script to address issue #149
Browse files Browse the repository at this point in the history
A condition is added where the data specifications are checked.
The condition checks for the `RunFor` option and if it is set to `NotBaseYear`
then the data specifications are only checked for all the years except base year.
  • Loading branch information
goreaditya committed Mar 14, 2018
1 parent 6cc3d63 commit b1b712e
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions sources/framework/visioneval/R/module.R
Original file line number Diff line number Diff line change
Expand Up @@ -610,17 +610,34 @@ testModule <-
Spec_ls <- Get_ls[[i]]
if (Spec_ls$GROUP == "Year") {
for (Year in G$Years) {
Present <-
checkDataset(Spec_ls$NAME, Spec_ls$TABLE, Year, G$Datastore)
if (!Present) {
if(isOptional(Spec_ls)) {
#Identify for removal because optional and not present
OptSpecToRemove_ <- c(OptSpecToRemove_, i)
} else {
#Identify as missing because not optional and not present
Missing_ <- c(Missing_, attributes(Present))
if (RunFor == "NotBaseYear"){
if(!Year %in% G$BaseYear){
Present <-
checkDataset(Spec_ls$NAME, Spec_ls$TABLE, Year, G$Datastore)
if (!Present) {
if(isOptional(Spec_ls)) {
#Identify for removal because optional and not present
OptSpecToRemove_ <- c(OptSpecToRemove_, i)
} else {
#Identify as missing because not optional and not present
Missing_ <- c(Missing_, attributes(Present))
}
}
}
} else {
Present <-
checkDataset(Spec_ls$NAME, Spec_ls$TABLE, Year, G$Datastore)
if (!Present) {
if(isOptional(Spec_ls)) {
#Identify for removal because optional and not present
OptSpecToRemove_ <- c(OptSpecToRemove_, i)
} else {
#Identify as missing because not optional and not present
Missing_ <- c(Missing_, attributes(Present))
}
}
}

}
}
if (Spec_ls$GROUP == "BaseYear") {
Expand Down

0 comments on commit b1b712e

Please sign in to comment.