You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/03/11 21:19:43 UTC

[airavata-django-portal] branch master updated: Documenting generate_data parameters

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/master by this push:
     new ce39667  Documenting generate_data parameters
ce39667 is described below

commit ce39667a68fb29609c9c21927e36aa99793d34cc
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Thu Mar 11 16:19:26 2021 -0500

    Documenting generate_data parameters
---
 docs/dev/custom_output_view_provider.md | 15 +++++++++++++++
 docs/tutorial/gateways_tutorial.md      | 12 +++++++-----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/docs/dev/custom_output_view_provider.md b/docs/dev/custom_output_view_provider.md
index c1b396a..b05bd61 100644
--- a/docs/dev/custom_output_view_provider.md
+++ b/docs/dev/custom_output_view_provider.md
@@ -89,6 +89,21 @@ def generate_data(self, request, experiment_output, experiment, output_file=None
     }
 ```
 
+The arguments to the `generate_data` function are described below:
+
+-   `request` -
+    [Django Request](https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest)
+    object.
+-   `experiment_output` - Airavata metadata about output file(s), see
+    [OutputDataObjectType doc](http://airavata.apache.org/api-docs/master/application_io_models.html#Struct_OutputDataObjectType).
+-   `experiment` - Airavata metadata about the experiment, see
+    [ExperimentModel doc](http://airavata.apache.org/api-docs/master/experiment_model.html#Struct_ExperimentModel).
+-   `output_file` - Python
+    [file-like object](https://docs.python.org/3/glossary.html#term-file-object).
+    Read from this file to process the contents of the output file.
+-   `output_files` - If the output type is URI_COLLECTION, then the collection
+    of files is given as a list of file-like objects.
+
 The required contents of the dictionary varies based on the _display type_.
 
 #### Display type link
diff --git a/docs/tutorial/gateways_tutorial.md b/docs/tutorial/gateways_tutorial.md
index fddeaf4..54d52b2 100644
--- a/docs/tutorial/gateways_tutorial.md
+++ b/docs/tutorial/gateways_tutorial.md
@@ -437,11 +437,13 @@ class GaussianEigenvaluesViewProvider:
     name = "Gaussian Eigenvalues"
 ```
 
-3. Now we implement the `generate_data` function. This function should return a
-   dictionary with values that are expected for this `display_type`. For a
-   display type of _image_, the required return values are _image_ which should
-   be a bytes array or file-like object with the image bytes and _mime-type_
-   which should be the image's mime type. Here's the `generate_data` function:
+3. Now we implement the
+   [`generate_data` function](../dev/custom_output_view_provider.md#output-view-provider-interface).
+   This function should return a dictionary with values that are expected for
+   this `display_type`. For a display type of _image_, the required return
+   values are _image_ which should be a bytes array or file-like object with the
+   image bytes and _mime-type_ which should be the image's mime type. Here's the
+   `generate_data` function:
 
 ```python
     def generate_data(self, request, experiment_output, experiment, output_file=None):