-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from FloraSauerbronn/create-test-transect
Adding test_plotting in tests
- Loading branch information
Showing
4 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ pyarrow | |
pytest | ||
pytest-cov | ||
pytest-flake8 | ||
pytest-mpl | ||
pytest-sugar | ||
pytest-xdist | ||
setuptools_scm | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Test transect.""" | ||
|
||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from gliderpy.fetchers import GliderDataFetcher | ||
from gliderpy.plotting import plot_transect | ||
|
||
root = Path(__file__).parent | ||
|
||
|
||
@pytest.mark.mpl_image_compare(baseline_dir=root.joinpath("baseline/")) | ||
def test_plot_transect(): | ||
glider_grab = GliderDataFetcher() | ||
|
||
glider_grab.fetcher.dataset_id = "whoi_406-20160902T1700" | ||
df = glider_grab.to_pandas() | ||
# Generate the plot | ||
fig, ax = plot_transect(df, "temperature") | ||
|
||
# Return the figure for pytest-mpl to compare | ||
return fig |