Skip to content

Commit

Permalink
Merge branch 'main' into facetgrid
Browse files Browse the repository at this point in the history
* main: (57 commits)
  Add CITATION.cff, tributors, zenodo.json (xarray-contrib#231)
  Add zenodo badge
  Improve `rename_like` (xarray-contrib#222)
  Don't apply mappers to DataArrays (xarray-contrib#227)
  Add unit support to cf-xarray (xarray-contrib#197)
  Update README.rst
  Add earthcube 2021 notebook link to readme
  v0.5.2
  Some CMIP6 support
  Add pooch to binder environment (xarray-contrib#223)
  `add_bounds` uses `keys` rather than `dims` (xarray-contrib#221)
  Add .cf.formula_terms (xarray-contrib#213)
  Update whats-new.rst (xarray-contrib#217)
  add bounds property (xarray-contrib#214)
  Update some tests.
  Compile regexes
  Fix black
  Add __version__ (xarray-contrib#208)
  add skip to rename_like (xarray-contrib#206)
  Refactor out coordinate criteria to criteria.py (xarray-contrib#205)
  ...
  • Loading branch information
dcherian committed Jun 8, 2021
2 parents 01e4850 + e11cf07 commit 1833a22
Show file tree
Hide file tree
Showing 34 changed files with 2,432 additions and 717 deletions.
1 change: 1 addition & 0 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ dependencies:
- netcdf4
- pip
- xarray
- pooch
- pip:
- git+https://github.com/xarray-contrib/cf-xarray
15 changes: 15 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version = 1

test_patterns = ["cf_xarray/tests/test_*.py"]

exclude_patterns = [
"doc/**",
"ci/**"
]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
25 changes: 24 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
push:
branches:
- "*"
- "main"
pull_request:
branches:
- "*"
Expand Down Expand Up @@ -48,6 +48,29 @@ jobs:
name: codecov-umbrella
fail_ci_if_error: false

no-optional-deps:
name: no-optional-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
mamba-version: "*"
activate-environment: cf_xarray_test
auto-update-conda: false
python-version: ${{ matrix.python-version }}
- name: Set up conda environment
shell: bash -l {0}
run: |
mamba env update -f ci/environment-no-optional-deps.yml
python -m pip install -e .
conda list
- name: Run Tests
shell: bash -l {0}
run: |
pytest -n 2
upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pre-commit

on:
push:
branches: "*"
branches: "main"
pull_request:
branches:
- "*"
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/
doc/generated/
cf_xarray/tests/_build/

# PyBuilder
target/
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:

# isort should run before black as black sometimes tweaks the isort output
- repo: https://github.com/timothycrosley/isort
rev: 5.6.4
rev: 5.7.0
hooks:
- id: isort
files: .+\.py$
Expand All @@ -19,12 +19,12 @@ repos:
- id: black

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.8.3
hooks:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790 # Must match ci/requirements/*.yml
rev: v0.800 # Must match ci/requirements/*.yml
hooks:
- id: mypy

Expand Down
48 changes: 48 additions & 0 deletions .tributors
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"dcherian": {
"name": "Deepak Cherian",
"bio": "physical oceanographer",
"blog": "http://www.cherian.net",
"orcid": "0000-0002-6861-8734",
"affiliation": "National Center for Atmospheric Research"
},
"malmans2": {
"name": "Mattia Almansi",
"blog": "https://malmans2.github.io",
"orcid": "0000-0001-6849-3647",
"affiliation": "National Oceanography Centre"
},
"aulemahal": {
"name": "Pascal Bourgault",
"bio": "Physical oceanography graduate turned climate science specialist and scientific developer.",
"orcid": "0000-0003-1192-0403",
"affiliation": "Ouranos Inc"
},
"keewis": {
"name": "Justus Magin"
},
"jukent": {
"name": "Julia Kent",
"affiliation": "National Center for Atmospheric Research",
"orcid": "0000-0002-5611-8986"
},
"kthyng": {
"name": "Kristen Thyng",
"bio": "MetOcean Data Scientist at Axiom Data Science. Associate Editor in Chief at the Journal for Open Source Software (JOSS). Wrote cmocean colormaps.",
"blog": "http://kristenthyng.com",
"orcid": "0000-0002-8746-614X",
"affiliation": "Axiom Data Science"
},
"jhamman": {
"name": "Joe Hamman",
"bio": "Scientist and Engineer and Human.\r\n",
"blog": "http://joehamman.com",
"orcid": "0000-0001-7479-8439",
"affiliation": "CarbonPlan"
},
"withshubh": {
"name": "Shubhendra Singh Chauhan",
"bio": "Developer Advocate at @deepsourcelabs 🥑 \r\n👨🏻‍💻 work profile: @shubhendra-deepsource",
"blog": "camelcaseguy.com"
}
}
34 changes: 34 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"creators": [
{
"name": "Deepak Cherian",
"affiliation": "National Center for Atmospheric Research",
"orcid": "0000-0002-6861-8734"
},
{
"name": "Mattia Almansi",
"affiliation": "National Oceanography Centre",
"orcid": "0000-0001-6849-3647"
},
{
"name": "Pascal Bourgault",
"affiliation": "Ouranos Inc",
"orcid": "0000-0003-1192-0403"
},
{
"name": "Julia Kent",
"affiliation": "National Center for Atmospheric Research",
"orcid": "0000-0002-5611-8986"
},
{
"name": "Justus Magin"
},
{
"name": "Kristen Thyng",
"affiliation": "Axiom Data Science",
"orcid": "0000-0002-8746-614X"
}
],
"upload_type": "software",
"keywords": []
}
43 changes: 43 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
title: cf_xarray
doi: 10.5281/zenodo.4749736
repository-code: https://github.com/xarray-contrib/cf-xarray
license: Apache-2.0
version: 0.5.2
date-released: 2021-05-11
keywords:
- cf-conventions
- xarray
- metadata

authors:
- affiliation: National Center for Atmospheric Research, USA
family-names: Cherian
given-names: Deepak
orcid: https://orcid.org/0000-0002-6861-8734
- affiliation: National Oceanography Centre, Southampton, UK
family-names: Almansi
given-names: Mattia
orcid: https://orcid.org/0000-0001-6849-3647
- affiliation: Ouranos, Inc.
family-names: Bourgault
given-names: Pascal
orcid: https://orcid.org/0000-0003-1192-0403
- affiliation: National Center for Atmospheric Research, USA
family-names: Kent
given-names: Julia
orcid: https://orcid.org/0000-0002-5611-8986
- family-names: Magin
given-names: Justus
- family-names: Thielen
given-names: Jon
orcid: https://orcid.org/0000-0002-5479-0189
affiliation: Iowa State University, Ames, IA, USA
- affiliation: Axiom Data Science
family-names: Thyng
given-names: Kristen
orcid: https://orcid.org/0000-0002-8746-614X
...
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
:target: https://anaconda.org/conda-forge/cf_xarray
:alt: Conda Version

.. image:: https://zenodo.org/badge/267381269.svg
:target: https://zenodo.org/badge/latestdoi/267381269

cf-xarray
=========
Expand All @@ -34,4 +36,6 @@ A lightweight convenience wrapper for using CF attributes on xarray objects.

For example you can use ``.cf.mean("latitude")`` instead of ``.mean("lat")`` if appropriate attributes are set! This allows you to write code that does not require knowledge of specific dimension or coordinate names particular to a dataset.

See more in the introductory notebook `here <https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html>`_.
See more in the `introductory notebook <https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html>`_.

Try out our Earthcube 2021 Annual Meeting notebook `submission <https://binder.pangeo.io/v2/gh/malmans2/cf-xarray-earthcube/main?filepath=DC_01_cf-xarray.ipynb>`_.
8 changes: 8 additions & 0 deletions cf_xarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
from pkg_resources import DistributionNotFound, get_distribution

from .accessor import CFAccessor # noqa
from .helpers import bounds_to_vertices, vertices_to_bounds # noqa

try:
__version__ = get_distribution("cf_xarray").version
except DistributionNotFound:
# package is not installed
__version__ = "unknown"
Loading

0 comments on commit 1833a22

Please sign in to comment.