Skip to content

Tutorial: Creating a new lab

Sharon Paradesi edited this page Aug 18, 2014 · 2 revisions
  1. Updates to openPDS server =============================

a. Create a task on openPDS: Write Python code to define a task for the lab's functionality.

b. Schedule the task on openPDS: Add the task to the Celery scheduler.

    CELERY_IMPORTS = (..., "oms_pds.hotspots_tasks")

    "hotspots-computation": {
        "task": "oms_pds.hotspots_tasks.findHotSpotsTask",
        "schedule": crontab(hour="*", minute="30")
    },

c. HTML visualization on openPDS: Write HTML code for lab visualizations.

d. JavaScript visualization on openPDS: Write JavaScript code (using backbone.js) for lab visualizations.

e. Routing on openPDS: Add path to HTML (visualization) to urls.py file.

    urlpatterns = patterns('oms_pds.visualization.views',
        ...,
        (r'^hotspots$', direct_to_template, { 'template' : 'visualization/hotspots.html' }),
    )
  1. Updates to the MIT mobile client ====================================

a. Add the lab to the pds_strings.xml file.

    <string name="living_labs_application_list">
                "[
                        ...,
                        {
                                'name': 'Hotspots',
                                'visualizations': [
                                        {'title': 'Hotspots of MIT community', 'key': 'hotspots', 'answers': ['hotspots'] }
                                ],
                                'answers': [
                                        { 'key': 'hotspots', 'data': ['Simple Location Probe'], 'purpose': ['Heatmaps'] }
                                ],
                                'about': 'Hotspots enables users to view a heatmap of locations frequented by the MIT community.',
                                'credits': 'This lab was developed as part of the big data initiative at MIT led by Prof. Sam Madden and Elizabeth Bruce. The Hotspots lab was developed by Sharon Paradesi under the guidance of Dr. Lalana Kagal.'
                        }
                ]"
    </string>