Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- [ ] (If applicable) Documentation has been added / updated (for bug fixes / features).
- [ ] (If applicable) Tests have been added.
- [ ] CHANGELOG.rst has been updated (with summary of main changes).
- [ ] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added.

### What kind of change does this PR introduce?

Expand Down
15 changes: 13 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,22 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: '.ipynb'
- id: fix-byte-order-marker
- id: name-tests-test
args: [ '--pytest-test-first' ]
- id: no-commit-to-branch
args: [ '--branch', 'main' ]
- id: check-docstring-first
- id: check-merge-conflict
- id: check-json
- id: check-yaml
- id: check-toml
- id: check-yaml
args: [ '--allow-multiple-documents' ]
- id: debug-statements
- id: pretty-format-json
args: [ '--autofix', '--no-ensure-ascii', '--no-sort-keys' ]
exclude: '.ipynb'
- repo: https://github.com/pappasam/toml-sort
rev: v0.24.2
hooks:
Expand Down Expand Up @@ -87,7 +99,6 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes


ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
Expand Down
29 changes: 28 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,37 @@
"title": "xncml",
"creators": [
{
"name": "Anderson Banihirwe"
"name": "Banihirwe, Anderson",
"orcid": "0000-0001-6583-571X"
},
{
"name": "Huard, David",
"affiliation": "Ouranos, Montréal, Québec, Canada",
"orcid": "0000-0003-0311-5498"
},
{
"name": "Aoun, Abel",
"orcid": "0000-0003-2289-2890"
},
{
"name": "Smith, Trevor James",
"affiliation": "Ouranos, Montréal, Québec, Canada",
"orcid": "0000-0001-5393-8359"
},
{
"name": "Charette-Migneault, Francis",
"affiliation": "CRIM, Montréal, Québec, Canada",
"orcid": "0000-0003-4862-3349"
},
{
"name": "Bourgault, Pascal",
"affiliation": "Ouranos, Montréal, Québec, Canada",
"orcid": "0000-0003-1192-0403"
}
],
"keywords": [
"netcdf",
"xarray",
"xncml"
],
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Credits
=======

Development Lead
----------------
Development Leads
-----------------
* Anderson Banihirwe <abanihi@ucar.edu> `@andersy005 <https://github.com/andersy005>`_
* David Huard <david.huard@gmail.com> `@huard <https://github.com/huard>`_

Expand Down
33 changes: 13 additions & 20 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
Changelog
=========

..
`Unreleased <https://github.com/xarray-contrib/xncml/tree/master>`_ (latest)
----------------------------------------------------------------------------
`Unreleased <https://github.com/xarray-contrib/xncml/tree/master>`_ (latest)
----------------------------------------------------------------------------
Contributors: Trevor James Smith (:user:`Zeitsperre`).

Contributors:
Fixes
^^^^^
- Author and license information have been updated in the top-most ``__init__.py``, ``.zenodo.json``, and ``pyproject.toml`` files.

Changes
^^^^^^^
* No change.

Fixes
^^^^^
* No change.
Internal changes
^^^^^^^^^^^^^^^^
- Removed the obsolete ``MANIFEST.in`` file.
- New `pre-commit` checks have been added to the ``.pre-commit-config.yaml`` file.

.. _changes_0.5.0:

Expand All @@ -23,12 +22,10 @@ Changelog

Bug fixes
^^^^^^^^^

- Scalar attributes that are not strings are no longer wrapped in tuples of length==1 (by :user:`bzah`).

Breaking changes
^^^^^^^^^^^^^^^^

- Nested group handling (by :user:`bzah`):
- Before this version, all groups were read, but conflicting variable names in-between groups would shadow data. Now, similarly to ``xarray.open_dataset``, ``open_ncml`` accepts an optional ``group`` argument to specify which group should be read. When ``group`` is not specified, it defaults to the root group. Additionally ``group`` can be set to ``'*'`` so that every group is read and the hierarchy is flattened. In the event of conflicting variable/dimension names across groups, the conflicting name will be modified by appending ``'__n'`` where n is incremented.
- Enums are no longer transformed into CF flag_values and flag_meanings attributes, instead they are stored in the ``encoding["dtype"].metadata`` of their respective variable. This is aligned with what was done on `xarray` v2024.01.0 (by :user:`bzah`).
Expand All @@ -37,7 +34,6 @@ Breaking changes

Internal changes
^^^^^^^^^^^^^^^^

- Added support for running `pytest` with `pytest-cov` (by :user:`Zeitsperre`).
- Reworked the GitHub CI testing workflow to perform version checks as well as tests with `pytest-cov` (by :user:`Zeitsperre`).
- The `xncml` package has been significantly restructured to improve maintainability (by :user:`bzah` and :user:`Zeitsperre`):
Expand Down Expand Up @@ -68,7 +64,6 @@ Internal changes
- Add support for Python 3.12
- Drop support for Python 3.8


.. _changes-0.3:

0.3 (2023-08-28)
Expand All @@ -79,7 +74,6 @@ Internal changes
- Closing the dataset returned by `open_ncml` will close the underlying opened files (by :user:`huard`).
- Add `Dataset.from_text` classmethod to create a `Dataset` from an XML string (by :user:`huard`).


.. _changes-0.2:

0.2 (2023-02-23)
Expand All @@ -90,12 +84,11 @@ Internal changes
- Add support in `Dataset` for NcML documents using the `ncml` namespace (by :user:`huard`).
- Implement `Dataset.to_cf_dict` method to export CF-JSON dictionary (by :user:`huard`).


.. _changes-0.1:

0.1 Initial release (2022-11-24)
--------------------------------

- Manipulate NcML file: add & remove attributes, variables and dimensions. (by :user:`andersy005`).
- Implement `open_ncml`, which returns an `xarray.Dataset` built from an NcML. Note that
Only a subset of the NcML syntax is supported. (by :user:`huard`).
- Manipulate NcML file: add & remove attributes, variables and dimensions. (by :user:`andersy005`).
- Implement `open_ncml`, which returns an `xarray.Dataset` built from an NcML. Note that
Only a subset of the NcML syntax is supported. (by :user:`huard`).
8 changes: 0 additions & 8 deletions MANIFEST.in

This file was deleted.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ build-backend = "flit_core.buildapi"
[project]
name = "xncml"
authors = [
{name = "Anderson Banihirwe", email = "abanihi@ucar.edu"}
{name = "Anderson Banihirwe", email = "abanihi@ucar.edu"},
{name = "David Huard", email = "david.huard@gmail.com"}
]
maintainers = [
{name = "Anderson Banihirwe", email = "abanihi@ucar.edu"},
{name = "Abel Aoun", email = "aoun.abel@gmail.com"},
{name = "David Huard", email = "david.huard@gmail.com"},
{name = "Trevor James Smith", email = "trevor_smith@live.com"}
{name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"}
]
description = "Tools for manipulating and opening NCML (NetCDF Markup) files with/for xarray"
readme = {file = "README.rst", content-type = "text/x-rst"}
Expand Down Expand Up @@ -76,6 +76,7 @@ docs = [
all = ["xncml[dev]", "xncml[docs]"]

[project.urls]
"Homepage" = "https://xncml.readthedocs.io/"
"Changelog" = "https://xncml.readthedocs.io/en/stable/changelog.html"
"Issue tracker" = "https://github.com/xarray-contrib/xncml/issues"
"Source" = "https://github.com/xarray-contrib/xncml"
Expand Down
2 changes: 1 addition & 1 deletion src/xncml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###################################################################################
# Apache Software License 2.0
#
# Copyright (c) 2019-2024, Anderson Banihirwe, David Huard
# Copyright (c) 2019-2025, Anderson Banihirwe, David Huard, Abel Aoun, Trevor James Smith, Francis Charette-Migneault, Pascal Bourgault
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading