Skip to content

Commit

Permalink
Merge pull request #3388 from infotroph/pecan-version-datafix
Browse files Browse the repository at this point in the history
Small fixes in PEcAn.all
  • Loading branch information
infotroph authored Oct 1, 2024
2 parents 89709f9 + f62c8ec commit cf02f05
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 58 deletions.
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ $(subst .doc/models/template,,$(MODELS_D)): .install/models/template
### Order-only dependencies
# (i.e. prerequisites must exist before building target, but
# target need not be rebuilt when a prerequisite changes)

.doc/base/all: | $(ALL_PKGS_D)
.install/base/all: | $(ALL_PKGS_I)
.check/base/all: | $(ALL_PKGS_C)
.test/base/all: | $(ALL_PKGS_T)

include Makefile.depends

clean:
Expand Down
3 changes: 1 addition & 2 deletions base/all/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Package: PEcAn.all
Type: Package
Title: PEcAn functions used for ecological forecasts and
reanalysis
Title: PEcAn Functions Used for Ecological Forecasts and Reanalysis
Version: 1.8.0.9000
Authors@R: c(person("Mike", "Dietze", role = c("aut"),
email = "[email protected]"),
Expand Down
24 changes: 13 additions & 11 deletions base/all/R/pecan_version.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,24 @@ pecan_version <- function(version = max(PEcAn.all::pecan_releases$version),
all_pkgs <- sessioninfo::package_info(pkgs = "installed", dependencies = FALSE)
our_pkgs <- all_pkgs[grepl("PEcAn", all_pkgs$package),]

# Why do we need this when `pkgs = "installed"` usually shows loaded too?
# Because there are times a package is loaded but not installed
# (e.g. notably during R CMD check)
all_loaded <- sessioninfo::package_info(pkgs = "loaded", dependencies = FALSE)
our_loaded <- all_loaded[grepl("PEcAn", all_loaded$package),]

unloaded <- our_pkgs[!our_pkgs$package %in% our_loaded$package,]
our_pkgs <- rbind(our_loaded, unloaded)
our_pkgs <- our_pkgs[order(our_pkgs$package),]


# TODO: consider using package_info's callouts of packages where loaded and
# installed versions mismatch -- it's a more elegant version of what we
# were trying for with the "multiple rows for packages with multiple
# versions found" behavior.
our_pkgs$installed <- ifelse(
test = is.na(our_pkgs$loadedversion),
yes = our_pkgs$ondiskversion,
no = our_pkgs$loadedversion)
our_pkgs <- our_pkgs[, c("package", "installed", "source")]
our_pkgs <- merge(
x = our_pkgs[, c("package", "ondiskversion", "source")],
y = our_loaded[, c("package", "loadedversion", "source")],
by.x = c("package", "ondiskversion", "source"),
by.y = c("package", "loadedversion", "source"),
all = TRUE,
sort = TRUE)
colnames(our_pkgs) <- c("package", "installed", "source")
our_pkgs$installed <- package_version(our_pkgs$installed)

} else {
Expand All @@ -89,7 +90,8 @@ pecan_version <- function(version = max(PEcAn.all::pecan_releases$version),
package = names(our_loaded),
installed = sapply(our_loaded, `[[`, "Version"))
our_loaded$installed <- package_version(our_loaded$installed)
our_pkgs <- merge(our_pkgs, our_loaded, all = TRUE)
our_pkgs <- merge(our_pkgs, our_loaded, all = TRUE, sort = TRUE)
our_pkgs <- our_pkgs[!duplicated(our_pkgs),]
}


Expand Down
5 changes: 5 additions & 0 deletions base/all/data/pecan_version_history.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ for (col in colnames(pecan_version_history)) {
strict = strict)
}
}

# Now remove local vars
# Yes, this really is needed: _all_ objects left defined at end of script
# will be added to the package data list!
rm(strict, na_version, col)
39 changes: 0 additions & 39 deletions base/all/tests/Rcheck_reference.log
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ New submission

Version contains large components (1.7.2.9000)

License components with restrictions and base license permitting such:
BSD_3_clause + file LICENSE
File 'LICENSE':
University of Illinois/NCSA Open Source License

Copyright (c) 2012, University of Illinois, NCSA. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal with the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimers.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
- Neither the names of University of Illinois, NCSA, nor the names
of its contributors may be used to endorse or promote products
derived from this Software without specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.

Strong dependencies not in mainstream repositories:
PEcAn.DB, PEcAn.settings, PEcAn.MA, PEcAn.logger, PEcAn.utils,
PEcAn.uncertainty, PEcAn.data.atmosphere, PEcAn.data.land,
Expand All @@ -54,13 +22,6 @@ Strong dependencies not in mainstream repositories:
Suggests or Enhances not in mainstream repositories:
PEcAn.ED2, PEcAn.SIPNET, PEcAn.BIOCRO, PEcAn.DALEC, PEcAn.LINKAGES,
PEcAn.allometry, PEcAn.photosynthesis

The Title field should be in title case. Current version is:
‘PEcAn functions used for ecological forecasts and reanalysis’
In title case that is:
‘PEcAn Functions Used for Ecological Forecasts and Reanalysis’

The Date field is over a month old.
* checking package namespace information ... OK
* checking package dependencies ... NOTE
Depends: includes the non-default packages:
Expand Down

0 comments on commit cf02f05

Please sign in to comment.