Skip to content

Instantly share code, notes, and snippets.

@robkooper
Created March 3, 2020 14:59
Show Gist options
  • Save robkooper/d099aec14397554dfdbdbdeb40f2bca5 to your computer and use it in GitHub Desktop.
Save robkooper/d099aec14397554dfdbdbdeb40f2bca5 to your computer and use it in GitHub Desktop.
PEcAn GSOC API

The goal of this project is to make more of PEcAn available as a REST API. Right now you will need to either use the web application or create a xml file that contains the information needed for a full workflow run. On top of that PEcAn has many other helpful functions available that are only programmatically available.

We would like for you to create an API that would allow users to interact with PEcAn from executing functions and retrieving the results, up to launching a full workflow. Using the latter we can now create a test system that will run workflows on a regular basis to test the whole of PEcAn.

Some work has already been done in the api package. I would like to make sure that we leverage of this work but I would like to propose we also use plumber which should making the RESTful API easier, and documented.

Initial Project

As a test project I would like the developer to create a small R Project that leverages of the plumber package as well as ggplot to create an endpoint that allows the user to create a graph of the function a*x^2 + b*x + c = y. Inputs to this function should be a, b and c variables as well as x0 and x1 to limit the range.

The function should trigger of two types of data requests, in case of text/json it should return a table that has 20 values from x0 to x1 with the results for x and y, or in case of an image/png it should return the actual image (as PNG ofcourse).

GSOC Project

As part of the GSOC I would like to see the ability to post all values to do a full run of the workflow, as well as a function to create a graph based on a workflow and some additional inputs. Other options are available as well, this up to the student.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment