Skip to content

Commit 7e196c6

Browse files
authored
v0.3 changelog and adjusted README. (#168)
* v0.3 changelog and adjusted README. * Skip towncrier in RTD build when no fragments. Retry Now with no fragments. * Fix current version statement. * Automate version statement. * Shift towncrier choice into Makefile. * Revert conf.py
1 parent e18b773 commit 7e196c6

File tree

15 files changed

+64
-43
lines changed

15 files changed

+64
-43
lines changed

.readthedocs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ build:
88
# Content here largely copied from Iris
99
# see : https://github.com/SciTools/iris/pull/4855
1010
post_checkout:
11-
# The SciTools/iris repository is shallow i.e., has a .git/shallow,
12-
# therefore complete the repository with a full history in order
11+
# In case the repository is shallow, complete with a full history in order
1312
# to allow setuptools-scm to correctly auto-discover the version.
1413
- git fetch --unshallow
1514
- git fetch --all

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Generic NetCDF data in Python.
66

7+
Represents raw netCDF data in Python, with no structural assumptions or interpretations,
8+
and provides facilities to inspect and manipulate it with complete freedom.
9+
10+
### Also
711
Provides fast data exchange between analysis packages, and full control of storage
812
formatting.
913

@@ -70,7 +74,7 @@ enable_lockshare(iris=True)
7074
ncdata = from_nc4(input_path)
7175
for var in ncdata.variables.values():
7276
if "coords" in var.attributes:
73-
var.attributes.rename("coords", "coordinates")
77+
var.attributes.rename("coords", "coordinates")
7478
cubes = to_iris(ncdata)
7579
```
7680

@@ -93,20 +97,21 @@ ncdata = from_nc4("file1.nc")
9397
keys = ["air_", "surface"]
9498

9599
# Explicitly add dimension names, to include all the dimension variables
96-
keys += + list(ncdata.dimensions)
100+
keys += list(ncdata.dimensions)
97101

98102
# Identify the wanted variables
99103
select_vars = [
100104
var
101105
for var in ncdata.variables.values()
102-
if any(key in var.name for key in keys)
106+
if any(var.name.startswith(key) for key in keys)
103107
]
104108

105109
# Add any referenced coordinate variables
106-
for var in list(select_vars):
107-
var = ncdata.variables[varname]
108-
for coordname in var.attributes.get("coordinates", "").split(" "):
109-
select_vars.append(ncdata.variables[coordname])
110+
for var in select_vars:
111+
coordnames = var.avals.get("coordinates")
112+
if coordnames:
113+
for coordname in coordnames.split(" "):
114+
select_vars.append(ncdata.variables[coordname])
110115

111116
# Replace variables with only the wanted ones
112117
ncdata.variables.clear()
@@ -115,11 +120,3 @@ ncdata.variables.addall(select_vars)
115120
# Save
116121
to_nc4(ncdata, "pruned.nc")
117122
```
118-
119-
120-
# Older References in Iris
121-
* Iris issue : https://github.com/SciTools/iris/issues/4994
122-
* planning presentation : https://github.com/SciTools/iris/files/10499677/Xarray-Iris.bridge.proposal.--.NcData.pdf
123-
* in-Iris code workings : https://github.com/pp-mo/iris/pull/75
124-
125-

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ allapi:
1919
sphinx-apidoc -Mfe -o ./details/api ../lib/ncdata
2020

2121
towncrier:
22-
towncrier build --yes
22+
if [ -e changelog_fragments/*.rst ]; then towncrier build --yes; fi
2323

2424

2525
# Tweaked "make html", which restores the changelog state after docs build.

docs/change_log.rst

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ We intend to follow `PEP 440 <https://peps.python.org/pep-0440/>`_,
1111
or (older) `SemVer <https://semver.org/>`_ versioning principles.
1212
This means the version string has the basic form **"major.minor.bugfix[special-types]"**.
1313

14-
Current release version is at **"v0.2"**.
14+
Current release version is at : |version|
1515

1616
This is a complete implementation, with functional operational of all public APIs.
1717
The code is however still experimental, and APIs are not stable
@@ -25,6 +25,55 @@ Summary of key features by release number.
2525

2626
.. towncrier release notes start
2727
28+
v0.3.0
29+
~~~~~~
30+
Added handy utilities; made attribute access easier; reworked documentation.
31+
32+
Features
33+
^^^^^^^^
34+
35+
- Added the ability to extract a sub-region by indexing/slicing over dimensions.
36+
The :class:`ncdata.NcData` objects can be indexed with the ``[]`` operation, or over
37+
specifed dimensions with the :meth:`~ncdata.NcData.slicer` method.
38+
This is based on the new :meth:`~ncdata.utils.index_by_dimensions()` utility method
39+
and :class:`~ncdata.utils.Slicer` class.
40+
See: :ref:`utils_indexing` (`ISSUE#68 <https://github.com/pp-mo/ncdata/pull/68>`_)
41+
- Added the :func:`~ncdata.utils.rename_dimension` utility.
42+
This provides a "safe" dimension rename, which also replaces
43+
the name in all variables which use it. (`ISSUE#87 <https://github.com/pp-mo/ncdata/pull/87>`_)
44+
- Added the ".avals" property as an easier way of managing attributes:
45+
This provides a simple "name: value" map, bypassing the NcAttribute objects and converting values to and from simple Python equivalents.
46+
This effectively replaces the older 'set_attrval' and 'get_attrval', which will eventually be removed.
47+
See: :ref:`attributes_and_avals` (`ISSUE#117 <https://github.com/pp-mo/ncdata/pull/117>`_)
48+
- Make :meth:`~ncdata.iris.to_iris` use the full iris load processing,
49+
instead of :meth:`iris.fileformats.netcdf.loader.load_cubes`.
50+
This means you can use load controls such as callbacks and constraints. (`ISSUE#131 <https://github.com/pp-mo/ncdata/pull/131>`_)
51+
- Provide exact == and != for datasets and variables, by just calling the difference utilities.
52+
This can be inefficient, but is simple to understand and generally useful.
53+
See: :ref:`equality_testing` (`ISSUE#166 <https://github.com/pp-mo/ncdata/pull/166>`_)
54+
55+
56+
Documentation changes
57+
^^^^^^^^^^^^^^^^^^^^^
58+
59+
- Added a `userguide page <userdocs/user_guide/utilities.html>`_ summarising all the utility features in :mod:`ncdata.utils`. (`ISSUE#161 <https://github.com/pp-mo/ncdata/pull/161>`_)
60+
- Made all docs examples into doctests; add doctest CI action. (`ISSUE#136 <https://github.com/pp-mo/ncdata/pull/136>`_)
61+
62+
63+
Bug Fixes
64+
^^^^^^^^^
65+
66+
- Fixed a bug in dataset comparison, where variables with missing or unbroadcastable data arrays could cause errors rather than generating difference messages. (`ISSUE#153 <https://github.com/pp-mo/ncdata/pull/153>`_)
67+
68+
69+
Developer and Internal changes
70+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71+
72+
- Switch to towncrier for whats-new management. (`ISSUE#116 <https://github.com/pp-mo/ncdata/pull/116>`_)
73+
- Added regular linkcheck gha. (`ISSUE#123 <https://github.com/pp-mo/ncdata/pull/123>`_)
74+
- @valeriupredoi added test for Zarr conversion to Iris cubes. (`ISSUE#145 <https://github.com/pp-mo/ncdata/pull/145>`_)
75+
76+
2877
v0.2.0
2978
~~~~~~
3079
Overhauled data manipulation APIs. Expanded and improved documentation.

docs/changelog_fragments/116.dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog_fragments/117.feat.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/changelog_fragments/123.dev.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog_fragments/131.feat.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/changelog_fragments/136.dev.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog_fragments/145.dev.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)