Skip to content

Commit d0edd6c

Browse files
authored
Merge pull request #38 from DocOtak/release_stuff
Add 0.2.0 Release notes and metadata changes
2 parents 5b4acda + cff2953 commit d0edd6c

File tree

8 files changed

+52
-9
lines changed

8 files changed

+52
-9
lines changed

CHANGELOG.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Changelog
2+
=========
3+
4+
v0.2.0 - 2022-03-22
5+
-------------------
6+
This is a major release that is ready for widespread usage.
7+
Our focus was on ensuring compatibility with the upstream API and a units overhaul.
8+
9+
Highlights
10+
``````````
11+
* Upstream compatibility with package layout.
12+
All the ways you can import gsw and its submodule should now Just Work.
13+
This includes wildcard imports: ``from gsw_xarray import *`` and even some private members in the upstream that have leaked out.
14+
* All returned xr.DataArray objects will have the units attr set to the correct unit, or be "1" if the result is unitless.
15+
The unit style is compatible with both UDUNITS (the CF requirement) and the python pint library.
16+
Several mistakes were found in the upstream documentation, both in the python and matlab sources.
17+
* Functions returning practical salinity or sea water temperature will have the OceanSITES reference_scale attribute set to "PSS-78" or "ITS-90" if appropriate.
18+
* Some standard names assume information about the surface or geopotential that a property is being calculated against.
19+
We now have some check functions that ensure the standard name is not set if one of these assumptions is not true.
20+
21+
Breaking Changes
22+
````````````````
23+
* The attrs of the returned xr.DataArray object are now completely replaced by attrs controlled by us.
24+
Previously we would only set the standard_name or units attributes and leave everything else untouched.
25+
We found this to be confusing and inaccurate since the behavior of xarray would copy the attributes of the first argument to a gsw function.
26+
This resulted in attributes like long_name to be incorrect.
27+
* The xr.DataArray.name property is now set to the return name of the gsw function.
28+
For example, SA_from_SP will return a DataArray with name property set to "SA".
29+
30+
v0.1.0 - 2021-12-15
31+
-------------------
32+
* Original release, was basically a proof of concept.
33+
Only a few functions were wrapped.

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../CHANGELOG.rst

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Contents
1414
:maxdepth: 2
1515

1616
attrs
17+
changelog
1718

1819

1920

gsw_xarray/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.2.0"
22

33
from importlib import import_module
44

gsw_xarray/tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ def ds():
1414
ds["SA"] = ds["id"] * 0.1 + 34
1515
ds["SA"].attrs = {"standard_name": "sea_water_absolute_salinity"}
1616
return ds
17+
18+
19+
@pytest.fixture(scope="session")
20+
def ureg():
21+
pint = pytest.importorskip("pint")
22+
return pint.UnitRegistry()

gsw_xarray/tests/test_gsw_xarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
def test_version():
8-
assert __version__ == "0.1.0"
8+
assert __version__ == "0.2.0"
99

1010

1111
def test_func_standard(ds):

gsw_xarray/tests/test_units.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
from .test_imports import gsw_base
77
from gsw_xarray._attributes import _func_attrs
88

9-
from pint import UnitRegistry
10-
11-
ureg = UnitRegistry()
12-
139

1410
@pytest.mark.parametrize("func_name", gsw_base)
15-
def test_unit_pint(func_name):
11+
def test_unit_pint(func_name, ureg):
12+
1613
if func_name in ["indexer", "match_args_return", "pchip_interp"]:
1714
# Internal gsw cookery or non wrapped functions
1815
return

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
[tool.poetry]
22
name = "gsw-xarray"
3-
version = "0.1.0"
4-
description = ""
3+
version = "0.2.0"
4+
description = "Drop in wrapper for gsw which adds CF standard name and units attributes to xarray results"
55
authors = ["Andrew Barna <[email protected]>", "Romain Caneill <[email protected]>"]
66
license = "BSD-3-Clause"
77

8+
readme = "README.rst"
9+
10+
repository = "https://github.com/DocOtak/gsw-xarray"
11+
documentation = "https://gsw-xarray.readthedocs.io/"
12+
813
[tool.poetry.dependencies]
914
python = ">=3.8"
1015
xarray = ">=0.20.2"

0 commit comments

Comments
 (0)