Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can function 'create_job_df' account for types of simulation set up? #342

Open
CaitlinA opened this issue Oct 22, 2018 · 5 comments
Open
Assignees
Labels

Comments

@CaitlinA
Copy link
Member

I am currently working on the project for the SOILWAT app, where each site-scenario combo gets its own row in both the input master and the treatment design file. If you recall, this is due to unequal simulation periods between historical and future data.

I am experiencing an issue with the 'create_job_df' function. The error is:

[1] "rSFSW2's 'recreate_dbWork': started at 2018-10-22 18:58:36"
Error in create_dbWork(path, jobs = create_job_df(infer_sim_size, infer_include_YN)) : 
  number of items to replace is not a multiple of replacement length.

More specifically, it is because create_job_df sees the simulation as having 25 jobs, when I only have 5:

  print(sim_size)

$runsN_master
[1] 5

$runsN_total
[1] 5

$expN
[1] 5

jobs[, "runID_sites"] <- rep(seq_len(sim_size[["runsN_master"]]),
    times = max(sim_size[["expN"]], 1L))
  temp <- rep(include_YN, times = max(sim_size[["expN"]], 1L))

I know the CDI project is unique, but I could see there being other projects where there is one to one relationship between sites and treatments (as the treatment design file is intended for), not multiplicative, as expN implies in this function. What do you think @dschlaep ?

@dschlaep
Copy link
Member

There is a one-to-one relationship between sites and treatments. There is a multiplicative relationship between sites and experimental levels.

The expN = 5 suggests that you entered five experimental levels/rows in the file SWRuns_InputData_ExperimentalDesign_v08.csv -- these will be applied to each of the "run/site/rows" as defined by the SWRuns_InputMaster_YOURPROJECT_v11.csv as runsN_master = 5 which have to correspond to one row each in the file SWRuns_InputData_TreatmentDesign_v16.csv.

See also the question "How do I define experimental treatments?" in the vignette rSFSW2_FAQ.

@CaitlinA
Copy link
Member Author

CaitlinA commented Oct 23, 2018 via email

@dschlaep
Copy link
Member

Do you have outdated copies of SWRuns_InputAll_PreProcessed.rds and/or SFSW2_project_descriptions.rds?

The only way to get expN = 5 is to have five active rows in the experiment design input file. This object is set by the function determine_simulation_size:

expN <- NROW(sw_input_experimentals)

@CaitlinA
Copy link
Member Author

CaitlinA commented Oct 23, 2018 via email

@dschlaep
Copy link
Member

That's weird.

It may be a good start to figure out how your run ends up with expN = 5 even though fnames_in[["fexpDesign"]] has only 1 row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants