Datenstrukturen und Auswertung angepasst
This commit is contained in:
20
src/paveit/labtest/base.py
Normal file → Executable file
20
src/paveit/labtest/base.py
Normal file → Executable file
@@ -118,6 +118,19 @@ class DataSineLoad():
|
||||
self.filehash = calc_hash_of_bytes(self.data)
|
||||
self.data.seek(0)
|
||||
self._logger.debug(f'Hash of file: {self.filehash}')
|
||||
|
||||
def _define_data_models(self):
|
||||
pass
|
||||
|
||||
def _data_in_db(self):
|
||||
|
||||
nsamples = self._datamodel.objects(filehash = self.filehash).count()
|
||||
|
||||
if nsamples>0:
|
||||
self.file_in_db = True
|
||||
else:
|
||||
self.file_in_db = False
|
||||
|
||||
|
||||
def _process_data(self):
|
||||
""" convert self.data (BytesIO) to pandas.DataFrame, update
|
||||
@@ -194,8 +207,11 @@ class DataSineLoad():
|
||||
return
|
||||
|
||||
for col in sel.columns:
|
||||
self.data[col] = pd.to_numeric(self.data[col].str.replace(
|
||||
try:
|
||||
self.data[col] = pd.to_numeric(self.data[col].str.replace(
|
||||
',', '.'))
|
||||
except:
|
||||
pass
|
||||
|
||||
def _post_apply_units(self):
|
||||
|
||||
@@ -342,6 +358,8 @@ class DataSineLoad():
|
||||
self._read_from_s3_to_bytesio()
|
||||
|
||||
self._calc_hash_of_bytesio()
|
||||
self._define_data_models()
|
||||
self._data_in_db()
|
||||
self._which_machine()
|
||||
self._set_parameter()
|
||||
self.update_parameter()
|
||||
|
||||
Reference in New Issue
Block a user