{ "metadata": { "name": "", "signature": "sha256:a2deadb84205b62c5447b4b4af3e8be54f836273bf67464f74d69bb8204dd0fd" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "%load_ext autoreload\n", "%autoreload 2\n", "%matplotlib inline" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [ "%run nb_init.py\n", "import IPython.core.display as disp\n", "import hdfgraph\n", "import pandas as pd" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "2014-11-14 14:49:45,649 -leg_joint -INFO -successfully imported leg_joint\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "!ls -lth /media/data/Simulations/\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "total 108K\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K juin 6 10:54 joint_2014-06-06T08_48_11\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K juin 2 09:35 1000_2014-06-02T07_34_15\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K juin 2 09:35 1001_2014-06-02T07_34_15\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K juin 2 09:35 1002_2014-06-02T07_34_15\r\n", "-rw-r--r-- 1 guillaume guillaume 1,1K mai 30 08:59 conditions.py\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:21 1009_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1002_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1006_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1008_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1000_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1003_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1004_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1007_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1001_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 26 00:20 1005_2014-05-25T22_18_54\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:07 0009_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0004_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0000_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0002_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0001_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0003_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0005_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0006_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0007_2014-05-24T09_04_38\r\n", "drwxr-xr-x 6 guillaume guillaume 4,0K mai 24 11:06 0008_2014-05-24T09_04_38\r\n", "drwxr-xr-x 2 guillaume guillaume 4,0K mars 23 2014 xml\r\n", "drwxr-xr-x 2 guillaume guillaume 4,0K mars 23 2014 blender\r\n" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "graph_dir = \"/media/data/Simulations/\"\n", "\n", "def get_lists(graph_dir, cond):\n", " dir_list = os.listdir(graph_dir)\n", " dir_list.sort()\n", " dir_list = [d for d in dir_list if cond(d)]\n", " png_dir_list = [os.path.join(graph_dir, d, 'png') for d in dir_list]\n", " svg_list = [os.path.join(graph_dir, d, 'svg', 'avg_rho_%s.svg' % d) for d in dir_list]\n", " json_list = [os.path.join(graph_dir, d, 'params_%s.json' %d) for d in dir_list]\n", " xml_list = [os.path.join(graph_dir, d, 'xml', 'after_apopto.xml') for d in dir_list]\n", " return (dir_list, png_dir_list, svg_list, json_list, xml_list)\n", "\n", "\n", "cond = lambda d: d.startswith('100') or d.startswith('000')\n", "dir_list, png_dir_list, svg_list, json_list, xml_list = get_lists(graph_dir, cond)\n", "\n", "conditions = pd.DataFrame(index=np.arange(len(json_list)),\n", " columns=['max_ci', 'radial_tension', 'num_cells', 'width_apopto', 'json'])\n", "\n", "for i, json_fname in enumerate(json_list):\n", " #continue\n", " with open(json_fname) as json_file:\n", " kwargs = json.load(json_file)\n", " print('index: {} => \\n'.format(i))\n", " conditions.loc[i, 'json'] = json_fname\n", " print('\\t max_ci: {}'.format(\n", " kwargs['post_kwargs']['max_ci']))\n", " conditions.loc[i, 'max_ci'] = kwargs['post_kwargs']['max_ci']\n", " \n", " print('\\t radial_tension : {}'.format(\n", " kwargs['apopto_kwargs']['radial_tension']))\n", " conditions.loc[i, 'radial_tension'] = kwargs['apopto_kwargs']['radial_tension']\n", " \n", " print('\\t num cells : {}'.format(\n", " kwargs['seq_kwargs']['num_cells']))\n", " conditions.loc[i, 'num_cells'] = kwargs['seq_kwargs']['num_cells']\n", " \n", " print('\\t width : {}'.format(\n", " kwargs['seq_kwargs']['width_apopto']))\n", " conditions.loc[i, 'width_apopto'] = kwargs['seq_kwargs']['width_apopto']\n", " print('\\n')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "index: 0 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 5\n", "\t width : 2.0\n", "\n", "\n", "index: 1 => \n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 10\n", "\t width : 2.0\n", "\n", "\n", "index: 2 => \n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 20\n", "\t width : 2.0\n", "\n", "\n", "index: 3 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 4 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.0\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 5 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.05\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 6 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.2\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 7 => \n", "\n", "\t max_ci: 0.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 8 => \n", "\n", "\t max_ci: 1.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 9 => \n", "\n", "\t max_ci: 2.0" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 30.0\n", "\n", "\n", "index: 10 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 5\n", "\t width : 2.0\n", "\n", "\n", "index: 11 => \n", "\n", "\t max_ci: 1.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 12 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 10\n", "\t width : 2.0\n", "\n", "\n", "index: 13 => \n" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "\t max_ci: 1.5\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 14 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 20\n", "\t width : 2.0\n", "\n", "\n", "index: 15 => \n", "\n", "\t max_ci: 3.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 16 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 17 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.0\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 18 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.05\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 19 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.2\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 20 => \n", "\n", "\t max_ci: 0.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 21 => \n", "\n", "\t max_ci: 1.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 2.0\n", "\n", "\n", "index: 22 => \n", "\n", "\t max_ci: 2.0\n", "\t radial_tension : 0.1\n", "\t num cells : 30\n", "\t width : 30.0\n", "\n", "\n" ] } ], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "conditions" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", " | max_ci | \n", "radial_tension | \n", "num_cells | \n", "width_apopto | \n", "json | \n", "
---|---|---|---|---|---|
0 | \n", "2 | \n", "0.1 | \n", "5 | \n", "2 | \n", "/media/data/Simulations/0000_2014-05-24T09_04_... | \n", "
1 | \n", "2 | \n", "0.1 | \n", "10 | \n", "2 | \n", "/media/data/Simulations/0001_2014-05-24T09_04_... | \n", "
2 | \n", "2 | \n", "0.1 | \n", "20 | \n", "2 | \n", "/media/data/Simulations/0002_2014-05-24T09_04_... | \n", "
3 | \n", "2 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0003_2014-05-24T09_04_... | \n", "
4 | \n", "2 | \n", "0 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0004_2014-05-24T09_04_... | \n", "
5 | \n", "2 | \n", "0.05 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0005_2014-05-24T09_04_... | \n", "
6 | \n", "2 | \n", "0.2 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0006_2014-05-24T09_04_... | \n", "
7 | \n", "0 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0007_2014-05-24T09_04_... | \n", "
8 | \n", "1 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/0008_2014-05-24T09_04_... | \n", "
9 | \n", "2 | \n", "0.1 | \n", "30 | \n", "30 | \n", "/media/data/Simulations/0009_2014-05-24T09_04_... | \n", "
10 | \n", "2 | \n", "0.1 | \n", "5 | \n", "2 | \n", "/media/data/Simulations/1000_2014-05-25T22_18_... | \n", "
11 | \n", "1 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1000_2014-06-02T07_34_... | \n", "
12 | \n", "2 | \n", "0.1 | \n", "10 | \n", "2 | \n", "/media/data/Simulations/1001_2014-05-25T22_18_... | \n", "
13 | \n", "1.5 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1001_2014-06-02T07_34_... | \n", "
14 | \n", "2 | \n", "0.1 | \n", "20 | \n", "2 | \n", "/media/data/Simulations/1002_2014-05-25T22_18_... | \n", "
15 | \n", "3 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1002_2014-06-02T07_34_... | \n", "
16 | \n", "2 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1003_2014-05-25T22_18_... | \n", "
17 | \n", "2 | \n", "0 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1004_2014-05-25T22_18_... | \n", "
18 | \n", "2 | \n", "0.05 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1005_2014-05-25T22_18_... | \n", "
19 | \n", "2 | \n", "0.2 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1006_2014-05-25T22_18_... | \n", "
20 | \n", "0 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1007_2014-05-25T22_18_... | \n", "
21 | \n", "1 | \n", "0.1 | \n", "30 | \n", "2 | \n", "/media/data/Simulations/1008_2014-05-25T22_18_... | \n", "
22 | \n", "2 | \n", "0.1 | \n", "30 | \n", "30 | \n", "/media/data/Simulations/1009_2014-05-25T22_18_... | \n", "