Skip to content

Commit

Permalink
Adding None return for functions which do not return anything (#192)
Browse files Browse the repository at this point in the history
* Adding unit tests

* Fixing CRAN issues

* Adding tensorflow authors in description

* Version bump

* Saving files anda data to tempdir

* Fixing build issues

* Adding None return for functions which do not return anything
  • Loading branch information
heemanshusuri authored Nov 11, 2019
1 parent 9f2ae19 commit e69eea0
Show file tree
Hide file tree
Showing 52 changed files with 161 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/compute.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ get_compute <- function(workspace, cluster_name) {
#' `create_aml_compute()` or `create_aks_compute()` call.
#' @param cluster The `AmlCompute` or `AksCompute` object.
#' @param show_output If `TRUE`, more verbose output will be provided.
#' @return None
#' @export
#' @seealso
#' `create_aml_compute()`, `create_aks_compute()`
Expand All @@ -148,6 +149,7 @@ wait_for_provisioning_completion <- function(cluster, show_output = FALSE) {
#' Remove the compute object from its associated workspace and delete the
#' corresponding cloud-based resource.
#' @param cluster The `AmlCompute` or `AksCompute` object.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand All @@ -172,6 +174,7 @@ delete_compute <- function(cluster) {
#' the cluster.
#' @param idle_seconds_before_scaledown An integer of the node idle time
#' in seconds before scaling down the cluster.
#' @return None
#' @export
#' @md
update_aml_compute <- function(cluster, min_nodes = NULL, max_nodes = NULL,
Expand Down Expand Up @@ -342,6 +345,7 @@ attach_aks_compute <- function(workspace,
#' underlying cloud resource will be deleted; the association will
#' just be removed.
#' @param cluster The `AksCompute` object.
#' @return None
#' @export
#' @md
detach_aks_compute <- function(cluster) {
Expand Down
1 change: 1 addition & 0 deletions R/datastore.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ register_azure_file_share_datastore <- function(workspace,
#' Unregister the datastore from its associated workspace. The
#' underlying Azure storage will not be deleted.
#' @param datastore The `AzureBlobDatastore` or `AzureFileDatastore` object.
#' @return None
#' @export
#' @md
unregister_datastore <- function(datastore) {
Expand Down
1 change: 1 addition & 0 deletions R/environment.R
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ container_registry <- function(address = NULL,
#' local, directory or custom url.
#' @param install_system_packages logical parameter to specify if system
#' packages should be installed at runtime.
#' @return Dockerfile string
generate_docker_file <- function(custom_docker_image = NULL,
cran_packages = NULL,
github_packages = NULL,
Expand Down
1 change: 1 addition & 0 deletions R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' @param conda_python_version version of python for conda environment
#' @param restart_session restart R session after installation
#' @param remove_existing_env delete the conda environment if already exists
#' @return None
#' @export
install_azureml <- function(version = "1.0.69",
envname = "r-azureml",
Expand Down
2 changes: 2 additions & 0 deletions R/keyvault.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @param keyvault The `Keyvault` object.
#' @param secrets The named list of secrets to be added to the keyvault,
#' where element name corresponds to the secret name.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -49,6 +50,7 @@ get_secrets <- function(keyvault, secrets) {
#' a specified set of secret names.
#' @param keyvault The `Keyvault` object.
#' @param secrets A vector of secret names.
#' @return None
#' @export
#' @md
delete_secrets <- function(keyvault, secrets) {
Expand Down
5 changes: 5 additions & 0 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ deserialize_to_model <- function(workspace, model_payload) {
#' you cannot delete a registered model that is being used by an active
#' web service deployment.
#' @param model The `Model` object.
#' @return None
#' @export
#' @md
delete_model <- function(model) {
Expand Down Expand Up @@ -345,6 +346,7 @@ get_model_package_creation_logs <- function(package,
#' After you've pulled the image, you can start a local container based
#' on this image using Docker commands.
#' @param package The `ModelPackage` object.
#' @return None
#' @export
#' @seealso
#' `package_model()`
Expand Down Expand Up @@ -372,6 +374,7 @@ pull_model_package_image <- function(package) {
#' @param package The `ModelPackage` object.
#' @param output_directory A string of the local directory that
#' will be created to contain the contents of the package.
#' @return None
#' @export
#' @seealso
#' `package_model()`, `get_model_package_container_registry()`
Expand All @@ -386,6 +389,7 @@ save_model_package_files <- function(package, output_directory) {
#' @param package The `ModelPackage` object.
#' @param show_output If `TRUE`, print more verbose output. Defaults to
#' `FALSE`.
#' @return None
#' @export
#' @md
wait_for_model_package_creation <- function(package, show_output = FALSE) {
Expand Down Expand Up @@ -476,6 +480,7 @@ inference_config <- function(entry_script,
#' the image.
#' @param source_directory paths to folders that contains all files to
#' create the image.
#' @return None
#' @noRd
generate_score_python_wrapper <- function(entry_script, source_directory) {
score_py_template <- sprintf("# This is auto-generated python wrapper.
Expand Down
16 changes: 16 additions & 0 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ get_run_metrics <- function(run) {
#' after submitting an experiment run with `submit_experiment()`.
#' @param run The `Run` object.
#' @param show_output If `TRUE`, print verbose output to console.
#' @return None
#' @export
#' @md
wait_for_run_completion <- function(run, show_output = TRUE) {
Expand Down Expand Up @@ -107,6 +108,7 @@ get_run <- function(experiment, run_id) {
#' @param name A string of the name of the artifact to be downloaded.
#' @param output_file_path A string of the local path where to download
#' the artifact to.
#' @return None
#' @export
#' @md
download_file_from_run <- function(run, name, output_file_path = NULL) {
Expand All @@ -129,6 +131,7 @@ download_file_from_run <- function(run, name, output_file_path = NULL) {
#' @param output_paths (Optional) A list of strings of the local filepaths
#' where the artifacts will be downloaded to.
#' @param batch_size An int of the number of files to download per batch.
#' @return None
#' @md
#' @export
download_files_from_run <- function(run, prefix = NULL, output_directory = NULL,
Expand Down Expand Up @@ -228,6 +231,7 @@ get_secrets_from_run <- function(run, secrets) {
#' @param value The value of the metric.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand All @@ -254,6 +258,7 @@ log_metric_to_run <- function(name, value, run = NULL) {
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @details
#' The calculation of the accuracy table is similar to the calculation of
Expand Down Expand Up @@ -318,6 +323,7 @@ log_accuracy_table_to_run <- function(name, value, description = "",
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @md
log_confusion_matrix_to_run <- function(name, value, description = "",
Expand All @@ -342,6 +348,7 @@ log_confusion_matrix_to_run <- function(name, value, description = "",
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @md
log_image_to_run <- function(name, path = NULL, plot = NULL,
Expand Down Expand Up @@ -377,6 +384,7 @@ log_image_to_run <- function(name, path = NULL, plot = NULL,
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -405,6 +413,7 @@ log_list_to_run <- function(name, value, description = "", run = NULL) {
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -438,6 +447,7 @@ log_predictions_to_run <- function(name, value, description = "", run = NULL) {
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -471,6 +481,7 @@ log_residuals_to_run <- function(name, value, description = "", run = NULL) {
#' to the current run from the service context.
#' @param ... Each named parameter generates a column with the value
#' specified.
#' @return None
#' @export
#' @examples
#' # Log an arbitrary tuple
Expand Down Expand Up @@ -507,6 +518,7 @@ log_row_to_run <- function(name, description = "", run = NULL, ...) {
#' @param description (Optional) A string of the metric description.
#' @param run The `Run` object. If not specified, will default
#' to the current run from the service context.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -535,6 +547,7 @@ log_table_to_run <- function(name, value, description = "", run = NULL) {
#' run details table will show up in the code chunk output
#' instead of the Viewer.
#' @param run The `Run` object.
#' @return None
#' @export
#' @md
view_run_details <- function(run) {
Expand Down Expand Up @@ -639,6 +652,7 @@ view_run_details <- function(run) {
#' @param timeout_seconds An int of the timeout in seconds for uploading
#' the files.
#' @param run The `Run` object.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -684,6 +698,7 @@ upload_files_to_run <- function(names, paths, timeout_seconds = NULL,
#' @param name A string of the name of the folder of files to upload.
#' @param path A string of the relative local path to the folder to upload.
#' @param run The `Run` object.
#' @return None
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -715,6 +730,7 @@ upload_folder_to_run <- function(name, path, run = NULL) {
#' @description
#' Mark the run as completed. Use for an interactive logging run.
#' @param run The `Run` object.
#' @return None
#' @export
#' @seealso
#' `start_logging_run()`
Expand Down
1 change: 1 addition & 0 deletions R/webservice-aci.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ aci_webservice_deployment_config <- function(cpu_cores = NULL,
#' @param enable_app_insights If `TRUE` enable AppInsights for the web service.
#' @param models A list of `Model` objects to package into the updated service.
#' @param inference_config An `InferenceConfig` object.
#' @return None
#' @export
#' @md
update_aci_webservice <- function(webservice,
Expand Down
1 change: 1 addition & 0 deletions R/webservice-aks.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ aks_webservice_deployment_config <- function(
#' the web service. If enabled, users can access the web service by fetching
#' an access token using their Azure Active Directory credentials.
#' Both `token_auth_enabled` and `auth_enabled` cannot be set to `TRUE`.
#' @return None
#' @export
#' @md
update_aks_webservice <- function(webservice, autoscale_enabled = NULL,
Expand Down
3 changes: 3 additions & 0 deletions R/webservice-local.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ local_webservice_deployment_config <- function(port = NULL) {
#' @param wait If `TRUE`, wait for the service's container to reach a
#' healthy state. Defaults to `FALSE`.
#' @param inference_config An `InferenceConfig` object.
#' @return None
#' @export
#' @md
update_local_webservice <- function(webservice, models = NULL,
Expand All @@ -57,6 +58,7 @@ update_local_webservice <- function(webservice, models = NULL,
#' @param delete_cache If `TRUE`, delete the temporary files cached for
#' the service.
#' @param delete_image If `TRUE`, delete the service's Docker image.
#' @return None
#' @export
#' @md
delete_local_webservice <- function(webservice,
Expand All @@ -77,6 +79,7 @@ delete_local_webservice <- function(webservice,
#' @param webservice The `LocalWebservice` object.
#' @param wait If `TRUE`, wait for the service's container to reach a
#' healthy state. Defaults to `FALSE`.
#' @return None
#' @export
#' @md
reload_local_webservice_assets <- function(webservice, wait = FALSE) {
Expand Down
3 changes: 3 additions & 0 deletions R/webservice.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ get_webservice <- function(workspace, name) {
#' `AksWebservice` object.
#' @param show_output If `TRUE`, print more verbose output. Defaults
#' to `FALSE`.
#' @return None
#' @export
#' @seealso
#' `deploy_model()`
Expand Down Expand Up @@ -89,6 +90,7 @@ get_webservice_keys <- function(webservice) {
#'
#' To delete a `LocalWebservice` see `delete_local_webservice()`.
#' @param webservice The `AciWebservice` or `AksWebservice` object.
#' @return None
#' @export
#' @md
delete_webservice <- function(webservice) {
Expand Down Expand Up @@ -137,6 +139,7 @@ invoke_webservice <- function(webservice, input_data) {
#' @param webservice The `AciWebservice` or `AksWebservice` object.
#' @param key_type A string of which key to regenerate. Options are
#' "Primary" or "Secondary".
#' @return None
#' @export
#' @md
generate_new_webservice_key <- function(webservice, key_type) {
Expand Down
3 changes: 3 additions & 0 deletions R/workspace.R
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ load_workspace_from_config <- function(path = NULL, file_name = NULL) {
#' resources, i.e. ACR, storage account, key value, and application insights
#' will also be deleted.
#' @param no_wait If `FALSE` do not wait for the workspace deletion to complete.
#' @return None
#' @export
#' @md
delete_workspace <- function(workspace,
Expand Down Expand Up @@ -220,6 +221,7 @@ list_workspaces <- function(subscription_id, resource_group = NULL) {
#' The parameter defaults to the current working directory.
#' @param file_name A string of the name to use for the config file. The
#' parameter defaults to `'config.json'`.
#' @return None
#' @export
#' @md
write_workspace_config <- function(workspace, path = NULL, file_name = NULL) {
Expand Down Expand Up @@ -314,6 +316,7 @@ get_workspace_details <- function(workspace) {
#' Set the default datastore associated with the workspace.
#' @param workspace The `Workspace` object.
#' @param datastore_name The name of the datastore to be set as default.
#' @return None
#' @export
#' @md
set_default_datastore <- function(workspace, datastore_name) {
Expand Down
3 changes: 3 additions & 0 deletions man/complete_run.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_compute.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_local_webservice.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_secrets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_webservice.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/delete_workspace.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e69eea0

Please sign in to comment.