From f8bfef8c888cc11755f2ee44bc7522e1e2ff539d Mon Sep 17 00:00:00 2001 From: Karthik Rishinarada Date: Sun, 12 Jan 2025 15:24:42 +0530 Subject: [PATCH 1/2] add test from simulation to rpacket plot --- .../tools/tests/test_rpacket_plot.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tardis/visualization/tools/tests/test_rpacket_plot.py b/tardis/visualization/tools/tests/test_rpacket_plot.py index 17ff2f17738..99c7dd9314c 100755 --- a/tardis/visualization/tools/tests/test_rpacket_plot.py +++ b/tardis/visualization/tools/tests/test_rpacket_plot.py @@ -11,6 +11,36 @@ class TestRPacketPlotter: """Test the RPacketPlotter class.""" + def test_from_simulation(self, simulation_rpacket_tracking): + """ + Test for the from_simulation method. + + Parameters + ---------- + simulation_rpacket_tracking : tardis.simulation.base.Simulation + Simulation object. + """ + simulation_rpacket_tracking.last_no_of_packets = 10 + rpacket_plotter = RPacketPlotter.from_simulation( + simulation_rpacket_tracking + ) + + assert rpacket_plotter.no_of_packets == 10 + + simulation_rpacket_tracking.last_no_of_packets = 4000 + rpacket_plotter_change = RPacketPlotter.from_simulation( + simulation_rpacket_tracking + ) + + assert rpacket_plotter_change.no_of_packets == 15 + + temp_store = simulation_rpacket_tracking.transport.transport_state.rpacket_tracker_df + del simulation_rpacket_tracking.transport.transport_state.rpacket_tracker_df + with pytest.raises(AttributeError): + RPacketPlotter.from_simulation(simulation_rpacket_tracking) + simulation_rpacket_tracking.transport.transport_state.rpacket_tracker_df = temp_store + + def test_get_coordinates_with_theta_init(self, simulation_rpacket_tracking): """ Test for the get_coordinates_with_theta_init method. From 6d40395f3e162def9f8ede51759626417bff86ec Mon Sep 17 00:00:00 2001 From: Karthik Rishinarada Date: Sun, 12 Jan 2025 18:46:04 +0530 Subject: [PATCH 2/2] add mailmap --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index b238be626b3..8cc367cbda4 100644 --- a/.mailmap +++ b/.mailmap @@ -119,6 +119,8 @@ Josh Shields Karan Desai Karan Desai karandesai-96 +Karthik Rishinarada + Kaushik Varanasi Kaushik Varanasi kaushik94