Add events.json to SIPNET events.in converter#7
Conversation
Signed-off-by: Aritra Dey <adey01027@gmail.com>
| library(xml2) | ||
| }) | ||
|
|
||
| # ---- Vendored from PEcAn models/sipnet/R/write.events.SIPNET.R ------------- |
There was a problem hiding this comment.
can you help me understand - why not call PEcAn.SIPNET::write_events_sipnet? All of the information should be in events.json before write_events sipnet is called
There was a problem hiding this comment.
Yes,vendored it because PEcAn.model.SIPNET isn't installed in the pecan-all conda env on BU (got no pkg called PEcAn.model.SIPNET when I tried). vendoring was the quickest way to get a working test. And yes switch to calling PEcAn.SIPNET::write_events_sipnet directly if we get it added to pecan-all.
There was a problem hiding this comment.
Not sure is there a better way to this, maybe install it into pecan-all, or some other approach you'd prefer over vendoring?
There was a problem hiding this comment.
The package::function is PEcAn.SIPNET::write.events.SIPNET
As a general rule, we should not be copy-pasting functions. But there will be cases during development when we need a version of code that is not in the Conda environment, and you should be able to develop PEcAn while still using other packages in the environment.
Adds scripts/050_events_to_sipnet.R which converts events.json files (from #6) into SIPNET events.in format, with optional settings.xml patching to wire in ensemble paths. Tested on BU SCC , 11 events.in files, 677 events total from white_salinas_2020.
Note: #6 needs to be merged first.