Datenstrukturen und Auswertung angepasst

This commit is contained in:
Markus Clauß
2023-03-17 14:54:19 +01:00
parent ecaf97bbb3
commit 471fa8dabf
42 changed files with 613 additions and 131 deletions

20
src/paveit/labtest/base.py Normal file → Executable file
View 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()