Commit 1121848a authored by dasharatha.vamshi's avatar dasharatha.vamshi

pkl

parent bd353ed9
......@@ -10,10 +10,11 @@ from scripts.common.logsetup import logger
class PreProcessComponent:
def __init__(self):
self.ds, self.tempmax, self.tempmin, self.temp, self.humidity, self.precip, self.winddir, self.cloudcover, self.visibility, self.date, self.windspeed = ([] for i in range(11))
self.ds, self.tempmax, self.tempmin, self.temp, self.humidity, self.precip, self.winddir, self.cloudcover, self.visibility, self.date, self.windspeed = (
[] for i in range(11))
def read_pickle_file(self, file):
logger.info("Parsing the pickle file at location "+file)
logger.info("Parsing the pickle file at location " + file + " ......")
return pickle.load(open(file, "rb"))
def preprocess(self, forcast_json, standard_scalar_pkl_path, null_value_method):
......@@ -61,7 +62,7 @@ if __name__ == '__main__':
# Checking pickle path for standard scalar
if PreProcessConstants.STANDARD_SCALAR_PATH in config.keys():
standard_scalar_path = config[PreProcessConstants.STANDARD_SCALAR_PATH]
if standard_scalar_path is None:
if len(standard_scalar_path) < 5:
standard_scalar_path = "StandardScaler.pkl"
else:
pass
......
......@@ -30,7 +30,7 @@ LOGSTASH_PORT = str(_config.get('SERVICE_CONFIG', {}).get('LOGSTASH_PORT'))
# os.environ["json_path"] = r"E:\welspun-defects\preprocess_data-ilendev\response.json"
# os.environ["fillna_method"] = "ffill"
# os.environ["standard_scalar_path"] = r"E:\welspun-defects\preprocess_data-ilendev\StandardScaler.pkl"
print(os.getcwd())
# print(os.getcwd())
PKL_path = os.path.join(os.getcwd(), 'StandardScaler.pkl')
config = {
"shared_volume": os.environ.get("shared_volume"),
......
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