Esempio n. 1
0
    def test_project_bundle_rw(self):
        from wdwrap.jupyterui import Project
        p = Project()
        import wdwrap
        b1 = wdwrap.default_binary()
        b2 = wdwrap.default_binary()
        b1.set_value('TAVH', value=5)
        b1.set_value('RM', value=0.75)

        self.assertAlmostEqual(b1['TAVH'].val, 5)
        self.assertAlmostEqual(b1['RM'].val, 0.75)
        self.assertNotAlmostEqual(b2['TAVH'].val, 5)
        self.assertNotAlmostEqual(b2['RM'].val, 0.75)
        p.read_bundle(b1)
        p.write_bundle(b2)
        self.assertAlmostEqual(b2['TAVH'].val, 5)
        self.assertAlmostEqual(b2['RM'].val, 0.75)
Esempio n. 2
0
    def test_phoebe_style(self):
        import wdwrap
        b = wdwrap.default_binary()
        # b.set_value('teff', component='secondary', value=5000)
        # b.set_value('q', value=0.75)
        # b.add_dataset('lc', times=phoebe.linspace(0, 2, 101))
        # b.add_dataset('rv', times=phoebe.linspace(0, 2, 101))
        # b.run_compute()
        # b.plot(show=True)
        b.set_value('TAVH', value=5)
        b.set_value('RM', value=0.75)
        b.run_compute()

        self.assertGreater(len(b.veloc), 10)
Esempio n. 3
0
 def test_lc_read_write_read(self):
     try:
         from StringIO import StringIO  # Python 2
     except ImportError:
         from io import StringIO  # Python 3
     import wdwrap
     from wdwrap.io import Writer_lcin, Reader_lcin
     buf = StringIO()
     b1 = wdwrap.default_binary()
     w = Writer_lcin(buf, [b1])
     w.write()
     buf.seek(0)
     r = Reader_lcin(buf)
     b2 = r.bundles[0]
     self.assertEqual(b1, b2)
Esempio n. 4
0
 def test_bundle_lc_run_rv_auto(self):
     import wdwrap
     b = wdwrap.default_binary()
     self.assertGreater(len(b.veloc), 10)
Esempio n. 5
0
 def test_bundle_lc_run_rv(self):
     import wdwrap
     b = wdwrap.default_binary()
     b['MPAGE'] = wdwrap.drivers.MPAGE.VELOC
     b.lc()
     self.assertGreater(len(b.veloc), 10)
Esempio n. 6
0
 def test_bundle_lc_run_light(self):
     import wdwrap
     b = wdwrap.default_binary()
     self.assertGreater(len(b.light), 10)
Esempio n. 7
0
 def test_lc_runner(self):
     import wdwrap
     from wdwrap.runners import LcRunner
     r = LcRunner()
     r.run(wdwrap.default_binary())
Esempio n. 8
0
 def test_bundle_repr(self):
     import wdwrap
     b = wdwrap.default_binary()
     b['PERIOD'] = 2
     r = repr(b)
     self.assertIsNotNone(r)
Esempio n. 9
0
 def test_default_binary(self):
     """ Checks default binary construction"""
     import wdwrap
     self.assertIsNotNone(wdwrap.default_binary())
Esempio n. 10
0
 def test_lc_scheduling(self):
     import wdwrap
     from wdwrap.jobs import JobScheduler
     ret = JobScheduler.instance().schedule('lc', wdwrap.default_binary())
     r = ret.result()
     print(r)
Esempio n. 11
0
 def test_copy(self):
     import wdwrap
     b1 = wdwrap.default_binary()
     b2 = b1.clone()
     self.assertGreater(len(b2.lines), 4)