PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
202 stars 230 forks source link

pecan_version: Report installation source for each package #3054

Closed infotroph closed 6 months ago

infotroph commented 1 year ago

Description

Uses the sources reported by sessioninfo::package_info; if sessioninfo isn't available* it falls back to the current behavior of only reporting versions.

Also adds a call to pecan_version to the default workflow, so that package versions get recorded in the run log.

Output on my machine before this change (and after it if sessioninfo weren't installed):

> PEcAn.all::pecan_version()
                  package v1.7.2  installed
3               PEcAn.all  1.7.2 1.7.2.9000
4         PEcAn.allometry  1.7.2      1.7.2
5       PEcAn.assim.batch  1.7.2      1.7.2
6  PEcAn.assim.sequential  1.7.2       <NA>
7            PEcAn.BASGRA  1.7.2      1.7.2
8         PEcAn.benchmark  1.7.2      1.7.2
9            PEcAn.BIOCRO  1.7.2      1.7.2
10            PEcAn.CABLE  1.7.2       <NA>
11            PEcAn.CLM45  1.7.2      1.7.2
14            PEcAn.DALEC  1.7.2      1.7.2
15  PEcAn.data.atmosphere  1.7.2      1.7.2
16   PEcAn.data.hydrology  1.7.2      1.7.2
17        PEcAn.data.land  1.7.2 1.7.2.9000
18      PEcAn.data.mining  1.7.2       <NA>
19      PEcAn.data.remote  1.7.2 1.7.2.9000
20               PEcAn.DB  1.7.2 1.7.2.9000
21        PEcAn.dvmdostem  1.7.2      1.7.2
23              PEcAn.ED2  1.7.2      1.7.2
24         PEcAn.emulator  1.7.2      1.7.2
25            PEcAn.FATES  1.7.2      1.7.2
26             PEcAn.GDAY  1.7.2      1.7.2
28            PEcAn.JULES  1.7.2      1.7.2
29            PEcAn.LDNDC   <NA>      1.7.2
30         PEcAn.LINKAGES  1.7.2      1.7.2
31           PEcAn.logger  1.8.0      1.8.1
32         PEcAn.LPJGUESS  1.7.2      1.7.2
33               PEcAn.MA  1.7.2      1.7.2
34             PEcAn.MAAT  1.7.2      1.7.2
35           PEcAn.MAESPA  1.7.2      1.7.2
36        PEcAn.ModelName  1.7.2      1.7.2
37   PEcAn.photosynthesis  1.7.2       <NA>
38           PEcAn.PRELES  1.7.2      1.7.2
39           PEcAn.priors  1.7.2      1.7.2
40             PEcAn.qaqc  1.7.2      1.7.2
41           PEcAn.remote  1.7.2      1.7.2
43         PEcAn.settings  1.7.2      1.7.2
44          PEcAn.SIBCASA   <NA>      0.0.1
45           PEcAn.SIPNET  1.7.2      1.7.2
46            PEcAn.STICS  1.7.2      1.7.2
47      PEcAn.uncertainty  1.7.2      1.7.2
48            PEcAn.utils  1.7.2      1.7.2
49    PEcAn.visualization  1.7.2      1.7.2
50         PEcAn.workflow  1.7.2      1.7.2
52               PEcAnRTM  1.7.2      1.7.2

Output on my machine after this change:

> PEcAn.all::pecan_version()
                  package v1.7.2  installed                                        source
3               PEcAn.all  1.7.2 1.7.2.9000                                         local
4         PEcAn.allometry  1.7.2      1.7.2                                         local
5       PEcAn.assim.batch  1.7.2      1.7.2 https://pecanproject.r-universe.dev (R 4.2.1)
6  PEcAn.assim.sequential  1.7.2       <NA>                                          <NA>
7            PEcAn.BASGRA  1.7.2      1.7.2                                         local
8         PEcAn.benchmark  1.7.2      1.7.2                                         local
9            PEcAn.BIOCRO  1.7.2      1.7.2                                         local
10            PEcAn.CABLE  1.7.2       <NA>                                          <NA>
11            PEcAn.CLM45  1.7.2      1.7.2                                         local
14            PEcAn.DALEC  1.7.2      1.7.2                                         local
15  PEcAn.data.atmosphere  1.7.2      1.7.2 https://pecanproject.r-universe.dev (R 4.2.1)
16   PEcAn.data.hydrology  1.7.2      1.7.2                                         local
17        PEcAn.data.land  1.7.2 1.7.2.9000                                         local
18      PEcAn.data.mining  1.7.2       <NA>                                          <NA>
19      PEcAn.data.remote  1.7.2 1.7.2.9000                                         local
20               PEcAn.DB  1.7.2 1.7.2.9000                                         local
21        PEcAn.dvmdostem  1.7.2      1.7.2                                         local
23              PEcAn.ED2  1.7.2      1.7.2                                         local
24         PEcAn.emulator  1.7.2      1.7.2                                         local
25            PEcAn.FATES  1.7.2      1.7.2                                         local
26             PEcAn.GDAY  1.7.2      1.7.2                                         local
28            PEcAn.JULES  1.7.2      1.7.2                                         local
29            PEcAn.LDNDC   <NA>      1.7.2                                         local
30         PEcAn.LINKAGES  1.7.2      1.7.2                                         local
31           PEcAn.logger  1.8.0      1.8.1 https://pecanproject.r-universe.dev (R 4.2.1)
32         PEcAn.LPJGUESS  1.7.2      1.7.2                                         local
33               PEcAn.MA  1.7.2      1.7.2                                         local
34             PEcAn.MAAT  1.7.2      1.7.2                                         local
35           PEcAn.MAESPA  1.7.2      1.7.2                                         local
36        PEcAn.ModelName  1.7.2      1.7.2                                         local
37   PEcAn.photosynthesis  1.7.2       <NA>                                          <NA>
38           PEcAn.PRELES  1.7.2      1.7.2                                         local
39           PEcAn.priors  1.7.2      1.7.2                                         local
40             PEcAn.qaqc  1.7.2      1.7.2                                         local
41           PEcAn.remote  1.7.2      1.7.2                                         local
43         PEcAn.settings  1.7.2      1.7.2                                         local
44          PEcAn.SIBCASA   <NA>      0.0.1                                         local
45           PEcAn.SIPNET  1.7.2      1.7.2                                         local
46            PEcAn.STICS  1.7.2      1.7.2                                         local
47      PEcAn.uncertainty  1.7.2      1.7.2 https://pecanproject.r-universe.dev (R 4.2.1)
48            PEcAn.utils  1.7.2      1.7.2                                         local
49    PEcAn.visualization  1.7.2      1.7.2                                         local
50         PEcAn.workflow  1.7.2      1.7.2                                         local
52               PEcAnRTM  1.7.2      1.7.2                                         local

*I think most PEcAn machines can be assumed to have sessioninfo; it's required by devtools. But this way we avoid a hard dependency.

Motivation and Context

Review Time Estimate

Types of changes

Checklist:

infotroph commented 1 year ago

Test failures indicate a thinko in my test approach: Assumes PEcAn.all is already installed, so works during package check (R CMD check installs it to a temp library) but not when testing with testthat before installation (which loads the code into an R session but doesn’t change the output from packageVersion).

Marking this as draft while I think more; suggestions welcome in the meantime