Skip to content

Commit

Permalink
Update plot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryPetrochenkov-NOAA committed Jul 7, 2023
1 parent 3ead6d7 commit 4abe5ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_data_frame_accessor_compute_metrics(
)
def test_categorical_plot_success(candidate_map, crs, entries):
candidate_map.rio.set_crs(crs)
viz_object = candidate_map.gval.cat_plot()
viz_object = candidate_map.gval.cat_plot(basemap=None)
assert len(viz_object.axes.get_legend().texts) == entries


Expand All @@ -252,15 +252,16 @@ def test_categorical_plot_success(candidate_map, crs, entries):
def test_categorical_plot_fail(candidate_map, legend_labels, num_classes):
candidate_map.data = np.random.choice(np.arange(num_classes), candidate_map.shape)
with raises(ValueError):
_ = candidate_map.gval.cat_plot(legend_labels=legend_labels)
_ = candidate_map.gval.cat_plot(legend_labels=legend_labels, basemap=None)


@parametrize_with_cases(
"candidate_map, axes",
glob="continuous_plot_success",
)
def test_continuous_plot_success(candidate_map, axes):
viz_object = candidate_map.gval.cont_plot()
args = {} if axes == 2 else {"basemap": None}
viz_object = candidate_map.gval.cont_plot(**args)
assert len(viz_object.figure.axes) == axes


Expand Down

0 comments on commit 4abe5ec

Please sign in to comment.