Skip to content

Commit

Permalink
Merge pull request #126 from FloraSauerbronn/plot_cast
Browse files Browse the repository at this point in the history
Changes for new name plot_cast
  • Loading branch information
ocefpaf authored Sep 17, 2024
2 parents 1b022ca + 6c131e7 commit 5b4d70b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions gliderpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
"GliderDataFetcher",
"plot_track",
"plot_transect",
"plot_cast",
]
2 changes: 1 addition & 1 deletion gliderpy/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def plot_transect(


@register_dataframe_method
def plot_ctd(
def plot_cast(
df: pd.DataFrame,
profile_number: int,
var: str,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/01-plotting_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
Expand All @@ -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\")"
]
},
{
Expand All @@ -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()"
Expand Down
File renamed without changes
8 changes: 4 additions & 4 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 5b4d70b

Please sign in to comment.