コード例 #1
0
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# Electricity Authority Weekly Report

import matplotlib as mpl

mpl.use("Agg")
import datetime as dt
from datetime import datetime, date, timedelta
import os
import pandas as pd
import matplotlib.pyplot as plt
import EAtools as ea

ea.set_options()
ea.ea_report_style()
connection = ea.DW_connect(linux=True)
mpl.rcParams["font.size"] = 24
mpl.rcParams["xtick.labelsize"] = 20  # setting tick label size
mpl.rcParams["ytick.labelsize"] = 20
mpl.rcParams["legend.fontsize"] = 20

# Hydro Risk Curves and current storage situation
path = """/home/dw/comit/data"""
os.chdir(path)

connection = ea.DW_connect(linux=True)

print "Getting COMIT and HRC data"
inflow_file = os.path.join("/home", "dw", "comit", "data", "inflows.pickle")
storage_file = os.path.join("/home", "dw", "comit", "data", "storage.pickle")
コード例 #2
0
                    default='http://www.comithydro.niwa.co.nz')
parser.add_argument('--comit_user',
                    action="store",
                    dest='comit_user',
                    default='ecomhyd12')
parser.add_argument('--comit_pass', action="store", dest='comit_pass')
parser.add_argument('--comit_path',
                    action="store",
                    dest='comit_path',
                    default='/home/dw/comit/')

IPy_notebook = False
if IPy_notebook == False:
    cmd_line = parser.parse_args()
if IPy_notebook == True:
    ea.set_options()

    class cmd_line():
        def __init__(self, comit_host, comit_user, comit_pass, comit_path):
            self.comit_host = comit_host
            self.comit_user = comit_user
            self.comit_pass = comit_pass
            self.comit_path = comit_path

    cmd_line = cmd_line('http://www.comithydro.niwa.co.nz', 'ecomhyd12',
                        'password', '/home/humed/python/comit/')

#############################################################################################################################################################################
#Setup logging
#############################################################################################################################################################################
コード例 #3
0
ファイル: comit.py プロジェクト: jcrabtree/comit
#############################################################################################################################################################################        
#Setup command line option and argument parsing
#############################################################################################################################################################################        

parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('--comit_host', action="store",dest='comit_host',default='http://www.comithydro.niwa.co.nz')
parser.add_argument('--comit_user', action="store",dest='comit_user',default='ecomhyd12')
parser.add_argument('--comit_pass', action="store",dest='comit_pass')
parser.add_argument('--comit_path', action="store",dest='comit_path',default='/home/dw/comit/')

IPy_notebook = False
if IPy_notebook == False:
    cmd_line = parser.parse_args()
if IPy_notebook == True:
    ea.set_options()
    class cmd_line():
        def __init__(self,comit_host,comit_user,comit_pass,comit_path):
            self.comit_host = comit_host
            self.comit_user = comit_user
            self.comit_pass = comit_pass
            self.comit_path = comit_path
    cmd_line=cmd_line('http://www.comithydro.niwa.co.nz','ecomhyd12','password','/home/humed/python/comit/')

#############################################################################################################################################################################        
#Setup logging
#############################################################################################################################################################################        

formatter = logging.Formatter('|%(asctime)-6s|%(message)s|','%Y-%m-%d %H:%M:%S')
consoleLogger = logging.StreamHandler()
consoleLogger.setLevel(logging.INFO)