added label mechanics to isFlagged / implemented lebelMechanics test
Added label keyword mechanics to isFlagged
(as discussed on the phone with @schaefed).
- Implementation is quite non-invasive.
- Biggest change: since history informations must be known to
isFlagged
- global, the histories get passed on toexecGeneric
(as opposed to only getting squeezed flags columns) - added test
Test like so:
dat = pd.DataFrame({'data1': [1, 1, 5, 2, 1], 'data2': [1, 1, 2, 3, 4]}, index=pd.date_range('2000', '2005', periods=5))
qc = SaQC(dat)
qc = qc.flagRange('data1', max=4, label='out of range')
qc = qc.flagRange('data1', max=0, label='out of range2')
qc = qc.flagGeneric('data1', target='data2',func=lambda x: isflagged(x, 'out of range'))
Expected result is, that data2
only is flagged where first call to flagRange
triggered flagging for data1
.
closes #336 (closed)
Edited by Peter Lünenschloß