# Path: utility/datafilepath.py
# class DataFilePath:
#     def __init__(self):
#     def getOrderDir_Train(self):  
#     def getOrderDir_Test1(self):  
#     def getTest1Dir(self):
#     def getTest2Dir(self):
#     def getTrainDir(self):
#     def getGapCsv_Train(self):
#     def getGapCsv_Test1(self):
#     def getTestset1Readme(self):
#     def getTestset2Readme(self):
#     def getGapFilename(self):
#     def getGapPredictionFileName(self):
#     def getPrevGapFileName(self):
#     def get_dir_name(self, data_dir):


from order import ExploreOrder
from utility.datafilepath import g_singletonDataFilePath
from weather import ExploreWeather
from traffic import ExploreTraffic
from poi import ExplorePoi
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import math
sns.set(color_codes=True)


class visualizeData(ExploreOrder, ExploreWeather, ExploreTraffic, ExplorePoi):
    def __init__(self):
        ExploreOrder.__init__(self)
        self.gapdf = self.load_gapdf(g_singletonDataFilePath.getTrainDir())
#         self.gap_time_dict = self.gapdf.groupby('time_slotid')['gap'].sum().to_dict()
        self.weathdf = self.load_weatherdf(g_singletonDataFilePath.getTrainDir())
#         self.trafficdf = self.load_trafficdf(g_singletonDataFilePath.getTrainDir())
#         self.gapDict = self.loadGapDict(g_singletonDataFilePath.getTrainDir() + 'temp/gap.csv.dict.pickle')
        return
    def disp_gap_bytimeiid(self):
        gaps_mean = self.gapdf.groupby('time_id')['gap'].mean()
        gaps_mean.plot(kind='bar')
        plt.ylabel('Mean of gap')
        plt.title('Timeslot/Correlation')
        return
    def disp_gap_bydistrict(self):
        gaps_mean = self.gapdf.groupby('start_district_id')['gap'].mean()
        gaps_mean.plot(kind='bar')
        plt.ylabel('Mean of gap')
        plt.title('District/Gap Correlation')
#         for i in gaps_mean.index:
#             plt.plot([i,i], [0, gaps_mean[i]], 'k-')
#         plt.show()

# Path: utility/datafilepath.py
# class DataFilePath:
#     def __init__(self):
#     def getOrderDir_Train(self):  
#     def getOrderDir_Test1(self):  
#     def getTest1Dir(self):
#     def getTest2Dir(self):
#     def getTrainDir(self):
#     def getGapCsv_Train(self):
#     def getGapCsv_Test1(self):
#     def getTestset1Readme(self):
#     def getTestset2Readme(self):
#     def getGapFilename(self):
#     def getGapPredictionFileName(self):
#     def getPrevGapFileName(self):
#     def get_dir_name(self, data_dir):


# Path: exploredata/visualization.py
from order import ExploreOrder
from utility.datafilepath import g_singletonDataFilePath
from weather import ExploreWeather
from traffic import ExploreTraffic
from poi import ExplorePoi
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import math

sns.set(color_codes=True)


class visualizeData(ExploreOrder, ExploreWeather, ExploreTraffic, ExplorePoi):
    def __init__(self):
        ExploreOrder.__init__(self)
        self.gapdf = self.load_gapdf(g_singletonDataFilePath.getTrainDir())
#         self.gap_time_dict = self.gapdf.groupby('time_slotid')['gap'].sum().to_dict()
        self.weathdf = self.load_weatherdf(g_singletonDataFilePath.getTrainDir())
#         self.trafficdf = self.load_trafficdf(g_singletonDataFilePath.getTrainDir())
#         self.gapDict = self.loadGapDict(g_singletonDataFilePath.getTrainDir() + 'temp/gap.csv.dict.pickle')
        return
    def disp_gap_bytimeiid(self):
        gaps_mean = self.gapdf.groupby('time_id')['gap'].mean()
        gaps_mean.plot(kind='bar')
        plt.ylabel('Mean of gap')
        plt.title('Timeslot/Correlation')
        return
    def disp_gap_bydistrict(self):
        gaps_mean = self.gapdf.groupby('start_district_id')['gap'].mean()
        gaps_mean.plot(kind='bar')
        plt.ylabel('Mean of gap')
        plt.title('District/Gap Correlation')
#         for i in gaps_mean.index:
#             plt.plot([i,i], [0, gaps_mean[i]], 'k-')
#         plt.show()

        return