Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
---------

Version 1.1.0

* Added more SBE valid pressure names
* Wrap matplotlib plots
* Use case fold to avoid to standardize names
* Support pandas >=1.0


Version 1.0.0

* Major re-factor to use `pandas_flavor` instead of Monkey Patching.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# python-ctd

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11396.svg)](https://doi.org/10.5281/zenodo.11396) [![Build Status](https://travis-ci.org/pyoceans/python-ctd.svg?branch=master)](https://travis-ci.org/pyoceans/python-ctd) [![PyPI](https://img.shields.io/pypi/v/ctd.svg?style=plastic)](https://pypi.python.org/pypi/ctd) [![Build status](https://ci.appveyor.com/api/projects/status/m1wxtsb8gpm96i53?svg=true)](https://ci.appveyor.com/project/ocefpaf/python-ctd) [![License](http://img.shields.io/badge/license-BSD-blue.svg?style=flat)](https://github.com/pyoceans/python-ctd/blob/master/LICENSE.txt)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11396.svg)](https://doi.org/10.5281/zenodo.11396) [![Build Status](https://travis-ci.org/pyoceans/python-ctd.svg?branch=master)](https://travis-ci.org/pyoceans/python-ctd) [![PyPI](https://img.shields.io/pypi/v/ctd.svg?style=plastic)](https://pypi.python.org/pypi/ctd) [![Build status](https://ci.appveyor.com/api/projects/status/m1wxtsb8gpm96i53?svg=true)](https://ci.appveyor.com/project/ocefpaf/python-ctd) [![License](http://img.shields.io/badge/license-BSD--3--Clause-blue.svg?style=flat)](https://github.com/pyoceans/python-ctd/blob/master/LICENSE.txt)

Tools to load hydrographic data as pandas DataFrame with some handy methods for
data pre-processing and analysis
Expand Down
13 changes: 4 additions & 9 deletions ctd/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,11 @@ def from_cnv(fname):
)
f.close()

key_set = False
prkeys = ["prM ", "prE", "prDM", "pr50M", "pr50M1", "prSM", "prdM", "pr"]
for prkey in prkeys:
try:
df.set_index(prkey, drop=True, inplace=True)
key_set = True
except KeyError:
continue
if not key_set:
raise KeyError(f"Could not find pressure field (supported names are {prkeys}).")
prkey = [key for key in prkeys if key in df.columns]
if len(prkey) != 1:
raise ValueError(f"Expectd one pressure column, got {prkey}.")
df.set_index(prkey, drop=True, inplace=True)
df.index.name = "Pressure [dbar]"

name = _basename(fname)[1]
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ flake8-mutable
flake8-print
ipykernel
isort
jupyter
jupyter_client
mypy
nbconvert
Expand Down
2 changes: 1 addition & 1 deletion tests/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ def test_pressure_field_labels():
for fname in sorted(data_path.glob("issue3prlabworks*.cnv")):
ctd.from_cnv(fname)
for fname in sorted(data_path.glob("issue3prlabfails*.cnv")):
with pytest.raises(KeyError):
with pytest.raises(ValueError):
ctd.from_cnv(fname)