Commit 5c2d105f authored by dasharatha.vamshi's avatar dasharatha.vamshi

init

parent e1e6add9
...@@ -16,3 +16,6 @@ FileNotFoundError: [WinError 3] The system cannot find the path specified: 'temp ...@@ -16,3 +16,6 @@ FileNotFoundError: [WinError 3] The system cannot find the path specified: 'temp
2021-03-02 19:17:47,686 INFO PreprocessWeatherData Reading Json file 2021-03-02 19:17:47,686 INFO PreprocessWeatherData Reading Json file
2021-03-02 19:17:47,696 INFO PreprocessWeatherData Writing forcast data to csv file at temp/mnt/ilens/ai-job//pipe1/run1/RunModel/input\data.csv 2021-03-02 19:17:47,696 INFO PreprocessWeatherData Writing forcast data to csv file at temp/mnt/ilens/ai-job//pipe1/run1/RunModel/input\data.csv
2021-03-02 19:17:47,701 INFO PreprocessWeatherData Component executed Successfully 2021-03-02 19:17:47,701 INFO PreprocessWeatherData Component executed Successfully
2021-03-02 19:23:52,747 INFO PreprocessWeatherData Reading Json file
2021-03-02 19:23:52,761 INFO PreprocessWeatherData Writing forcast data to csv file at temp/mnt/ilens/ai-job//pipe1/run1/RunModel/input\data.csv
2021-03-02 19:23:52,766 INFO PreprocessWeatherData Component executed Successfully
...@@ -32,27 +32,29 @@ class PreProcessComponent: ...@@ -32,27 +32,29 @@ class PreProcessComponent:
except: except:
logger.info("Failed reading Json File") logger.info("Failed reading Json File")
logger.info(traceback.format_exc()) logger.info(traceback.format_exc())
for i in data[PreprocessWeatherDataConstants.DAYS_KEY]: try:
self.date.append(i[PreprocessWeatherDataConstants.DATETIME_KEY]) for i in data[PreprocessWeatherDataConstants.DAYS_KEY]:
self.ds.append(int(i[PreprocessWeatherDataConstants.DATETIME_KEY].split("-")[1])) self.date.append(i[PreprocessWeatherDataConstants.DATETIME_KEY])
self.tempmax.append(i[PreprocessWeatherDataConstants.TEMPMAX_KEY]) self.ds.append(int(i[PreprocessWeatherDataConstants.DATETIME_KEY].split("-")[1]))
self.tempmin.append(i[PreprocessWeatherDataConstants.TEMPMIN_KEY]) self.tempmax.append(i[PreprocessWeatherDataConstants.TEMPMAX_KEY])
self.temp.append(i[PreprocessWeatherDataConstants.TEMP_KEY]) self.tempmin.append(i[PreprocessWeatherDataConstants.TEMPMIN_KEY])
self.humidity.append(i[PreprocessWeatherDataConstants.HUMIDITY_KEY]) self.temp.append(i[PreprocessWeatherDataConstants.TEMP_KEY])
self.precip.append(i[PreprocessWeatherDataConstants.PRECIP_KEY]) self.humidity.append(i[PreprocessWeatherDataConstants.HUMIDITY_KEY])
self.windspeed.append(i[PreprocessWeatherDataConstants.WINDSPEED_KEY]) self.precip.append(i[PreprocessWeatherDataConstants.PRECIP_KEY])
self.winddir.append(i[PreprocessWeatherDataConstants.WINDDIR_KEY]) self.windspeed.append(i[PreprocessWeatherDataConstants.WINDSPEED_KEY])
self.cloudcover.append(i[PreprocessWeatherDataConstants.CLOUDCOVER_KEY]) self.winddir.append(i[PreprocessWeatherDataConstants.WINDDIR_KEY])
self.visibility.append(i[PreprocessWeatherDataConstants.VISIBILITY_KEY]) self.cloudcover.append(i[PreprocessWeatherDataConstants.CLOUDCOVER_KEY])
forcast_data = pd.DataFrame( self.visibility.append(i[PreprocessWeatherDataConstants.VISIBILITY_KEY])
{"Maximum Temperature": self.tempmax, "Minimum Temperature": self.tempmin, "Temperature": self.temp, forcast_data = pd.DataFrame(
"Precipitation": self.precip, "Wind Speed": self.windspeed, "Wind Direction": self.winddir, {"Maximum Temperature": self.tempmax, "Minimum Temperature": self.tempmin, "Temperature": self.temp,
"Visibility": self.visibility, "Cloud Cover": self.cloudcover, "Precipitation": self.precip, "Wind Speed": self.windspeed, "Wind Direction": self.winddir,
"Relative Humidity": self.humidity, "month": self.ds}) "Visibility": self.visibility, "Cloud Cover": self.cloudcover,
forcast_data.fillna(method=null_value_method, inplace=True) "Relative Humidity": self.humidity, "month": self.ds})
forcast_data.index = self.date forcast_data.fillna(method=null_value_method, inplace=True)
return forcast_data forcast_data.index = self.date
return forcast_data
except:
logger.info(traceback.format_exc())
if __name__ == '__main__': if __name__ == '__main__':
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment