-
Notifications
You must be signed in to change notification settings - Fork 21
GettingStarted
It's not hard to run the opengrid code on your computer and start writing your own data analysis and visualization scripts. Just follow these steps below.
• On Linux:
sudo apt-get update
sudo apt-get install python-numpy python-pandas ipython python-pip
sudo pip install -U pip
sudo pip install opengrid
• If you are using Mac OS X El Capitan, you might run in to some errors when running sudo pip install opengrid
. This has to do with the default Python distribution on Mac using an older version of six, and it doesn't allow updates. The solution is to use a virtual environment: sudo pip install virtualenv
, virtualenv venv
. You can than activate this environment by running source venv/bin/activate
. You can then again try pip install opengrid
.
You need to install the following software and libraries (using pip). If it's not clear how to do this, we'll have to improve this wiki.
- python 2.7 with the following packages:
-
numpy
-
scipy
-
matplotlib
-
pandas
-
gspread
-
requests
-
requests_futures
-
ipython[notebook]
-
charts
-
python-forecastio
-
geopy
-
oauth2client
For Windows users it is highly recommended to install python via a fully featured python installer like Anaconda, python(x,y) or WinPython. Alternatively, you can download a scipy executable and install the other packages using the method below.
A requirements.txt containing all dependencies is available in opengrid/library. You can install all dependencies with the following command: ``pip install -r requirements.txt``.
- git (and a github account) (if on windows, you could install msysgit and then a git gui like tortoisegit)
- clone the opengrid repo (https://github.com/opengridcc/opengrid) to your hard drive.
- add the path to this repo (without the second /opengrid) to your PYTHONPATH environment variable
Docker is a container virtualization platform for linux. You can skip all of the installation steps by using docker. Should work also on mac and windows where docker is run in lightweight linux virtual machines.
Instructions:
- Install docker
- ./docker-build-dev.sh
- ./docker-run-dev.sh
Notebook kernel should be running at http://IP-OF-DOCKER-MACHINE:8888/ (IP-OF-DOCKER-MACHINE should be localhost on a linux with a local docker install)
We have a google spreadsheet with the meta-information of each participating household. This data is entered in a google form by the participants and can be accessed when the password to the opengrid google account is known.
- Obtain two files: opengrid.cfg and a json file. You can get this by sending an email to roel or another opengrid developer.
- Save both files to the opengrid/config folder
- Edit the opengrid.cfg file and adapt all paths to your personal computer
- in the /notebook folder, start an ipython notebook by typing
jupyter notebook
in a terminal. Now you get a browser tab with a list of possible ipython notebooks. Start the notebook *demo_houseprint.ipynb`` to sync the data and get an idea of the houseprint functionality.
On the opengrid server, we currently have a few jobs running that collect the monitoring data of all participants. This data is zipped and stored on a private webserver. You can obtain this data as follows.
- Fill in the required passwords in the opengrid.cfg file, as mentioned above
- Start an ipython notebook in the /scripts subfolder of the opengrid codebase. You can start a notebook by opening a command window or terminal in this folder and typing "ipython notebook". A new window should open in your browser with a list of the notebooks available in the /scripts folder. (In Windows, you can create (or copy a shortcut to Ipython notebook, with "starting directory" -under shortcut options- set to your /scripts folder)
- click on the Synchronize data notebook
- in the second cell, enter the path in which the data is to be saved (or fill it in in the config file)
- run the notebook (in the menu: cell-->run all or type shift-enter in both cells to execute them)
Now you're all set to run your first script. To be sure everything is working, try running one of the existing scripts, and then start hacking the code. Do not forget that most scripts have a Settings section in one of the first cells where you can specify runtime options.