diff --git a/gliderpy/__init__.py b/gliderpy/__init__.py index 9238e5b..b9a3ea1 100644 --- a/gliderpy/__init__.py +++ b/gliderpy/__init__.py @@ -12,4 +12,5 @@ "GliderDataFetcher", "plot_track", "plot_transect", + "plot_cast", ] diff --git a/gliderpy/plotting.py b/gliderpy/plotting.py index 4747014..88c88e5 100644 --- a/gliderpy/plotting.py +++ b/gliderpy/plotting.py @@ -93,7 +93,7 @@ def plot_transect( @register_dataframe_method -def plot_ctd( +def plot_cast( df: pd.DataFrame, profile_number: int, var: str, diff --git a/notebooks/01-plotting_intro.ipynb b/notebooks/01-plotting_intro.ipynb index 8b8ee9b..d319918 100644 --- a/notebooks/01-plotting_intro.ipynb +++ b/notebooks/01-plotting_intro.ipynb @@ -46,7 +46,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### plot_ctd\n", + "### plot_cast\n", "\n", "This method groups all the casts by their position (latitude and longitude) giving the user access to each individual cast using the index (`profile_number`) of the grouped DataFrame." ] @@ -57,7 +57,7 @@ "metadata": {}, "outputs": [], "source": [ - "fig, ax = df.plot_ctd(profile_number=0, var=\"temperature\", color=\"blue\")" + "fig, ax = df.plot_cast(profile_number=0, var=\"temperature\", color=\"blue\")" ] }, { @@ -73,10 +73,10 @@ "metadata": {}, "outputs": [], "source": [ - "fig, ax0 = df.plot_ctd(profile_number=0, var=\"temperature\", color=\"blue\")\n", + "fig, ax0 = df.plot_cast(profile_number=0, var=\"temperature\", color=\"blue\")\n", "\n", "ax1 = ax0.twiny()\n", - "df.plot_ctd(profile_number=0, var=\"salinity\", color=\"red\", ax=ax1)\n", + "df.plot_cast(profile_number=0, var=\"salinity\", color=\"red\", ax=ax1)\n", "\n", "ax0.legend()\n", "ax1.legend()" diff --git a/tests/baseline/test_plot_ctd.png b/tests/baseline/test_plot_cast.png similarity index 100% rename from tests/baseline/test_plot_ctd.png rename to tests/baseline/test_plot_cast.png diff --git a/tests/test_plotting.py b/tests/test_plotting.py index faac256..5e47d3f 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -11,7 +11,7 @@ import pytest from gliderpy.fetchers import GliderDataFetcher -from gliderpy.plotting import plot_ctd, plot_track, plot_transect +from gliderpy.plotting import plot_cast, plot_track, plot_transect root = Path(__file__).parent @@ -76,7 +76,7 @@ def test_plot_transect_size(glider_data): @pytest.mark.mpl_image_compare(baseline_dir=root.joinpath("baseline/")) -def test_plot_ctd(glider_data): - """Test plot_ctd accessor.""" - fig, ax = plot_ctd(glider_data, 0, var="temperature", color="blue") +def test_plot_cast(glider_data): + """Test plot_cast accessor.""" + fig, ax = plot_cast(glider_data, 0, var="temperature", color="blue") return fig