Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthak-dv committed Aug 20, 2024
1 parent 0e8a8a6 commit 5dede73
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tardis/visualization/tools/tests/test_liv_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ def generate_plot_mpl_hdf(self, plotter_generate_plot_mpl):
}
for index1, data in enumerate(fig.get_children()):
if isinstance(data.get_label(), str):
property_group[
"label" + str(index1)
] = data.get_label().encode()
property_group["label" + str(index1)] = (
data.get_label().encode()
)
# save line plots
if isinstance(data, Line2D):
property_group["data" + str(index1)] = data.get_xydata()
property_group[
"linepath" + str(index1)
] = data.get_path().vertices
property_group["linepath" + str(index1)] = (
data.get_path().vertices
)

# save artists which correspond to element contributions
if isinstance(data, PolyCollection):
Expand Down Expand Up @@ -226,6 +226,8 @@ def test_generate_plot_mpl(
np.testing.assert_allclose(
data.get_xydata(),
expected.get("plot_data_hdf/" + "data" + str(index1)),
rtol=1e-5,
atol=1e-8,
)
np.testing.assert_allclose(
data.get_path().vertices,
Expand Down Expand Up @@ -324,5 +326,8 @@ def test_generate_plot_ply(
data.x, expected.get(group + "x").values.flatten()
)
np.testing.assert_allclose(
data.y, expected.get(group + "y").values.flatten()
data.y,
expected.get(group + "y").values.flatten(),
rtol=1e-5,
atol=1e-8,
)

0 comments on commit 5dede73

Please sign in to comment.