Skip to content

Commit 1833a22

Browse files
committed
Merge branch 'main' into facetgrid
* main: (57 commits) Add CITATION.cff, tributors, zenodo.json (#231) Add zenodo badge Improve `rename_like` (#222) Don't apply mappers to DataArrays (#227) Add unit support to cf-xarray (#197) Update README.rst Add earthcube 2021 notebook link to readme v0.5.2 Some CMIP6 support Add pooch to binder environment (#223) `add_bounds` uses `keys` rather than `dims` (#221) Add .cf.formula_terms (#213) Update whats-new.rst (#217) add bounds property (#214) Update some tests. Compile regexes Fix black Add __version__ (#208) add skip to rename_like (#206) Refactor out coordinate criteria to criteria.py (#205) ...
2 parents 01e4850 + e11cf07 commit 1833a22

34 files changed

+2432
-717
lines changed

.binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ dependencies:
77
- netcdf4
88
- pip
99
- xarray
10+
- pooch
1011
- pip:
1112
- git+https://github.com/xarray-contrib/cf-xarray

.deepsource.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version = 1
2+
3+
test_patterns = ["cf_xarray/tests/test_*.py"]
4+
5+
exclude_patterns = [
6+
"doc/**",
7+
"ci/**"
8+
]
9+
10+
[[analyzers]]
11+
name = "python"
12+
enabled = true
13+
14+
[analyzers.meta]
15+
runtime_version = "3.x.x"

.github/workflows/ci.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
- "*"
5+
- "main"
66
pull_request:
77
branches:
88
- "*"
@@ -48,6 +48,29 @@ jobs:
4848
name: codecov-umbrella
4949
fail_ci_if_error: false
5050

51+
no-optional-deps:
52+
name: no-optional-deps
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: conda-incubator/setup-miniconda@v2
57+
with:
58+
channels: conda-forge
59+
mamba-version: "*"
60+
activate-environment: cf_xarray_test
61+
auto-update-conda: false
62+
python-version: ${{ matrix.python-version }}
63+
- name: Set up conda environment
64+
shell: bash -l {0}
65+
run: |
66+
mamba env update -f ci/environment-no-optional-deps.yml
67+
python -m pip install -e .
68+
conda list
69+
- name: Run Tests
70+
shell: bash -l {0}
71+
run: |
72+
pytest -n 2
73+
5174
upstream-dev:
5275
name: upstream-dev
5376
runs-on: ubuntu-latest

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pre-commit
22

33
on:
44
push:
5-
branches: "*"
5+
branches: "main"
66
pull_request:
77
branches:
88
- "*"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ instance/
6969
.scrapy
7070

7171
# Sphinx documentation
72-
docs/_build/
72+
doc/_build/
73+
doc/generated/
74+
cf_xarray/tests/_build/
7375

7476
# PyBuilder
7577
target/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77

88
# isort should run before black as black sometimes tweaks the isort output
99
- repo: https://github.com/timothycrosley/isort
10-
rev: 5.6.4
10+
rev: 5.7.0
1111
hooks:
1212
- id: isort
1313
files: .+\.py$
@@ -19,12 +19,12 @@ repos:
1919
- id: black
2020

2121
- repo: https://gitlab.com/pycqa/flake8
22-
rev: 3.8.4
22+
rev: 3.8.3
2323
hooks:
2424
- id: flake8
2525

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

.tributors

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"dcherian": {
3+
"name": "Deepak Cherian",
4+
"bio": "physical oceanographer",
5+
"blog": "http://www.cherian.net",
6+
"orcid": "0000-0002-6861-8734",
7+
"affiliation": "National Center for Atmospheric Research"
8+
},
9+
"malmans2": {
10+
"name": "Mattia Almansi",
11+
"blog": "https://malmans2.github.io",
12+
"orcid": "0000-0001-6849-3647",
13+
"affiliation": "National Oceanography Centre"
14+
},
15+
"aulemahal": {
16+
"name": "Pascal Bourgault",
17+
"bio": "Physical oceanography graduate turned climate science specialist and scientific developer.",
18+
"orcid": "0000-0003-1192-0403",
19+
"affiliation": "Ouranos Inc"
20+
},
21+
"keewis": {
22+
"name": "Justus Magin"
23+
},
24+
"jukent": {
25+
"name": "Julia Kent",
26+
"affiliation": "National Center for Atmospheric Research",
27+
"orcid": "0000-0002-5611-8986"
28+
},
29+
"kthyng": {
30+
"name": "Kristen Thyng",
31+
"bio": "MetOcean Data Scientist at Axiom Data Science. Associate Editor in Chief at the Journal for Open Source Software (JOSS). Wrote cmocean colormaps.",
32+
"blog": "http://kristenthyng.com",
33+
"orcid": "0000-0002-8746-614X",
34+
"affiliation": "Axiom Data Science"
35+
},
36+
"jhamman": {
37+
"name": "Joe Hamman",
38+
"bio": "Scientist and Engineer and Human.\r\n",
39+
"blog": "http://joehamman.com",
40+
"orcid": "0000-0001-7479-8439",
41+
"affiliation": "CarbonPlan"
42+
},
43+
"withshubh": {
44+
"name": "Shubhendra Singh Chauhan",
45+
"bio": "Developer Advocate at @deepsourcelabs 🥑 \r\n👨🏻‍💻 work profile: @shubhendra-deepsource",
46+
"blog": "camelcaseguy.com"
47+
}
48+
}

.zenodo.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"creators": [
3+
{
4+
"name": "Deepak Cherian",
5+
"affiliation": "National Center for Atmospheric Research",
6+
"orcid": "0000-0002-6861-8734"
7+
},
8+
{
9+
"name": "Mattia Almansi",
10+
"affiliation": "National Oceanography Centre",
11+
"orcid": "0000-0001-6849-3647"
12+
},
13+
{
14+
"name": "Pascal Bourgault",
15+
"affiliation": "Ouranos Inc",
16+
"orcid": "0000-0003-1192-0403"
17+
},
18+
{
19+
"name": "Julia Kent",
20+
"affiliation": "National Center for Atmospheric Research",
21+
"orcid": "0000-0002-5611-8986"
22+
},
23+
{
24+
"name": "Justus Magin"
25+
},
26+
{
27+
"name": "Kristen Thyng",
28+
"affiliation": "Axiom Data Science",
29+
"orcid": "0000-0002-8746-614X"
30+
}
31+
],
32+
"upload_type": "software",
33+
"keywords": []
34+
}

CITATION.cff

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# YAML 1.2
2+
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
3+
cff-version: 1.0.3
4+
message: If you use this software, please cite it using these metadata.
5+
title: cf_xarray
6+
doi: 10.5281/zenodo.4749736
7+
repository-code: https://github.com/xarray-contrib/cf-xarray
8+
license: Apache-2.0
9+
version: 0.5.2
10+
date-released: 2021-05-11
11+
keywords:
12+
- cf-conventions
13+
- xarray
14+
- metadata
15+
16+
authors:
17+
- affiliation: National Center for Atmospheric Research, USA
18+
family-names: Cherian
19+
given-names: Deepak
20+
orcid: https://orcid.org/0000-0002-6861-8734
21+
- affiliation: National Oceanography Centre, Southampton, UK
22+
family-names: Almansi
23+
given-names: Mattia
24+
orcid: https://orcid.org/0000-0001-6849-3647
25+
- affiliation: Ouranos, Inc.
26+
family-names: Bourgault
27+
given-names: Pascal
28+
orcid: https://orcid.org/0000-0003-1192-0403
29+
- affiliation: National Center for Atmospheric Research, USA
30+
family-names: Kent
31+
given-names: Julia
32+
orcid: https://orcid.org/0000-0002-5611-8986
33+
- family-names: Magin
34+
given-names: Justus
35+
- family-names: Thielen
36+
given-names: Jon
37+
orcid: https://orcid.org/0000-0002-5479-0189
38+
affiliation: Iowa State University, Ames, IA, USA
39+
- affiliation: Axiom Data Science
40+
family-names: Thyng
41+
given-names: Kristen
42+
orcid: https://orcid.org/0000-0002-8746-614X
43+
...

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
:target: https://anaconda.org/conda-forge/cf_xarray
2727
:alt: Conda Version
2828

29+
.. image:: https://zenodo.org/badge/267381269.svg
30+
:target: https://zenodo.org/badge/latestdoi/267381269
2931

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

3537
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.
3638

37-
See more in the introductory notebook `here <https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html>`_.
39+
See more in the `introductory notebook <https://cf-xarray.readthedocs.io/en/latest/examples/introduction.html>`_.
40+
41+
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>`_.

cf_xarray/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
from pkg_resources import DistributionNotFound, get_distribution
2+
13
from .accessor import CFAccessor # noqa
24
from .helpers import bounds_to_vertices, vertices_to_bounds # noqa
5+
6+
try:
7+
__version__ = get_distribution("cf_xarray").version
8+
except DistributionNotFound:
9+
# package is not installed
10+
__version__ = "unknown"

0 commit comments

Comments
 (0)