PecanProject / pecan

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

Issue with write.config.MODEL w/ PFT w/ only a single prior / param #776

Open serbinsh opened 8 years ago

serbinsh commented 8 years ago

Running a model with a single prior / param seems to result in a improperly formated trait.samples() object to write.config.MODEL.

2016-04-04 16:46:05 INFO   [run.write.configs] :
   Selected Quantiles: '0.159','0.5','0.841'
2016-04-04 16:46:05 INFO   [run.write.configs] :
   ----- Writing model run config files ----

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-median

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-median': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-median/logs': File exists
[1] 73.6921
NULL
NULL

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159/logs': File exists
            Vcmax
73.69210 72.33965
NULL
NULL

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841/logs': File exists
            Vcmax
73.69210 75.04328
NULL
NULL

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/ENS-00001

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/ENS-00001': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/ENS-00001/logs': File exists
[1] 73.6921
NULL
NULL
2016-04-04 16:46:05 INFO   [run.write.configs] :
   ###### Finished writing model run config files #####

Note that despite only running with Vcmax the object expects two params resulting in a blank value or the median being copied together with the quantile value. If I then add, say, SLA to the pft then the expected behavior is the result

2016-04-04 16:52:54 INFO   [run.write.configs] :
   Selected Quantiles: '0.159','0.5','0.841'
2016-04-04 16:52:54 INFO   [run.write.configs] :
   ----- Writing model run config files ----

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-median

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-median': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-median/logs': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 16.9
  ..$ Vcmax: num 73.7
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA   Vcmax
50 16.94213 73.6921
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-SLA-0.159

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-SLA-0.159': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 16.8
  ..$ Vcmax: num 73.7
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA   Vcmax
50 16.82486 73.6921
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-SLA-0.841

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-SLA-0.841': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 17.1
  ..$ Vcmax: num 73.7
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA   Vcmax
50 17.05622 73.6921
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.159/logs': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 16.9
  ..$ Vcmax: num 72.3
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA    Vcmax
50 16.94213 72.33965
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/SA-maat.all.plants-Vcmax-0.841/logs': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 16.9
  ..$ Vcmax: num 75
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA    Vcmax
50 16.94213 75.04328
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"

Run directory:
/data/sserbin/Modeling/maat/maat_test//run/ENS-00001

Run scripts directory:
/data/software/maat/dev_ngeet//run_scripts

Source directory:
/data/software/maat/dev_ngeet//src

mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/ENS-00001': File exists
mkdir: cannot create directory `/data/sserbin/Modeling/maat/maat_test//run/ENS-00001/logs': File exists
List of 2
 $ maat.all.plants:'data.frame':    1 obs. of  2 variables:
  ..$ SLA  : num 16.9
  ..$ Vcmax: num 73.7
 $ env            :'data.frame':    1 obs. of  0 variables
        SLA   Vcmax
50 16.94213 73.6921
[1] "SLA"   "Vcmax"
[1] "SLA"   "Vcmax"
2016-04-04 16:52:55 INFO   [run.write.configs] :
   ###### Finished writing model run config files #####

There is no more NULL when trying to display print(trait.values[[settings$pfts$pft$name]]) ##HAACK OR traits <- convert.samples.MAAT(trait.samples = trait.values[[settings$pfts$pft$name]]) print(traits)

Which is this function:

convert.samples.MAAT <- function(trait.samples){

    if(is.list(trait.samples)) trait.samples <- as.data.frame(trait.samples)
    ## first rename variables
    trait.names <- colnames(trait.samples)
    print(trait.names)
}
serbinsh commented 8 years ago

@dlebauer when you were working up BIOCRO did you notice anything like this?

dlebauer commented 8 years ago

I've seen the 'cannot create directory' errors in the last few weeks but if I recall I 'solved' it by changing permissions to allow write access. I didn't realize it was a bigger problem. On Mon, Apr 4, 2016 at 4:01 PM Shawn P. Serbin notifications@github.com wrote:

@dlebauer https://github.com/dlebauer when you were working up BIOCRO did you notice anything like this?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/PecanProject/pecan/issues/776#issuecomment-205495066

mdietze commented 8 years ago

I suspect the code is balking to run a single parameter PFT because R is automatically changing the type of a data object somewhere from data.frame or matrix to vector.

serbinsh commented 8 years ago

@mdietze Yeah, I think you are correct. Will have to go back further in the code to see if we can suss this type change out. However, running with two priors works fine.

tonygardella commented 8 years ago

I'll be adding instructions in the "Adding an Ecosystem" page in gitbook to associate two priors with a pft for a given model before writing write.configs.

Also, leave this open for reference.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 365 days with no activity.