diff --git a/Makefile.depends b/Makefile.depends index a9177f70e18..b78fbb4052a 100644 --- a/Makefile.depends +++ b/Makefile.depends @@ -32,7 +32,7 @@ $(call depends,modules/assim.batch): | .install/base/db .install/base/logger .in $(call depends,modules/assim.sequential): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/base/visualization .install/base/workflow .install/modules/benchmark .install/modules/data.land .install/modules/data.remote .install/modules/uncertainty $(call depends,modules/benchmark): | .install/base/db .install/base/logger .install/base/settings .install/base/utils .install/modules/data.land $(call depends,modules/data.atmosphere): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils -$(call depends,modules/data.land): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/base/visualization .install/modules/benchmark .install/modules/data.atmosphere +$(call depends,modules/data.land): | .install/base/db .install/base/logger .install/base/remote .install/base/settings .install/base/utils .install/base/visualization .install/modules/benchmark $(call depends,modules/data.remote): | .install/base/db .install/base/logger .install/base/remote .install/base/utils $(call depends,modules/meta.analysis): | .install/base/db .install/base/logger .install/base/settings .install/base/utils $(call depends,modules/priors): | .install/base/logger .install/base/visualization .install/modules/meta.analysis diff --git a/docker/depends/pecan_package_dependencies.csv b/docker/depends/pecan_package_dependencies.csv index 207a546a5a3..b0a50c3bec3 100644 --- a/docker/depends/pecan_package_dependencies.csv +++ b/docker/depends/pecan_package_dependencies.csv @@ -261,7 +261,6 @@ "PEcAn.data.atmosphere","*","models/maespa","Imports",TRUE "PEcAn.data.atmosphere","*","models/preles","Imports",TRUE "PEcAn.data.atmosphere","*","models/sipnet","Depends",TRUE -"PEcAn.data.atmosphere","*","modules/data.land","Imports",TRUE "PEcAn.data.land","*","base/all","Depends",TRUE "PEcAn.data.land","*","base/workflow","Imports",TRUE "PEcAn.data.land","*","models/biocro","Imports",TRUE diff --git a/modules/data.land/DESCRIPTION b/modules/data.land/DESCRIPTION index cbb75244868..78b25fe9045 100644 --- a/modules/data.land/DESCRIPTION +++ b/modules/data.land/DESCRIPTION @@ -41,7 +41,6 @@ Imports: neonstore, swfscMisc, PEcAn.benchmark, - PEcAn.data.atmosphere, PEcAn.DB, PEcAn.logger, PEcAn.remote, diff --git a/modules/data.land/NEWS.md b/modules/data.land/NEWS.md index 72f7e85f573..f278f6b4bf3 100644 --- a/modules/data.land/NEWS.md +++ b/modules/data.land/NEWS.md @@ -8,6 +8,7 @@ ## Removed * `find.land()` has been removed. It is not used anywhere we know if, has apparently not been working for some time, and relied on the `maptools` package which is scheduled for retirement. +* Removed dependency on `PEcAn.data.atmosphere`, notably by retrieving site latitude and longitude directly from `PEcAn.DB::query.site` instead of custom lookups (#3300, Abhinav Pandey). # PEcAn.data.land 1.7.1 diff --git a/modules/data.land/R/ic_process.R b/modules/data.land/R/ic_process.R index 92256f6fe0d..2c402692835 100644 --- a/modules/data.land/R/ic_process.R +++ b/modules/data.land/R/ic_process.R @@ -50,7 +50,7 @@ ic_process <- function(settings, input, dir, overwrite = FALSE){ on.exit(PEcAn.DB::db.close(con), add = TRUE) #grab site lat and lon info - latlon <- PEcAn.data.atmosphere::db.site.lat.lon(site$id, con = con) + latlon <- PEcAn.DB::query.site(site$id, con = con)[c("lat", "lon")] # setup site database number, lat, lon and name and copy for format.vars if new input new.site <- data.frame(id = as.numeric(site$id), lat = latlon$lat, diff --git a/modules/data.land/R/soil_process.R b/modules/data.land/R/soil_process.R index 59c4dab6b26..585f08a4311 100644 --- a/modules/data.land/R/soil_process.R +++ b/modules/data.land/R/soil_process.R @@ -29,7 +29,7 @@ soil_process <- function(settings, input, dbfiles, overwrite = FALSE,run.local=T con <- PEcAn.DB::db.open(dbparms$bety) on.exit(PEcAn.DB::db.close(con), add = TRUE) # get site info - latlon <- PEcAn.data.atmosphere::db.site.lat.lon(site$id, con = con) + latlon <- PEcAn.DB::query.site(site$id, con = con)[c("lat", "lon")] new.site <- data.frame(id = as.numeric(site$id), lat = latlon$lat, lon = latlon$lon) diff --git a/modules/data.land/R/write_ic.R b/modules/data.land/R/write_ic.R index 84a379d036a..aa571472f6c 100644 --- a/modules/data.land/R/write_ic.R +++ b/modules/data.land/R/write_ic.R @@ -55,7 +55,7 @@ write_ic <- function(in.path, in.name, start_date, end_date, # read in registration xml for pool specific information register.xml <- system.file(paste0("register.", model$type, ".xml"), package = paste0("PEcAn.", model$type)) if(file.exists(register.xml)){ - register <- PEcAn.data.atmosphere::read.register(register.xml, con = NULL) + register <- XML::xmlToList(XML::xmlParse(register.xml)) }else{ PEcAn.logger::logger.warn("No model register file found") diff --git a/modules/data.land/tests/Rcheck_reference.log b/modules/data.land/tests/Rcheck_reference.log index e68bc5b2d1c..0923c588915 100644 --- a/modules/data.land/tests/Rcheck_reference.log +++ b/modules/data.land/tests/Rcheck_reference.log @@ -13,7 +13,7 @@ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE -Imports includes 35 non-default packages. +Imports includes 34 non-default packages. Importing from so many packages makes the package vulnerable to any of them becoming unavailable. Move as many as possible to Suggests and use conditionally.