Skip to content

Commit

Permalink
Updated build_all.R
Browse files Browse the repository at this point in the history
  • Loading branch information
arnejohannesholmin committed Nov 4, 2021
1 parent 66f898f commit 8e4c9d2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Build/build_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RstoxBuild::buildRstoxPackage(
),
suggests = "testthat",
linkingto = "Rcpp",
globalVariables = c(".", "..Country", "..Organisation", "..SurveyName", "..allDuplicated", "..colAgg", "..colList", "..columns", "..digits", "..keep", "..key", "..parameterNames", "..signifDigits", "..sourceColumns", "..targetAndSourceVariables", "..toKeep", "..valueVariablesInTranslation", "..varToExtract", "..variableKeys", "..variablesInTable", "..x", "AcousticCategory", "Addition", "BeamKey", "Channel", "ChannelDepthLower", "ChannelDepthUpper", "Constant", "Country", "Cruise", "CruiseKey", "DateTime", "DoorType", "EDSU", "EchoType", "FishID", "Gear", "GearEx", "HaulNo", "HaulVal", "LengthClass", "LengthCode", "LocalID", "LogKey", "N", "Number", "NumberAtLength", "Quarter", "ReplaceBy", "SaCategory", "Scaling", "Ship", "SpecVal", "SpeciesCategoryNumber", "SpeciesCategoryWeight", "SpeciesCode", "StatRec", "SubsampleWeight", "SubsampledNumber", "Survey", "SweepLngt", "Time", "TransducerOrientation", "Validity", "VariableName", "WeightMeasurement", "age", "agingstructure", "ap", "aphia", "bottomdepthstart", "bottomdepthstop", "catCatchWgt", "catchcount", "catchpartnumber", "catchproducttype", "catchweight", "cc", "cruise", "cw", "direction", "distance", "fishingdepthmax", "fishingdepthmin", "freq", "g", "gear", "gearcondition", "gearflow", "hv", "inapplicableFormats", "individualweight", "isCrustacean", "isHerringOrSprat", "isPelagic", "latitudeend", "latitudestart", "lenInterval", "lengthCode", "lengthmeasurement", "lengthresolution", "lengthsamplecount", "lengthsampleweight", "level", "lngtClass", "lngtCode", "logstart", "longitudeend", "longitudestart", "lsCountTot", "lsc", "maturationstage", "maturity", "maxFishID", "meanW", "missionstartdate", "missionstopdate", "ms", "nInd", "nWithWeight", "nation", "noMeas", "parasite", "platformname", "preferredagereading", "readability", "reportInMM", "reportingUnit", "res", "rowIndex", "s", "sampleFac", "samplequality", "sampletype", "serialnumber", "sex", "shortname", "sp", "specialstage", "specimenid", "start_time", "startyear", "station", "stationstartdate", "stationstarttime", "stationstopdate", "stationstoptime", "stomach", "stoxBioticObject", "subFactor", "subWeight", "suffixes", "sweeplength", "target", "tissuesample", "totWeight", "totalNo", "transceiver", "trawldoorarea", "trawldoorspread", "trawldoortype", "trawldoorweight", "verticaltrawlopening", "winddirection", "windspeed", "wingspread", "wiredensity", "wirediameter", "wirelength"),
globalVariables = c(".", "..Country", "..Organisation", "..SurveyName", "..allDuplicated", "..colList", "..columns", "..digits", "..keep", "..key", "..parameterNames", "..signifDigits", "..sourceColumns", "..targetAndSourceVariables", "..toKeep", "..valueVariablesInTranslation", "..varToExtract", "..variableKeys", "..variablesInTable", "..x", "AcousticCategory", "Addition", "BeamKey", "Channel", "ChannelDepthLower", "ChannelDepthUpper", "Constant", "Country", "Cruise", "CruiseKey", "DateTime", "DoorType", "EDSU", "EchoType", "EffectiveTowDistance", "FishID", "Gear", "GearEx", "HaulNo", "HaulVal", "LengthCode", "LocalID", "LogKey", "N", "NewValue", "NumberAtLength", "NumberOfIndividualsToGenerate", "NumberOfSampledIndividuals", "Quarter", "ReplaceBy", "SaCategory", "Scaling", "Ship", "SpecVal", "SpeciesCategoryNumber", "SpeciesCategoryWeight", "SpeciesCode", "StatRec", "SubsampleWeight", "SubsampledNumber", "Survey", "SweepLngt", "Time", "TransducerOrientation", "Value", "VariableName", "WeightMeasurement", "age", "agingstructure", "ap", "aphia", "bottomdepthstart", "bottomdepthstop", "catCatchWgt", "catchcount", "catchpartnumber", "catchproducttype", "catchweight", "cc", "cruise", "cw", "direction", "distance", "fishingdepthcount", "fishingdepthmax", "fishingdepthmin", "freq", "g", "gear", "gearcondition", "gearflow", "hv", "inapplicableFormats", "individualweight", "isCrustacean", "isHerringOrSprat", "isPelagic", "latitudeend", "latitudestart", "lenInterval", "lengthCode", "lengthmeasurement", "lengthresolution", "lengthsamplecount", "lengthsampleweight", "level", "lngtClass", "lngtCode", "logstart", "longitudeend", "longitudestart", "lsCountTot", "lsc", "maturationstage", "maturity", "maxFishID", "meanW", "missionstartdate", "missionstopdate", "ms", "nInd", "nWithWeight", "nation", "noMeas", "parasite", "platformname", "preferredagereading", "readability", "reportInMM", "reportingUnit", "res", "rowIndex", "s", "sampleFac", "samplequality", "sampletype", "serialnumber", "sex", "shortname", "sp", "specialstage", "specimenid", "start_time", "startyear", "station", "stationstartdate", "stationstarttime", "stationstopdate", "stationstoptime", "stomach", "stoxBioticObject", "subFactor", "subWeight", "suffixes", "sweeplength", "target", "tissuesample", "totWeight", "totalNo", "transceiver", "trawldoorarea", "trawldoorspread", "trawldoortype", "trawldoorweight", "verticaltrawlopening", "winddirection", "windspeed", "wingspread", "wiredensity", "wirediameter", "wirelength"),
addManual = TRUE,
check = FALSE
)
Expand All @@ -69,6 +69,7 @@ RstoxBuild::buildRstoxPackage(
rgdal = "1.5.0",
sp = "1.3.2",
sf = "0.9.0",
lwgeom = "0.2-0", # Used for calculation of area of sf object in simplifyStratumPolygon(). Added here since it is only suggested by sf, but RstoxBase needs it.
ggplot2 = "3.0.0",
units = "0.7",
methods = "3.6.2",
Expand All @@ -78,7 +79,7 @@ RstoxBuild::buildRstoxPackage(
suggests = "testthat",
internal.dependencies = "RstoxData",
additional_repositories = "https://stoxproject.github.io/repo",
globalVariables = c(".", "..Cruise", "..DateTime", "..Hauls", "..LengthDistributionType", "..LengthInterval", "..LengthIntervalWidths", "..VerticalResolutionMax", "..VerticalResolutionMin", "..WeightingFactors", "..acceptedColumns", "..atMissingLengthGroup", "..by", "..cols", "..columnsToKeep", "..extract", "..extractFromDataCopy", "..haulGrouping", "..intervalVector", "..keys", "..keysSansSample", "..lengthVar", "..locatedStratum", "..meanBy", "..paddingVariables", "..presentResolutionVariables", "..refvar", "..resolutionVar", "..sumBy", "..variablesToGetFromAbundanceData", "..vars", "AcousticCategory", "AcousticCategoryKey", "Area", "Beam", "BeamKey", "Biomass", "CatchFractionCount", "CatchFractionWeight", "Channel", "ChannelReferenceDepth", "ChannelReferenceKey", "ChannelReferenceTilt", "ChannelReferenceType", "Cruise", "CruiseKey", "DateTime", "Density", "DensityMethod", "DensityWeight", "Depth", "DepthExponent", "EDSU", "EffectiveLogDistance", "EffectiveTowDistance", "Haul", "Individual", "IndividualIndex", "IndividualKey", "IndividualRoundWeight", "IndividualTotalLength", "IndividualTotalLengthMiddle", "Layer", "LengthDistributionType", "LengthExponent", "LengthGroup", "LengthResolution", "LogDuration", "LogKey", "LogOrigin", "MaxChannelDepth", "MaxChannelRange", "MeanLengthDistributionWeight", "MeanNASCWeight", "MergeStoxBiotic", "MiddleDateTime", "MinChannelDepth", "MinChannelRange", "NASCKey", "NASCWeight", "NewValue", "PSU", "ReplaceIndividual", "ReplaceIndividualIndex", "ReplaceLevel", "SSU", "SSUIndex", "SplitAcousticCategory", "StartDateTime", "StationLevel", "StopDateTime", "Stratum", "SummedWeights", "Survey", "SweepWidth", "TargetStrength", "TargetStrength0", "TargetStrengthFunction", "TotalLength", "V1", "Value", "WeightedCount", "WeightingFactor", "aggregationVariables", "assignmentID", "assignmentPasted", "backscatteringCrossSection", "crossSection", "distance", "functionName", "haulWeightFactor", "imputeSeed", "includeintotal", "individualCount", "individualWeightFactor", "inside", "intervalIndex", "midDepth", "midIndividualTotalLength", "minDistance", "multiple", "packageName", "projectXMLFilePath", "raisingFactor", "representativeBackscatteringCrossSection", "representativeBackscatteringCrossSectionNormalized", "sd", "stratumPolygonFilePath", "sumIndividualWeightFactor", "sumWeightedCount", "weighted", "weightingParameter", "x", "y"),
globalVariables = c(".", "..Cruise", "..DateTime", "..Hauls", "..LengthDistributionType", "..VerticalResolutionMax", "..VerticalResolutionMin", "..WeightingFactors", "..acceptedColumns", "..atMissingLengthGroup", "..by", "..cols", "..columnsToKeep", "..extract", "..extractFromDataCopy", "..haulGrouping", "..intervalVector", "..keys", "..keysSansSample", "..lengthInterval", "..lengthIntervalWidths", "..lengthVar", "..locatedStratum", "..meanBy", "..paddingVariables", "..presentResolutionVariables", "..refvar", "..resolutionVar", "..sumBy", "..variablesToGetFromAbundanceData", "..vars", "AcousticCategory", "AcousticCategoryKey", "Area", "Beam", "BeamKey", "Biomass", "CatchFractionCount", "CatchFractionWeight", "Channel", "ChannelReferenceDepth", "ChannelReferenceKey", "ChannelReferenceTilt", "ChannelReferenceType", "Cruise", "CruiseKey", "CruiseKey1", "DateTime", "Density", "DensityWeight", "Depth", "DepthExponent", "EDSU", "EffectiveLogDistance", "EffectiveTowDistance", "Haul", "HaulKey", "Individual", "IndividualIndex", "IndividualKey", "IndividualRoundWeight", "IndividualTotalLength", "IndividualTotalLengthMiddle", "Layer", "LengthDistributionType", "LengthExponent", "LengthGroup", "LengthResolution", "LogDuration", "LogKey", "LogOrigin", "MaxChannelDepth", "MaxChannelRange", "MeanLengthDistributionWeight", "MeanNASCWeight", "MergeStoxBiotic", "MiddleDateTime", "MinChannelDepth", "MinChannelRange", "NASCKey", "NASCWeight", "NewValue", "PSU", "ReplaceIndividual", "ReplaceIndividualIndex", "ReplaceLevel", "SSU", "SSUIndex", "SplitAcousticCategory", "StartDateTime", "Station", "StationLevel", "StopDateTime", "Stratum", "SummedWeights", "Survey", "SweepWidth", "TargetStrength", "TargetStrength0", "TargetStrengthFunction", "TotalLength", "V1", "Value", "WeightedCount", "WeightingFactor", "aggregationVariables", "assignmentID", "assignmentPasted", "backscatteringCrossSection", "crossSection", "distance", "functionName", "haulWeightFactor", "imputeSeed", "includeintotal", "individualCount", "individualWeightFactor", "inside", "intervalIndex", "midIndividualTotalLength", "minDistance", "multiple", "numberOfIndividuals", "numberOfSubSamples", "packageName", "raisingFactor", "representativeBackscatteringCrossSection", "representativeBackscatteringCrossSectionNormalized", "sumIndividualWeightFactor", "sumWeightedCount", "weighted", "weightingParameter", "x", "y"),
addManual = TRUE,
check = FALSE
)
Expand Down Expand Up @@ -116,7 +117,7 @@ system.time(RstoxBuild::buildRstoxPackage(
"RstoxBase"
),
additional_repositories = "https://stoxproject.github.io/repo",
globalVariables = c(".", "..Cruise", "..DateTime", "..EDSUInfoToKeep", "..PSU", "..activeProcessID", "..clickPointNames", "..coordinateNames", "..functionInputs", "..functionName", "..functionParameters", "..haulInfoToKeep", "..ind", "..newProcessName", "..processDirty", "..propertyDirty", "..stationInfoToKeep", "..validInd", "BootstrapID", "CruiseKey", "EDSU", "JavaJEXL2R", "Latitude", "Latitude2", "Layer", "LogOrigin", "LogOrigin2", "Longitude", "Longitude2", "PSU", "Package", "ProcessName", "ResampleFunction", "StoX", "Version", "attriributes<-", "binaryPath", "canShowInMap", "capture.output", "col2rgb", "colorRampPalette", "dataTable2SpatialPolygonsDataFrame", "dataType", "download.file", "functionName", "functionOutputDataType", "hasProcessData", "install.packages", "model", "modelName", "models", "name", "newVersion", "possibleValues", "processID", "processIndex", "processName", "processNames", "projectList", "projectList2.7", "projectPath", "projectPath2.7", "read.table", "remove.packages", "resampledCountWithUniqueName", "value"),
globalVariables = c(".", "..Cruise", "..DateTime", "..EDSUInfoToKeep", "..PSU", "..activeProcessID", "..clickPointNames", "..coordinateNames", "..functionInputs", "..functionName", "..functionParameters", "..haulInfoToKeep", "..ind", "..newProcessName", "..processDirty", "..propertyDirty", "..stationInfoToKeep", "..validInd", "BootstrapID", "CruiseKey", "EDSU", "JavaJEXL2R", "Latitude", "Latitude2", "Layer", "LogOrigin", "LogOrigin2", "Longitude", "Longitude2", "PSU", "Package", "ProcessName", "ResampleFunction", "StoX", "Version", "attriributes<-", "baselineTable", "binaryPath", "canShowInMap", "capture.output", "col2rgb", "colorRampPalette", "dataTable2SpatialPolygonsDataFrame", "dataType", "download.file", "functionName", "functionOutputDataType", "hasProcessData", "install.packages", "model", "modelName", "models", "name", "newVersion", "possibleValues", "processID", "processIndex", "processName", "processNames", "projectList", "projectList2.7", "projectPath", "projectPath2.7", "read.table", "remove.packages", "resampledCountWithUniqueName", "value"),
check = FALSE,
parallelTest = TRUE
))
Expand Down Expand Up @@ -174,15 +175,28 @@ RstoxBuild::buildRstoxPackage(
RstoxBuild::buildRstoxPackage(
"RstoxBuild",
version = "1.0",
Rversion = "3.5",
Rversion = "3.6",
check = FALSE,
imports = c("usethis", "devtools"),
importToNamespace = "data.table",
imports = c("usethis", "devtools", "data.table"),
suggests = c("Rstox", "png", "jpeg", "tiff", "rJava", "callr")
)






# Prepare StoX:
RstoxBuild::prepareStoX(
version = "current",
type = c("patch", "minor", "major")
)





convertGlobalVariables <- function(x = "~/ttt.txt") {
d <- unlist(lapply(readLines(x), strsplit, " ", fixed = TRUE))
d <- paste0("\"", paste0(d, collapse = "\", \""), "\"")
Expand Down
17 changes: 17 additions & 0 deletions Work/StoX3.0/Test.R
Original file line number Diff line number Diff line change
Expand Up @@ -4619,3 +4619,20 @@ TSB
# 2: 2.9.13 2.872358e+05 6.749699e+05
# 3: relative difference -1.345928e-01 -1.620029e-02






# Run example projects:
f <- list.dirs("~/Code/Github/RstoxFramework/testProjects/Used", recursive = FALSE)
system.time(d <- RstoxData::mapplyOnCores(RstoxFramework::runProject, NumberOfCores = 9, projectPath = f, close = TRUE))





pr <- c("~/Code/Github/RstoxFramework/testProjects/Used/BIAS_19_ICES", "~/Code/Github/RstoxFramework/testProjects/Used/cod_19", "~/Code/Github/RstoxFramework/testProjects/Used/haddock_19", "~/Code/Github/RstoxFramework/testProjects/Used/split_18", "~/Code/Github/RstoxFramework/testProjects/Used/tobis_20", "~/Code/Github/RstoxFramework/testProjects/Used/tobis_20_depth")
lapply(pr, runProject)


0 comments on commit 8e4c9d2

Please sign in to comment.