From 260f1021863a00c3bf36e41a59b179ad8c04883c Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 12 Apr 2022 13:16:48 -0500 Subject: [PATCH] bug fixes, added logger (not yet using though) --- data/__init__.py | 12 ------------ data/maker/__init__.py | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/data/__init__.py b/data/__init__.py index 0f84ec8..2b4a6aa 100644 --- a/data/__init__.py +++ b/data/__init__.py @@ -3,15 +3,3 @@ from data.params import SYS_ARGS import transport from multiprocessing import Process, Queue from data.maker import prepare - -class Trainer (Process) : - pass -class Maker(Process): - pass - -if __name__ == '__main__' : - - logger = transport.factory.instance(SYS_ARGS['store']['logger']) - - - \ No newline at end of file diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 9d3bdb5..d91c89e 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -207,9 +207,11 @@ class Learner(Process): self.gpu = int(_args['gpu']) else: self.gpu = None + self.info = _args['info'] self.columns = self.info['columns'] if 'columns' in self.info else None self.store = _args['store'] + self.logger = transport.factory.instance(_args['logger']) if 'logger' in self.store else transport.factory.instance(provider='console',context='write',lock=True) if 'network_args' not in _args : self.network_args ={ 'context':_args['context'] if 'context' in _args else 'GENERAL', @@ -379,11 +381,15 @@ class Generator (Learner): _store = self.store['target'] if 'target' in self.store else {'provider':'console'} _store['lock'] = True + _store['context'] = 'write' #-- Just in case writer = transport.factory.instance(**_store) for _iodf in _candidates : _df = self._df.copy() _df[self.columns] = _iodf[self.columns] + # + #@TODO: + # Improve formatting with better post-processing pipeline if 'approximate' in self.info : _df = self.approximate(_df) if 'make_date' in self.info :