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
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,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:
except:
logger.info("Failed reading Json File")
logger.info(traceback.format_exc())
for i in data[PreprocessWeatherDataConstants.DAYS_KEY]:
self.date.append(i[PreprocessWeatherDataConstants.DATETIME_KEY])
self.ds.append(int(i[PreprocessWeatherDataConstants.DATETIME_KEY].split("-")[1]))
self.tempmax.append(i[PreprocessWeatherDataConstants.TEMPMAX_KEY])
self.tempmin.append(i[PreprocessWeatherDataConstants.TEMPMIN_KEY])
self.temp.append(i[PreprocessWeatherDataConstants.TEMP_KEY])
self.humidity.append(i[PreprocessWeatherDataConstants.HUMIDITY_KEY])
self.precip.append(i[PreprocessWeatherDataConstants.PRECIP_KEY])
self.windspeed.append(i[PreprocessWeatherDataConstants.WINDSPEED_KEY])
self.winddir.append(i[PreprocessWeatherDataConstants.WINDDIR_KEY])
self.cloudcover.append(i[PreprocessWeatherDataConstants.CLOUDCOVER_KEY])
self.visibility.append(i[PreprocessWeatherDataConstants.VISIBILITY_KEY])
forcast_data = pd.DataFrame(
{"Maximum Temperature": self.tempmax, "Minimum Temperature": self.tempmin, "Temperature": self.temp,
"Precipitation": self.precip, "Wind Speed": self.windspeed, "Wind Direction": self.winddir,
"Visibility": self.visibility, "Cloud Cover": self.cloudcover,
"Relative Humidity": self.humidity, "month": self.ds})
forcast_data.fillna(method=null_value_method, inplace=True)
forcast_data.index = self.date
return forcast_data
try:
for i in data[PreprocessWeatherDataConstants.DAYS_KEY]:
self.date.append(i[PreprocessWeatherDataConstants.DATETIME_KEY])
self.ds.append(int(i[PreprocessWeatherDataConstants.DATETIME_KEY].split("-")[1]))
self.tempmax.append(i[PreprocessWeatherDataConstants.TEMPMAX_KEY])
self.tempmin.append(i[PreprocessWeatherDataConstants.TEMPMIN_KEY])
self.temp.append(i[PreprocessWeatherDataConstants.TEMP_KEY])
self.humidity.append(i[PreprocessWeatherDataConstants.HUMIDITY_KEY])
self.precip.append(i[PreprocessWeatherDataConstants.PRECIP_KEY])
self.windspeed.append(i[PreprocessWeatherDataConstants.WINDSPEED_KEY])
self.winddir.append(i[PreprocessWeatherDataConstants.WINDDIR_KEY])
self.cloudcover.append(i[PreprocessWeatherDataConstants.CLOUDCOVER_KEY])
self.visibility.append(i[PreprocessWeatherDataConstants.VISIBILITY_KEY])
forcast_data = pd.DataFrame(
{"Maximum Temperature": self.tempmax, "Minimum Temperature": self.tempmin, "Temperature": self.temp,
"Precipitation": self.precip, "Wind Speed": self.windspeed, "Wind Direction": self.winddir,
"Visibility": self.visibility, "Cloud Cover": self.cloudcover,
"Relative Humidity": self.humidity, "month": self.ds})
forcast_data.fillna(method=null_value_method, inplace=True)
forcast_data.index = self.date
return forcast_data
except:
logger.info(traceback.format_exc())
if __name__ == '__main__':
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