Skip to content
Snippets Groups Projects

Resolve "Add survival tests for all plotting methods"

Merged Frank Sauerburger requested to merge 22-add-survival-tests-for-all-plotting-methods into master
1 file
+ 17
1
Compare changes
  • Side-by-side
  • Inline
+ 17
1
@@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
from nnfwtbn.variable import Variable
from nnfwtbn.cut import Cut
from nnfwtbn.process import Process
from nnfwtbn.plot import roc, confusion_matrix
from nnfwtbn.plot import roc, confusion_matrix, atlasify
class SurvivalTestCase(unittest.TestCase):
@@ -92,3 +92,19 @@ class SurvivalTestCase(unittest.TestCase):
annot=True)
except Exception:
self.fail("Calling confusion_matrix() failed.")
def test_atlasify(self):
"""
Check that calling atlasify() does not raise an error.
"""
df = pd.DataFrame({"fpid": [0]*4 + [1]*4,
"reco_signal": [0, 1]*4})
p_signal = Process("Signal", range=(0, 0))
p_bkg = Process("Background", range=(1, 1))
roc(df, p_signal, p_bkg, 'reco_signal')
try:
atlasify()
except Exception:
self.fail("Calling atlasify() failed.")
Loading