Skip to content

Commit f2aa99a

Browse files
committed
first-commit
0 parents  commit f2aa99a

26 files changed

+832
-0
lines changed

Diff for: .github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
# Check for updates once a week
7+
interval: 'weekly'

Diff for: .github/workflows/optional/linting.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: linting with pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.8'
16+
- uses: pre-commit/[email protected]

Diff for: .github/workflows/release.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
---
3+
name: Release
4+
5+
on: [push]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
- name: Install dependencies
14+
run: |
15+
python -m pip install -U pip wheel setuptools setuptools-scm twine
16+
- name: Build distributions
17+
run: python setup.py sdist bdist_wheel
18+
19+
- name: Publish to PyPI
20+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
21+
uses: pypa/gh-action-pypi-publish@master
22+
with:
23+
user: ${{ secrets.PYPI_USERNAME }}
24+
password: ${{ secrets.PYPI_PASSWORD }}

Diff for: .github/workflows/test.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- "master"
6+
pull_request:
7+
branches:
8+
- "*"
9+
schedule:
10+
- cron: "0 13 * * 1"
11+
12+
jobs:
13+
build:
14+
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: ["ubuntu-latest"]
20+
python-version: ["3.8", "3.9", "3.10"]
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Cache conda
24+
uses: actions/cache@v1
25+
env:
26+
# Increase this value to reset cache if ci/environment.yml has not changed
27+
CACHE_NUMBER: 0
28+
with:
29+
path: ~/conda_pkgs_dir
30+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
31+
- uses: conda-incubator/setup-miniconda@v2
32+
with:
33+
# mamba-version: "*" # activate this to build with mamba.
34+
# channels: conda-forge, defaults # These need to be specified to use mamba
35+
# channel-priority: true
36+
environment-file: ci/environment-py${{ matrix.python-version }}.yml
37+
38+
activate-environment: test_env_mds2zarr
39+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
40+
- name: Set up conda environment
41+
shell: bash -l {0}
42+
run: |
43+
python -m pip install -e . --no-deps --force-reinstall
44+
- name: Run Tests
45+
shell: bash -l {0}
46+
run: |
47+
pytest --cov=./ --cov-report=xml
48+
- name: Upload code coverage to Codecov
49+
uses: codecov/codecov-action@v1
50+
with:
51+
file: ./coverage.xml
52+
flags: unittests
53+
env_vars: OS,PYTHON
54+
name: codecov-umbrella
55+
fail_ci_if_error: false

Diff for: .gitignore

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.coverage
40+
.coverage.*
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*.cover
45+
46+
# Translations
47+
*.mo
48+
*.pot
49+
50+
# Django stuff:
51+
*.log
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
# PyBuilder
57+
target/
58+
59+
# DotEnv configuration
60+
.env
61+
62+
# Database
63+
*.db
64+
*.rdb
65+
66+
# Pycharm
67+
.idea
68+
69+
# VS Code
70+
.vscode/
71+
72+
# Spyder
73+
.spyproject/
74+
75+
# Jupyter NB Checkpoints
76+
.ipynb_checkpoints/
77+
78+
# exclude data from source control by default
79+
#/data/
80+
# I want to be able to handle links in here...need to exclude certain file types
81+
# instead
82+
83+
# Mac OS-specific storage files
84+
.DS_Store
85+
86+
# vim
87+
*.swp
88+
*.swo
89+
90+
# Mypy cache
91+
.mypy_cache/

Diff for: .pre-commit-config.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
repos:
2+
3+
- repo: https://github.com/econchick/interrogate
4+
rev: 1.2.0
5+
hooks:
6+
- id: interrogate
7+
exclude: ^(docs|setup.py|tests)
8+
args: [--config=pyproject.toml]
9+
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v3.1.0
12+
hooks:
13+
- id: trailing-whitespace
14+
exclude: tests/data
15+
- id: check-ast
16+
- id: debug-statements
17+
- id: end-of-file-fixer
18+
- id: check-docstring-first
19+
- id: check-added-large-files
20+
- id: requirements-txt-fixer
21+
- id: file-contents-sorter
22+
files: requirements-dev.txt
23+
24+
- repo: https://gitlab.com/pycqa/flake8
25+
rev: 3.7.9
26+
hooks:
27+
- id: flake8
28+
exclude: docs/source/conf.py
29+
args: [--max-line-length=105, --ignore=E203,E501,W503, --select=select=C,E,F,W,B,B950]
30+
31+
- repo: https://github.com/pre-commit/mirrors-isort
32+
rev: v4.3.21
33+
hooks:
34+
- id: isort
35+
additional_dependencies: [toml]
36+
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]
37+
38+
- repo: https://github.com/asottile/seed-isort-config
39+
rev: v2.1.1
40+
hooks:
41+
- id: seed-isort-config
42+
43+
- repo: https://github.com/psf/black
44+
rev: stable
45+
hooks:
46+
- id: black
47+
language_version: python3
48+
49+
- repo: https://github.com/pre-commit/mirrors-mypy
50+
rev: v0.770
51+
hooks:
52+
- id: mypy
53+
exclude: docs/source/conf.py
54+
args: [--ignore-missing-imports]
55+
56+
- repo: https://github.com/codespell-project/codespell
57+
rev: v1.16.0
58+
hooks:
59+
- id: codespell
60+
args:
61+
- --quiet-level=2

Diff for: LICENSE.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
The MIT License (MIT)
3+
Copyright (c) 2021, Ryan Abernathey
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.
10+

Diff for: README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mds2zarr
2+
==============================
3+
[![Build Status](https://github.com/mitgcm/mds2zarr/workflows/Tests/badge.svg)](https://github.com/mitgcm/mds2zarr/actions)
4+
[![codecov](https://codecov.io/gh/mitgcm/mds2zarr/branch/main/graph/badge.svg)](https://codecov.io/gh/mitgcm/mds2zarr)
5+
[![License:MIT](https://img.shields.io/badge/License-MIT-lightgray.svg?style=flt-square)](https://opensource.org/licenses/MIT)[![pypi](https://img.shields.io/pypi/v/mds2zarr.svg)](https://pypi.org/project/mds2zarr)
6+
<!-- [![conda-forge](https://img.shields.io/conda/dn/conda-forge/mds2zarr?label=conda-forge)](https://anaconda.org/conda-forge/mds2zarr) -->[![Documentation Status](https://readthedocs.org/projects/mds2zarr/badge/?version=latest)](https://mds2zarr.readthedocs.io/en/latest/?badge=latest)
7+
8+
9+
Adaptor to open MITgcm mds files as Zarr groups
10+
11+
--------
12+
13+
<p><small>Project based on the <a target="_blank" href="https://github.com/jbusecke/cookiecutter-science-project">cookiecutter science project template</a>.</small></p>

Diff for: ci/environment-py3.10.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: test_env_mds2zarr
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.10
6+
############## These will have to be adjusted to your specific project
7+
- fsspec
8+
- pydantic
9+
- xarray
10+
- zarr
11+
##############
12+
- pooch
13+
- pytest
14+
- pip:
15+
- codecov
16+
- pytest-cov
17+
- coverage[toml]

Diff for: ci/environment-py3.8.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: test_env_mds2zarr
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.8
6+
############## These will have to be adjusted to your specific project
7+
- fsspec
8+
- pydantic
9+
- xarray
10+
- zarr
11+
##############
12+
- pooch
13+
- pytest
14+
- pip:
15+
- codecov
16+
- pytest-cov
17+
- coverage[toml]

Diff for: ci/environment-py3.9.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: test_env_mds2zarr
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.9
6+
############## These will have to be adjusted to your specific project
7+
- fsspec
8+
- pydantic
9+
- xarray
10+
- zarr
11+
##############
12+
- pooch
13+
- pytest
14+
- pip:
15+
- codecov
16+
- pytest-cov
17+
- coverage[toml]

Diff for: docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Diff for: docs/api.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:mod:`API`
2+
----------------------------
3+
4+
Example For Autogenerated API Documentation
5+
===========================================
6+
7+
.. automodule:: mds2zarr.dummy
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

0 commit comments

Comments
 (0)