ebimodeling / ghgvc

Ecosystem Climate Regulation Services Calculator
http://www.ecosystemservicescalc.org
Other
48 stars 12 forks source link

Determine where we will put inputs and outputs #11

Closed dlebauer closed 8 years ago

dlebauer commented 10 years ago

some working directory can be assumed, then add run and out subdirectories.

these can be set in the config.xml as 1st level tags rundir and outdir, consistent with the use in PEcAn settings file (see wiki:)

When we want to save old runs, we can look more closely at the PEcAn approach (where a subdirectory corresponding to the runs.id field in BETYdb is auto-generated).

Currently, ruby writes out to $HOME/ghgvcR/inst and reads from $HOME/ghgvcR/inst/extdata. This is an artifact. These should all be replaced by run and out in the ruby code, and then when the ghgvcR script is run, the locations of these directories can be passed as arguments to the ghgvc_script, i.e.:

ghgvc_script.R $RUN $OUTPUT

This task requires modification of both the ruby and R code (see ghgvcR issue 1).

gsrohde commented 10 years ago

For now at least, the run and out directories are in ghgvc/tmp/.

dlebauer commented 10 years ago

presumably $HOME/ghgvc/tmp/?

dlebauer commented 10 years ago

@gsrohde can I assume that the R script will be running in ghgvc and therefore write to tmp/output.*?

gsrohde commented 10 years ago

ghgvc_script.R writes to the directory given as its second command-line parameter. The ghgvc rails app calls it with "#{Rails.root}/tmp/out" as the second parameter, so yes, tmp/out is where it writes to if it is run by the rails app. Whether there are other use cases where the R script would be run by something other than the rails app I don't know.

potterzot commented 8 years ago

I think this is done as well, pending review of whether you want the run and out folders in ghgvc/tmp/. For example, on my installation, the full path to the output folder is /opt/ghgvc/ghgvc/tmp/out/ and it contains ghgv.json and ghgv.csv. In contrast run/ contains biome.json and multisite_config.xml.

It's probably worth noting that these are not removed on exit, so when developing, we should be careful to remove them before rerunning the server or they can be misleading.