comses / miracle

Repeatable data analysis workflows for computational models
1 stars 3 forks source link

Django DeployR task does not retrieve unnamed R plots #70

Open warmdev opened 8 years ago

warmdev commented 8 years ago

Right now, the Django DeployR task only looks into the working directory to list and download files (using the /r/project/directory/list api). When plot outputs are named png files (such as in the luxedemo example), it gets figure1.png and ProjectWorkspace.rData.

When R scripts plot to the default graphic device (for example, by simply calling plot(x,y)), DeployR generates a temporary png file of the plot. This plot can be retrieved using the /r/project/execute/result/list api.

Parameters for this api (project id is the same project id used in the /r/project/directory/list api call, from the job status).

format = json
project = PROJECT-2b2112f8-ac1b-49d2-9242-8dbcf331ea4c
execution = null

Results

{
    "deployr": {
        "response": {
            "success": true,
            "httpcookie": "",
            "project": {
                "author": "miracle",
                "descr": "Job status: Completed.",
                "authors": [
                    "miracle"
                ],
                "lastmodified": 1464813981210,
                "cookie": null,
                "project": "PROJECT-2b2112f8-ac1b-49d2-9242-8dbcf331ea4c",
                "shared": false,
                "name": "fig_nBS_did-3 (Job)",
                "origin": "Project generated by job named,  fig_nBS_did-3.",
                "longdescr": null,
                "live": false
            },
            "call": "/r/project/execute/result/list",
            "execution": {
                "results": [
                    {
                        "length": 23325,
                        "url": "http://localhost:8000/deployr/r/project/execute/result/download/PROJECT-2b2112f8-ac1b-49d2-9242-8dbcf331ea4c/EXEC-454f57aa-a113-477f-be21-31b2e945ece5/unnamedplot001.png",
                        "phantom": false,
                        "filename": "unnamedplot001.png",
                        "execution": "EXEC-454f57aa-a113-477f-be21-31b2e945ece5",
                        "type": "image/png",
                        "md5": "7ad203d68885f755a418bdae62404bb0"
                    }
                ]
            }
        }
    }
}