def test_invalid_type_attribute_with_multiple_lcs(self):
     acs_test = AveragedCrossspectrum([self.lc1, self.lc2], [self.lc2, self.lc1], segment_size=1)
     acs_test.type = "invalid_type"
     with pytest.raises(ValueError):
         assert AveragedCrossspectrum._make_crossspectrum(
             acs_test, lc1=[self.lc1, self.lc2], lc2=[self.lc2, self.lc1]
         )
Exemplo n.º 2
0
 def test_invalid_type_attribute(self):
     with pytest.raises(ValueError):
         cs_test = AveragedCrossspectrum(self.lc1, self.lc2, segment_size=1)
         cs_test.type = 'invalid_type'
         assert AveragedCrossspectrum._make_crossspectrum(cs_test,
                                                          self.lc1,
                                                          self.lc2)
Exemplo n.º 3
0
 def test_invalid_type_attribute(self):
     with pytest.raises(ValueError):
         cs_test = AveragedCrossspectrum(self.lc1, self.lc2, segment_size=1)
         cs_test.type = 'invalid_type'
         assert AveragedCrossspectrum._make_crossspectrum(cs_test,
                                                          self.lc1,
                                                          self.lc2)
Exemplo n.º 4
0
 def test_invalid_type_attribute_with_multiple_lcs(self):
     acs_test = AveragedCrossspectrum([self.lc1, self.lc2],
                                      [self.lc2, self.lc1],
                                      segment_size=1)
     acs_test.type = 'invalid_type'
     with pytest.raises(ValueError):
         assert AveragedCrossspectrum._make_crossspectrum(
             acs_test, lc1=[self.lc1, self.lc2], lc2=[self.lc2, self.lc1])
Exemplo n.º 5
0
    def test_rebin_with_invalid_type_attribute(self):
        new_df = 2

        with pytest.warns(UserWarning) as record:
            aps = AveragedCrossspectrum(lc1=self.lc1, lc2=self.lc2,
                                        segment_size=1, norm='leahy')
        aps.type = 'invalid_type'
        with pytest.raises(ValueError):
            assert aps.rebin(df=new_df, method=aps.type)
Exemplo n.º 6
0
 def test_invalid_type_attribute_with_multiple_lcs(self):
     with pytest.warns(UserWarning) as record:
         acs_test = AveragedCrossspectrum([self.lc1, self.lc2],
                                          [self.lc2, self.lc1],
                                          segment_size=1)
     acs_test.type = 'invalid_type'
     with pytest.raises(ValueError) as excinfo:
         assert AveragedCrossspectrum._make_crossspectrum(
             acs_test, [self.lc1, self.lc2], [self.lc2, self.lc1])
     assert "Type of spectrum not recognized" in str(excinfo.value)
Exemplo n.º 7
0
    def test_rebin_with_invalid_type_attribute(self):
        new_df = 2

        with pytest.warns(UserWarning) as record:
            aps = AveragedCrossspectrum(lc1=self.lc1,
                                        lc2=self.lc2,
                                        segment_size=1,
                                        norm='leahy')
        aps.type = 'invalid_type'
        with pytest.raises(ValueError) as excinfo:
            assert aps.rebin(df=new_df, method=aps.type)
        assert "Method for summing or averaging not recognized. " in str(
            excinfo.value)