Skip to content

Commit

Permalink
Update structs and testcases after rebase.
Browse files Browse the repository at this point in the history
- #533 removed recently_crossed_boundary flag and was
  merged. The corresponding declaration was removed
  from the python counterpart struct of RPacket for
  restoring builds on travis.
  • Loading branch information
karandesai-96 committed Apr 5, 2016
1 parent 183db92 commit 0c1b2a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion tardis/montecarlo/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class RPacket(Structure):
('next_line_id', c_int64),
('last_line', c_int64),
('close_line', c_int64),
('recently_crossed_boundary', c_int64),
('current_continuum_id', c_int64),
('virtual_packet_flag', c_int64),
('virtual_packet', c_int64),
Expand Down
11 changes: 3 additions & 8 deletions tardis/montecarlo/tests/test_cmontecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def packet():
'next_line_id': 1,
'last_line': 0,
'close_line': 0,
'recently_crossed_boundary': 1,
'current_continuum_id': 1,
'virtual_packet_flag': 1,
'virtual_packet': 0,
Expand Down Expand Up @@ -128,22 +127,18 @@ def test_rpacket_doppler_factor(packet_params, model_params, expected, packet, m

@pytest.mark.parametrize(
['packet_params', 'expected_params'],
[({'mu': 0.3, 'r': 7.5e14, 'recently_crossed_boundary': 1},
[({'mu': 0.3, 'r': 7.5e14},
{'d_boundary': 259376919351035.88}),
({'mu': 0.3, 'r': 7.5e14, 'recently_crossed_boundary': 0},
{'d_boundary': 259376919351035.88}),
({'mu': -.3, 'r': 7.5e13, 'recently_crossed_boundary': 0},
({'mu': -.3, 'r': 7.5e13},
{'d_boundary': -664987228972291.5}),
({'mu': -.3, 'r': 7.5e14, 'recently_crossed_boundary': 0},
({'mu': -.3, 'r': 7.5e14},
{'d_boundary': 709376919351035.9})]
)
def test_compute_distance2boundary(packet_params, expected_params, packet, model):
packet.mu = packet_params['mu']
packet.r = packet_params['r']
packet.recently_crossed_boundary = packet_params['recently_crossed_boundary']

cmontecarlo_methods.compute_distance2boundary(byref(packet), byref(model))

Expand Down

0 comments on commit 0c1b2a4

Please sign in to comment.