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

switch to nested args in viz.yaml #25

Merged
merged 6 commits into from
Jun 21, 2016

Conversation

aappling-usgs
Copy link
Member

@aappling-usgs aappling-usgs commented Jun 20, 2016

NEW for fetchData, processData, and visualizeData:
(@lindsaycarr, @jread-usgs, @jiwalker-usgs, @lawinslow)

  1. All args given in the args block of a viz.yaml item are passed through by their names to their fetch/process/visualize function.
  2. Args in the args block are placed in quotes - i.e., they're all characters, consistent with other fields in the viz.yaml. Convert and/or evaluate them within your functions as needed.
  3. fetch/process/visualize functions can no longer expect to be handed a data.info arg
  4. fetchData.sciencebase and fetchTimestamp.sciencebase and fetchData.url need their args to be within the args block rather than on the same level as other info for an item.

Example:

# viz.yaml
fetch
  -
    id: Cuyahoga
    location: cache/fetch/CuyahogaTDS.csv
    fetcher: sciencebase
    args:
      remoteItemId: 575d839ee4b04f417c2a03fe
      remoteFilename: CuyahogaTDS.csv
    mimeType: text/csv
# function definition
fetchData.sciencebase <- function(viz.id, remoteItemId, remoteFilename, ..., outfile) {
  ...
}
# fetch.make
cache/fetch/CuyahogaTDS.csv: vizlab/make/timestamps/Cuyahoga.txt
    export R_LIBS_USER=$(RLIBSUSER);\
    ${RBATCH} "--args fun=fetchData funargs=list(viz.id='Cuyahoga',remoteItemId='575d839ee4b04f417c2a03fe',remoteFilename='CuyahogaTDS.csv',outfile='cache/fetch/CuyahogaTDS.csv')" \
    vizlab/make/callFunction.R vizlab/make/log/fetch/Cuyahoga.Rout

based on recent use cases and discussion in #5

@coveralls
Copy link

Coverage Status

Coverage remained the same at 0.0% when pulling c36d356 on aappling-usgs:master into c4a2722 on USGS-VIZLAB:master.

@lawinslow
Copy link

args block seems good to me.

@lindsayplatt
Copy link

Sounds like we are good to merge @aappling-usgs ?

@aappling-usgs
Copy link
Member Author

great, let's do it.

@aappling-usgs aappling-usgs merged commit d70aa66 into USGS-VIZLAB:master Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants