From 272cf9c509192bbcfdc25595af932d4701985d39 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 18:34:03 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/keewis/blackdoc: v0.3.9 → v0.4.1](https://github.com/keewis/blackdoc/compare/v0.3.9...v0.4.1) - [github.com/astral-sh/ruff-pre-commit: v0.11.12 → v0.12.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.11.12...v0.12.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26a582c..d592958 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: files: requirements-dev.txt - repo: https://github.com/keewis/blackdoc - rev: v0.3.9 + rev: v0.4.1 hooks: - id: blackdoc @@ -39,7 +39,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.12 + rev: v0.12.2 hooks: - id: ruff args: ["--fix", "--show-fixes"] From 1af575b84fbd2c3da2b9ac07df75302a0321a1e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 18:35:18 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 11794b3..65e0091 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ and then, from pathlib import Path import ctd -path = Path('tests', 'data', 'CTD') -fname = path.joinpath('g01l06s01.cnv.gz') +path = Path("tests", "data", "CTD") +fname = path.joinpath("g01l06s01.cnv.gz") down, up = ctd.from_cnv(fname).split() -ax = down['t090C'].plot_cast() +ax = down["t090C"].plot_cast() ``` ![Bad Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_01.png) @@ -45,22 +45,19 @@ ax = down['t090C'].plot_cast() We can do [better](https://www.go-ship.org/Manual/McTaggart_et_al_CTD.pdf): ```python -temperature = down['t090C'] +temperature = down["t090C"] fig, ax = plt.subplots(figsize=(5.5, 6)) temperature.plot_cast(ax=ax) -temperature.remove_above_water()\ - .despike()\ - .lp_filter()\ - .press_check()\ - .interpolate(method='index', - limit_direction='both', - limit_area='inside')\ - .bindata(delta=1, method='interpolate')\ - .smooth(window_len=21, window='hanning') \ - .plot_cast(ax=ax) -ax.set_ylabel('Pressure (dbar)') -ax.set_xlabel('Temperature (°C)') +temperature.remove_above_water().despike().lp_filter().press_check().interpolate( + method="index", limit_direction="both", limit_area="inside" +).bindata(delta=1, method="interpolate").smooth( + window_len=21, window="hanning" +).plot_cast( + ax=ax +) +ax.set_ylabel("Pressure (dbar)") +ax.set_xlabel("Temperature (°C)") ``` ![Good Processing](https://raw.githubusercontent.com/pyoceans/python-ctd/main/docs/readme_02.png)