예제 #1
0
    def test_save_load(self):

        file, path = tempfile.mkstemp(suffix=".pkl")

        a = Annotation(self.vals,fs=10, observation_probabilities=self.probs, type="vigilance_state", name="bar", metadata={"animal":"joe", "treatment":18})

        a.save(path)
        b = signal_from_pkl(path)
        try:
            os.remove(path)
        except Exception as e:
            print e
            pass

        self.assertTrue(compare_annots(a,b))
예제 #2
0
    def test_save_load(self):

        file, path = tempfile.mkstemp(suffix=".pkl")


        a = Signal(self.random_walk, 10,type="eeg", name="foo", metadata={"animal":"joe", "treatment":18})
        a.save(path)


        b = signal_from_pkl(path)

        try:
            os.remove(path)
        except Exception as e:
            print e
            pass
        self.assertTrue(compare_signals(a,b))