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
54 changes: 54 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Documentation

on:
pull_request:
push:
branches:
- main
release:
types:
- published

jobs:
build-docs:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false

- name: Build environment
shell: bash -l {0}
run: |
micromamba create --name TEST python=3 --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(python setup.py --version)

- name: Build documentation
shell: bash -l {0}
run: |
set -e
micromamba activate TEST
jupyter nbconvert --to notebook --execute notebooks/quick_intro.ipynb --output=quick_intro-output.ipynb
mv notebooks/*output.ipynb docs/source/
pushd docs
make clean html linkcheck
popd

- name: Deploy
if: github.event_name == 'release' || github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
29 changes: 0 additions & 29 deletions .github/workflows/pip.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/test-conda.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
pull_request:
push:
branches: [main]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: false

- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: |
micromamba create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt --channel conda-forge
micromamba activate TEST
python -m pip install -e . --no-deps --force-reinstall

- name: Tests
shell: bash -l {0}
run: |
micromamba activate TEST
python -m pytest -rxs tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
build/
ctd/_version.py
dist/
*-output.ipynb
*.pyc
99 changes: 0 additions & 99 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions ctd/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,8 @@ def movingaverage(df, window_size=48):
"""
Moving average on a data frame or series.

Inputs
------
windows_size : integer
Size of the window.
Inputs:
windows_size : integer

"""

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Load and pre-process CTD/XBT casts as pandas DataFrames.
.. toctree::
:maxdepth: 3

quick_intro.ipynb
quick_intro-output.ipynb
ctd

Indices and tables
Expand Down
1 change: 0 additions & 1 deletion github_deploy_key_pyoceans_python_ctd.enc

This file was deleted.

20 changes: 11 additions & 9 deletions notebooks/quick_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"import io\n",
Expand All @@ -32,7 +34,7 @@
" Path(\"CTD-spiked-unfiltered.cnv.bz2\").write_bytes(data.read())\n",
"\n",
"\n",
"url = \"https://github.com/pyoceans/python-ctd/raw/master/tests/data/CTD-spiked-unfiltered.cnv.bz2\"\n",
"url = \"https://github.com/pyoceans/python-ctd/raw/main/tests/data/CTD-spiked-unfiltered.cnv.bz2\"\n",
"download_demo_file(url)"
]
},
Expand Down Expand Up @@ -117,7 +119,7 @@
"ax1.grid(False)\n",
"\n",
"ax0.legend(loc=\"lower left\")\n",
"ax1.legend(loc=\"lower right\")"
"ax1.legend(loc=\"lower right\");"
]
},
{
Expand Down Expand Up @@ -173,7 +175,7 @@
"ax.plot(down.index, label=\"unfiltered\")\n",
"ax.plot(down.lp_filter().index, label=\"filtered\")\n",
"ax.axis([20870, 20930, 557.5, 559])\n",
"fig.legend()"
"fig.legend();"
]
},
{
Expand Down Expand Up @@ -234,11 +236,11 @@
"\n",
"p = proc.index\n",
"\n",
"SP = gsw.SP_from_C(proc[\"c0S/m\"] * 10.0, proc[\"t090C\"], p)\n",
"SP = gsw.SP_from_C(proc[\"c0S/m\"].to_numpy() * 10.0, proc[\"t090C\"].to_numpy(), p)\n",
"SA = gsw.SA_from_SP(SP, p, lon, lat)\n",
"SR = gsw.SR_from_SP(SP)\n",
"\n",
"CT = gsw.CT_from_t(SA, proc[\"t090C\"].values, p)\n",
"CT = gsw.CT_from_t(SA, proc[\"t090C\"].to_numpy(), p)\n",
"z = -gsw.z_from_p(p, lat)\n",
"sigma0_CT = gsw.sigma0(SA, CT)\n",
"\n",
Expand Down Expand Up @@ -272,7 +274,7 @@
"ax.set_ylabel(\"Pressure (dbar)\")\n",
"ax.grid(True)\n",
"ax.legend()\n",
"ax.set_title(\"Salinities\")"
"ax.set_title(\"Salinities\");"
]
},
{
Expand Down Expand Up @@ -344,7 +346,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -358,7 +360,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
Loading