Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Code Integration: Operations and Scenarios

R Convenience Functions

"Level 1" functions

saveCode(localFolder, codeRepo)

...

localFolder: folder or file on the local file system

codeRepo short, easily remembered remembered 'nickname' of code repository system.   If omitted, user's default is used.

TODO:   Do we need additional repository parameters (e.g. a folder within the repository) or can that/ those be made part of the codeRepo object?

...

Note: Code version is not recorded in the code metadata.

loadCode(id, localFolder)

parameters

id: ID of the object in Synapse

localFolder: location for local copy of code. If omitted, then a default location is used.

side effects

Checks Check out code from code repository, if not already checked out.  Otherwise, updates local copy from code repository.

"SourcesSource" code into R session.

returns

...

TODO: What if not all steps are successful?

saveAndExecute(localFolder, codeRepo)

parameters

localFolder: folder or file on the local file system

codeRepo short, easily remembered 'nickname' of code repository system. If omitted, user's default is used.

side effects

Register folder with code repository, if not already registered.

Commit code, retaining the version information.

Set a global "code.version" variable to the current version.

Create metadata in Synapse, if not already created.

"Source" code into R session.

TODO: Should the convenience function do something to run the code, or can we say it's the code's responsibility to run when it's sourced?

returns

ID of the object created in Synapse

Note: Code version is not recorded in the code metadata.

delete(id)

parameters

ID of the object in Synapse

side effects

Delete from the code repository.

Delete metadata from Synapse.

returns

Nothing.

TODO: What if not all steps are successful?

...

TODO: Should we delete from the local disk? From the R session?

Web Services

These manipulation only the metadata, stored in Synapse.
Note: It is assumed that code versions are represented by refererences.

...