Skip to content

Commit

Permalink
Merge pull request #165 from ocefpaf/run_doctests
Browse files Browse the repository at this point in the history
Run doctests
  • Loading branch information
ocefpaf authored Oct 24, 2022
2 parents 124596c + ad1cce7 commit 0b86a24
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
run: |
micromamba activate TEST
python -m pytest -rxs tests
- name: Doctests
shell: bash -l {0}
run: |
micromamba activate TEST
python -m pytest -s -rxs --doctest-modules -vv ctd
11 changes: 10 additions & 1 deletion ctd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
smooth,
split,
)
from .read import from_bl, from_btl, from_cnv, from_edf, from_fsi, rosette_summary
from .read import (
from_bl,
from_btl,
from_castaway_csv,
from_cnv,
from_edf,
from_fsi,
rosette_summary,
)

try:
from ._version import __version__
Expand All @@ -28,6 +36,7 @@
"despike",
"from_bl",
"from_btl",
"from_castaway_csv",
"from_cnv",
"from_edf",
"from_fsi",
Expand Down
8 changes: 4 additions & 4 deletions ctd/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,10 @@ def from_castaway_csv(fname):
--------
>>> import ctd
>>> cast = ctd.from_castaway_csv('tests/data/castaway_data.csv')
>>> downcast, upcast = cast.split() # Upcast often prefiltered
>>> fig, ax = plt.subplots()
>>> ax = downcast['temperature'].plot_cast()
>>> fig.show()
>>> cast.columns
Index(['depth', 'temperature', 'conductivity', 'specific_conductance',
'salinity', 'sound_velocity', 'density'],
dtype='object')
"""
with open(fname) as file:
Expand Down
Empty file modified tests/data/castaway_data.csv
100755 → 100644
Empty file.

0 comments on commit 0b86a24

Please sign in to comment.