def test_from_par(self): tm = get_model(self.parfile) assert len(tm.components) == 6 assert len(tm.DelayComponent_list) == 4 assert len(tm.PhaseComponent_list) == 2 # Check delay component order order = [] for dcp in tm.DelayComponent_list: order.append(DEFAULT_ORDER.index(dcp.category)) assert all(np.diff(np.array(order)) > 0) # Check phase component order order = [] for dcp in tm.PhaseComponent_list: order.append(DEFAULT_ORDER.index(dcp.category)) assert all(np.diff(np.array(order)) > 0)
def test_component_input(self): tm = TimingModel( "TestTimingModel", [BinaryELL1(), Wave(), AstrometryEquatorial(), Spindown()], ) for k, v in tm.components.items(): # test the link to timing model assert v._parent == tm # Test Delay order order = [] for dcp in tm.DelayComponent_list: order.append(DEFAULT_ORDER.index(dcp.category)) assert all(np.diff(np.array(order)) > 0) # Test Phase order order = [] for dcp in tm.PhaseComponent_list: order.append(DEFAULT_ORDER.index(dcp.category)) assert all(np.diff(np.array(order)) > 0)