Skip to content
Open
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
pull_request:
push:
branches:
- master
workflow_dispatch:

jobs:
# pre-commit:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v6.0.2
# - uses: actions/setup-python@v6
# - uses: pre-commit/action@v3.0.1

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 10
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Checkout source
uses: actions/checkout@v6

- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
environment-file: ci/env.yml
activate-environment: pcnv-dev
auto-activate-base: false

- name: Test build distribution
shell: bash -l {0}
run: |
git clean -xdf
pyproject-build

- name: Install source
shell: bash -l {0}
run: python -m pip install .

- name: List installed packages
shell: bash -l {0}
run: conda list

- name: Run tests
shell: bash -l {0}
run: python -m pytest -s --cov=pyncv --cov-report=xml .

File renamed without changes.
55 changes: 28 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,30 @@ earlier versions, but its not supported. The newest
depends also on python 3.5+, pycnv heavily depends on the gsw toolbox. It
therefore strongly recommended to use python 3.5+.

___

CT Note: Python versions below 3.10 are now EOL'ed, so I'm gonna update to require 3.10+ if thats okay?

User
____


Install as a user using pip

.. code:: bash

pip install pycnv

Install as a user from the repository

.. code:: bash

python setup.py install --user

Uninstall as a user

.. code:: bash

pip uninstall pycnv


Expand All @@ -57,13 +61,15 @@ _________
Install as a developer

.. code:: bash

python setup.py develop --user

conda env create -f ci/env.yml
conda activate pycnv-dev
pip install -e .

Uninstall as a user

.. code:: bash

pip uninstall pycnv


Expand All @@ -85,16 +91,16 @@ FEATURES
is stored in a second field called computed data:
cdata. E.g. cdata['SA00']. The code used to compute the properties
are

.. code:: python

SP = gsw.SP_from_C(data['C' + isen], T, data['p'])
SA = gsw.SA_from_SP(SP,data['p'],lon = lon, lat = lat)
if(baltic == True):
SA = gsw.SA_from_SP_Baltic(SA,lon = lon, lat = lat)

PT = gsw.pt0_from_t(SA, T, data['p'])
CT = gsw.CT_from_t(SA, T, data['p'])
CT = gsw.CT_from_t(SA, T, data['p'])
pot_rho = gsw.pot_rho_t_exact(SA, T, data['p'], p_ref)

- The cnv object provides standard entries for pressure (cnv.p),
Expand Down Expand Up @@ -127,15 +133,15 @@ The package installs the executables:

- pycnv_sum_folder

EXAMPLES

EXAMPLES
--------
Plot the absolute salinity and oxygen of a CTD cast:

.. code:: python

import pycnv
import pylab as pl
import pylab as pl
fname = 'test.cnv' # Some CTD cast

cnv = pycnv.pycnv(fname)
Expand All @@ -155,7 +161,7 @@ Plot the absolute salinity and oxygen of a CTD cast:
# Get unit of derived data
datad0_unit = cnv.cunits[keyd0]

# Standard names are mapped to
# Standard names are mapped to
# cnv.p,cnv.CT,cnv.T,cnv.SP,cnv.oxy
# units are _unit, e.g. cnv.p_unit

Expand All @@ -179,11 +185,11 @@ Plot the absolute salinity and oxygen of a CTD cast:
pl.show()



Lists all predefined stations (in terminal):

.. code:: bash

pycnv_sum_folder --list_stations


Expand All @@ -192,14 +198,14 @@ station TF0271 with a radius of 5000 m, prints it to the terminal and
saves it into the file TF271.txt (in terminal):

.. code:: bash

pycnv_sum_folder --data_folder cnv_data --station TF0271 5000 -p -f TF271.txt


Show and plot conservative temperature, salinity and potential density of a cnv file into a pdf:

.. code:: bash

pycnv --plot show,save,CT00,SA00,pot_rho00 ctd_cast.cnv


Expand All @@ -208,7 +214,7 @@ Interpolate all CTD casts on station TF0271 onto the same pressure axis and make
see code pycnv/test/make_netcdf.py


Devices tested
Devices tested
--------------

- SEACAT (SBE16) V4.0g
Expand All @@ -220,8 +226,3 @@ Devices tested
- SBE 11plus V 5.1g

- Sea-Bird SBE 9 Software Version 4.206





21 changes: 21 additions & 0 deletions ci/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: pycnv-dev
channels:
- conda-forge
- defaults
dependencies:
- python>=3.10
- setuptools
- wheel
- proj
- gsw
- pyproj
- pytest
- pytz
- pyaml
- matplotlib
- cartopy
- pip
- pip:
- pytest
- build
- pytest-cov
Loading