ices-tools-prod / icesTAF

Functions to support the ICES Transparent Assessment Framework
GNU General Public License v3.0
5 stars 7 forks source link

Run process.bib on software first #7

Closed colinpmillar closed 5 years ago

colinpmillar commented 5 years ago

User story: As a stock assessor, I want to use a non-standard pacakge in a DATA.bib script to download and process data.

Current behaviour is to process data first then software: https://github.com/ices-tools-prod/icesTAF/blob/a4841b398159d6ae59350770e84acfd8fd984325/R/taf.bootstrap.R#L82-L100

Can we do it the otherway around?

colinpmillar commented 5 years ago

Potential issue here is that DATA.bib scripts run in the bootstrap/data folder, and taf.library() can't see the library folder from there ...

colinpmillar commented 5 years ago

A possible solution is to use a package option that contains the working directory. This could be set at the start of sourceAll, or taf.boostrap to allow the workng directory to be accessible to taf.library() and process.bib(). You could include a wkdir argument to these functions to allow it to be overriden if required. Default would be wkdir=get.option("taf.wkdir")

This variable would be useful to a number of functions.

arni-magnusson commented 5 years ago

https://github.com/ices-tools-prod/icesTAF/issues/8#issuecomment-500410453

Current quick fix:

library(<package>, lib.loc = "../../library")
arni-magnusson commented 5 years ago

With 69fd530, taf.bootstrap processes SOFTWARE.bib before DATA.bib.