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
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
### Description

### Checklist

<!-- Feel free to remove check-list items aren't relevant to your change -->

- [ ] Closes #xxxx
- [ ] Tests added
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
- [ ] New functions/methods are listed in `api.rst`

### AI Disclosure

<!--- Please review our AI & contribution guidelines: https://docs.xarray.dev/en/stable/contribute/ai-policy.html. Remove this section if your PR does not contain AI-generated content. --->

- [ ] This PR contains AI-generated content.
- [ ] I have tested any AI-generated content in my PR.
- [ ] I take responsibility for any AI-generated content in my PR.
<!--- If you used AI to generate code, please specify the tool used and the prompt below. --->
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
14 changes: 7 additions & 7 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- uses: actions/checkout@v6
- uses: Parcels-code/pixi-lock/create-and-cache@a9aee67fa67426e6b0297fa5bef80600572be153
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
id: pixi-lock
- uses: actions/upload-artifact@v7
with:
Expand All @@ -72,7 +72,7 @@ jobs:
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
fetch-depth: 0

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

steps:
- uses: actions/checkout@v6
- uses: Parcels-code/pixi-lock/create-and-cache@a9aee67fa67426e6b0297fa5bef80600572be153
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
id: pixi-lock
- uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hypothesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }}
steps:
- uses: actions/checkout@v6
- uses: Parcels-code/pixi-lock/create-and-cache@a9aee67fa67426e6b0297fa5bef80600572be153
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
id: pixi-lock
- uses: actions/upload-artifact@v7
with:
Expand All @@ -78,7 +78,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
pixi-version: ${{ steps.pixi-lock.outputs.pixi-version }}
steps:
- uses: actions/checkout@v6
- uses: Parcels-code/pixi-lock/create-and-cache@a9aee67fa67426e6b0297fa5bef80600572be153
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
id: pixi-lock
- uses: actions/upload-artifact@v7
with:
Expand All @@ -84,7 +84,7 @@ jobs:
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Restore cached pixi lockfile
uses: Parcels-code/pixi-lock/restore@a9aee67fa67426e6b0297fa5bef80600572be153
uses: Parcels-code/pixi-lock/restore@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
with:
cache-key: ${{ needs.cache-pixi-lock.outputs.cache-key }}
- uses: prefix-dev/setup-pixi@v0.9.4
Expand Down
1 change: 1 addition & 0 deletions AI_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc/contribute/ai-policy.md
88 changes: 88 additions & 0 deletions doc/contribute/ai-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!-- markdownlint-disable MD013 -->

# AI Usage Policy

**Note:** Some Xarray developers use AI tools as part of our development workflow.
We assume this is now common. Tools, patterns, and norms are evolving fast — this
policy aims to avoid restricting contributors' choice of tooling while ensuring that:

- Reviewers are not overburdened
- Contributions can be maintained
- The submitter can vouch for and explain all changes
- Developers can acquire new skills[^1]

To that end this policy applies regardless of whether the code was written by hand, with
AI assistance, or generated entirely by an AI tool.

[^1]:
Over-reliance on AI tools has been shown to
[hinder skill formation amongst software developers](https://arxiv.org/abs/2601.20245).

## Core Principle: Changes

If you submit a pull request, you are responsible for understanding and having fully reviewed
the changes. You must be able to explain why each change is correct[^2] and how it fits into
the project. Strive to minimize changes to ease the burden on reviewers — avoid
including unnecessary or loosely related changes.

[^2]:
You may also open a draft PR with changes in order to discuss and receive feedback on the
best approach if you are not sure what the best way forward is.

## Core Principle: Communication

PR descriptions, issue comments, and review responses must be your own words. The
substance and reasoning must come from you. Do not paste AI-generated text as
comments or review responses. Please attempt to be concise.

PR descriptions should follow the provided template.

Using AI to improve the language of your writing (grammar, phrasing, spelling, etc.) is
acceptable. Be careful that it does not introduce inaccurate details in the process.

Maintainers reserve the right to delete or hide comments that violate our AI policy or code of conduct.

## Code and Tests

### Review Every Line

You must have personally reviewed and understood all changes before submitting.

If you used AI to generate code, you are expected to have read it critically and
tested it. As with a hand-written PR, the description should explain the approach
and reasoning behind the changes. Do not leave it to reviewers to figure out what
the code does and why.

#### Not Acceptable

> I pointed an agent at the issue and here are the changes

> This is what Claude came up with. 🤷

#### Acceptable

> I iterated multiple times with an agent to produce this. The agent wrote the code at my direction,
> and I have fully read and validated the changes.

> I pointed an agent at the issue and it generated a first draft. I reviewed the changes thoroughly and understand the implementation well.

### Large AI-Assisted Contributions

Generating code with agents is fast and easy. Reviewing it is not. Making a PR with a large diff
shifts the burden from the contributor to the reviewer. To guard against this asymmetry:

If you are planning a large AI-assisted contribution (e.g., a significant refactor, a
framework migration, or a new subsystem), **open an issue first** to discuss the scope
and approach with maintainers. This helps us decide if the change is worthwhile, how
it should be structured, and any other important decisions.

Maintainers reserve the right to close PRs where the scope makes meaningful review
impractical, or when they suspect this policy has been violated. Similarly they may request
that large changes be broken into smaller, reviewable pieces.

## Documentation

The same core principles apply to both code and documentation. You must review the result
for accuracy and are ultimately responsible for all changes made. Xarray has domain-specific
semantics that AI tools frequently get wrong. Do not submit documentation that you
haven't carefully read and verified.
2 changes: 1 addition & 1 deletion doc/contribute/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Overview
We welcome your skills and enthusiasm at the xarray project!. There are numerous opportunities to
contribute beyond just writing code.
All contributions, including bug reports, bug fixes, documentation improvements, enhancement suggestions,
and other ideas are welcome.
and other ideas are welcome. LLM generated contributions are welcome, but they must follow :doc:`our AI policy <ai-policy>`.

If you have any questions on the process or how to fix something feel free to ask us!
The recommended places to ask questions are `GitHub Discussions <https://github.com/pydata/xarray/discussions>`_
Expand Down
1 change: 1 addition & 0 deletions doc/contribute/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ In this section you will also find documentation on the internal organization of
:hidden:

contributing
ai-policy
../internals/index
../roadmap
../whats-new
Expand Down
4 changes: 3 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ Bug Fixes
Documentation
~~~~~~~~~~~~~

- Add AI policy (:pull:`11257`).
By `Nick Hodgskin <https://github.com/VeckoTheGecko>`_.
- Update documentation and team guide to promote Zulip. Remove mentions of Discord (:pull:`11246`, :pull:`11254`).
By `Nick Hodgskin <https://github.com/VeckoTheGecko>`_.
- Fix typos (:pull:`11180`, :pull:`11181`, :pull:`11182`, :pull:`11185`, :pull:`11186`).
Expand All @@ -136,9 +138,9 @@ Performance

Internal Changes
~~~~~~~~~~~~~~~~

- Add script for linting of public docstrings according to numpydoc (:pull:`11121`).
By `Nick Hodgskin <https://github.com/VeckoTheGecko>`_.

- Add stubtest configuration and allowlist for validating type annotations against
runtime behavior. This enables CI integration for type stub validation and helps
prevent type annotation regressions (:issue:`11086`).
Expand Down
Loading