Skip to content

Commit

Permalink
Add a new notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
einar90 committed Nov 24, 2016
1 parent 20a05f6 commit d8d91e1
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions tools/ipython_notebooks/python3/LogPlotter.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"metadata": {
"name": "",
"signature": "sha256:04e93c75a12ec21f1ab4c75eb40d6cb9d455d9821f45edfe5f1146aa0d403d4b"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"APPS"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from LogReader import PropertyUuidNameMapLog, CaseLog, SimulationLog, OptimizationLog, ProductionDataLog\n",
"from LogDataStructures import CaseContainer, Optimizer\n",
"\n",
"output_path=\"/home/einar/fo_out_20161122_apps/\"\n",
"name_map = PropertyUuidNameMapLog(output_path + \"log_property_uuid_name_map.csv\")\n",
"case_log = CaseLog(output_path + \"log_cases.csv\")\n",
"sim_log_1 = SimulationLog(output_path + \"rank1/log_simulation.csv\")\n",
"opt_log = OptimizationLog(output_path + \"log_optimization.csv\")\n",
"prod_log = ProductionDataLog(output_path + \"rank1/log_production_data.txt\")\n",
"\n",
"case_container = CaseContainer(case_log, name_map)\n",
"optimizer = Optimizer(opt_log, case_container)\n",
"\n",
"y1 = []\n",
"for case in optimizer.best_case_pr_iteration:\n",
" y1.append(case.objective_function_value)\n",
" \n",
"from matplotlib import pyplot as plt\n",
"plt.plot(y1)\n",
"plt.show()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 11
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"output_path=\"/home/einar/fo_out_20161118/\"\n",
"name_map = PropertyUuidNameMapLog(output_path + \"log_property_uuid_name_map.csv\")\n",
"case_log = CaseLog(output_path + \"log_cases.csv\")\n",
"sim_log_1 = SimulationLog(output_path + \"log_simulation.csv\")\n",
"opt_log = OptimizationLog(output_path + \"log_optimization.csv\")\n",
"prod_log = ProductionDataLog(output_path + \"log_production_data.txt\")\n",
"\n",
"case_container = CaseContainer(case_log, name_map)\n",
"optimizer = Optimizer(opt_log, case_container)\n",
"\n",
"y2 = []\n",
"for case in optimizer.best_case_pr_iteration:\n",
" y2.append(case.objective_function_value)\n",
" \n",
"from matplotlib import pyplot as plt\n",
"plt.plot(y2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 12,
"text": [
"[<matplotlib.lines.Line2D at 0x7f49ca7c0400>]"
]
}
],
"prompt_number": 12
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}

0 comments on commit d8d91e1

Please sign in to comment.