Skip to content

Commit

Permalink
Merge pull request #3300 from Sweetdevil144/gsoc-develop
Browse files Browse the repository at this point in the history
Remove dependency on `data.atmosphere` from `data.land`
  • Loading branch information
infotroph authored Jun 4, 2024
2 parents d906804 + 6116c09 commit a2445a5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile.depends
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docker/depends/pecan_package_dependencies.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion modules/data.land/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Imports:
neonstore,
swfscMisc,
PEcAn.benchmark,
PEcAn.data.atmosphere,
PEcAn.DB,
PEcAn.logger,
PEcAn.remote,
Expand Down
1 change: 1 addition & 0 deletions modules/data.land/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion modules/data.land/R/ic_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion modules/data.land/R/soil_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/data.land/R/write_ic.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion modules/data.land/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2445a5

Please sign in to comment.