Base Model für CITT erstellt, PTM Dortmund ergänzt, Tests hinzugefügt
This commit is contained in:
50
tests/analysis/citt_test.py
Normal file
50
tests/analysis/citt_test.py
Normal file
@@ -0,0 +1,50 @@
|
||||
import logging
|
||||
import os
|
||||
|
||||
import toml
|
||||
from src.paveit.helper import read_file_to_bytesio
|
||||
from src.paveit.labtest.citt import CITT_PTMDortmund
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def test_base_class():
|
||||
pass
|
||||
|
||||
|
||||
def test_citt_ptmdortmund():
|
||||
|
||||
data_path = 'tests/data/citt/PTM_Dortmund'
|
||||
|
||||
res_dict = toml.load(os.path.join(data_path, 'meta.toml'))
|
||||
logger.info(res_dict)
|
||||
|
||||
for filename, meta in res_dict.items():
|
||||
|
||||
logger.info(f'run test on: {filename}, {meta}')
|
||||
|
||||
file = os.path.join(data_path, filename)
|
||||
|
||||
buf = read_file_to_bytesio(file)
|
||||
|
||||
metadata = {'org': 'pytest_ptm_dortmund'}
|
||||
|
||||
res = CITT_PTMDortmund(filename, metadata, archive=False,
|
||||
data=buf)
|
||||
res.run()
|
||||
|
||||
fit = res.fit.reset_index()
|
||||
|
||||
assert len(fit) == 5
|
||||
|
||||
m = res_dict[filename]
|
||||
|
||||
for col in ['F', 's_hor_sum', 's_hor_1', 's_hor_2']:
|
||||
assert all(fit[f'fit_{col}_r2'] >= m['min_r2'])
|
||||
|
||||
sel = fit[(fit['f']==10.0) & (fit['sigma']==0.2) & (fit['T']==20.0)].iloc[0]
|
||||
|
||||
Emin = (1-m['max_diff'])*m['stiffness_10Hz']
|
||||
Emax = (1+m['max_diff'])*m['stiffness_10Hz']
|
||||
|
||||
assert Emin <= sel['E'] <= Emax
|
||||
Reference in New Issue
Block a user