Skip to content

Commit

Permalink
Merge pull request #1 from axiom-data-science/cleaning
Browse files Browse the repository at this point in the history
Cleaning
  • Loading branch information
kthyng authored Jun 22, 2023
2 parents 8fa556f + 61757b0 commit 2ec980a
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 63 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates once a week
interval: 'weekly'
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

---
name: Release

on: [push]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install -U pip wheel "setuptools<66.0.0" setuptools-scm twine
- name: Build distributions
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}
62 changes: 62 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
repos:

- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
exclude: ^(docs|setup.py|tests)
args: [--config=pyproject.toml]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude: tests/data
- id: check-ast
- id: debug-statements
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-added-large-files
- id: requirements-txt-fixer
- id: file-contents-sorter
files: requirements-dev.txt

- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
exclude: docs/conf.py
args: [--max-line-length=105]#, --ignore=E203,E501,W503, --select=select=C,E,F,W,B,B950]

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
additional_dependencies: [toml]
args: [--project=gcm_filters, --multi-line=3, --lines-after-imports=2, --lines-between-types=1, --trailing-comma, --force-grid-wrap=0, --use-parentheses, --line-width=88]

# - repo: https://github.com/asottile/seed-isort-config
# rev: v2.1.1
# hooks:
# - id: seed-isort-config

- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
hooks:
- id: mypy
additional_dependencies: [types-requests, types-setuptools]
exclude: docs/source/conf.py
args: [--ignore-missing-imports]

- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args:
- --quiet-level=2
1 change: 0 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Clone from github (HTTPS or SSH)

Install environment file

>>> conda env create -f environment.yml
>>> conda env create -f environment.yml

Activate new environment

Expand All @@ -39,6 +39,8 @@ Install package locally in package directory

# Example Usage

If you input to `intake.open_coops_cat()` the keyword argument `process_adcp=True`, the ADCP Dataset will contain velocity on u and v components, along- and across-channel components, and along- and across-channel subtidal signal (processed with pl33 tidal filter, also included).

```
import intake
Expand All @@ -51,6 +53,19 @@ print(list(cat))
# look at a source
print(cat["COI0302"])
# read in data to a Datset
# read in data to a Dataset
ds = cat["COI0302"].read()
```


### Development

To also develop this package, install additional packages with:
``` bash
$ conda install --file requirements-dev.txt
```

To then check code before committing and pushing it to github, locally run
``` bash
$ pre-commit run --all-files
```
14 changes: 4 additions & 10 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ channels:
dependencies:
# Required for full project functionality (dont remove)
- pytest
# Examples (remove and add as needed)
# - jupyter
# - jupyterlab
- cf_pandas
- intake
- ipython
- xarray
# - noaa_coops
- numpy
# - scipy
# - dask
# - netcdf4
- pandas
# - matplotlib
- pip
- xarray
- pip:
- git+https://github.com/kthyng/noaa_coops@warning

- noaa_coops
1 change: 1 addition & 0 deletions intake_coops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from importlib.metadata import PackageNotFoundError, version


try:
__version__ = version("intake-coops")
except PackageNotFoundError:
Expand Down
Loading

0 comments on commit 2ec980a

Please sign in to comment.