xarray
AGENTS.md4.2k starsChanged 18 days agoApache-2.0View on GitHub
Development environments are managed with pixi, the same ones CI uses (see [environments] in pixi.toml). They are installed on first use. Environments like test-py314-no-dask or test-py312-bare-minimum run the tests without some optional dependencies. See xarray/tests/AGENTS.md for guidelines on writing tests. - Always place imports at the top of the file in the standard import section - Never add imports inside functions or nested scopes unless there's a specific reason (e.g., circular import avoidance, optional dependencies in TYPE_CHECKING) - Group imports…
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Never add imports inside functions or nested scopes unless there's a specific reason (e.g., circular import avoidance, optional …
- Very specific: line 41
Always add type hints to every function and method you create or edit, including tests (-> None), fixtures and helpers
- Very specific: line 55
Never create issues nor pull requests on the xarray GitHub repository unless explicitly instructed
- Distinctive: line 57
Never post "update" messages, progress reports, or explanatory comments on GitHub issues/PRs unless specifically instructed
- Very specific: line 59
Don't comment on an issue to ask to be assigned or to announce that you are working on it or will open a PR.
- Very specific: line 62
When creating commits, always include a co-authorship trailer for the tool, e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
xarray development setup
Setup
Development environments are managed with pixi, the same ones
CI uses (see [environments] in pixi.toml). They are installed on first use.
Run tests
pixi run -e test-py313 -- python -m pytest xarray -n auto # All tests in parallel
pixi run -e test-py313 -- python -m pytest xarray/tests/test_dataarray.py # Specific fileEnvironments like test-py314-no-dask or test-py312-bare-minimum run the tests
without some optional dependencies.
See xarray/tests/AGENTS.md for guidelines on writing tests.
Linting & type checking
pixi exec pre-commit run --all-files # Includes ruff and other checks
pixi run -e test-py314-with-typing -- python -m mypy # Type checking with mypyCode Style Guidelines
Import Organization
- Always place imports at the top of the file in the standard import section
- Never add imports inside functions or nested scopes unless there's a specific reason (e.g., circular import avoidance, optional dependencies in TYPE_CHECKING)
- Group imports following PEP 8 conventions:
- Standard library imports
- Related third-party imports
- Local application/library specific imports
Type hints
- Always add type hints to every function and method you create or edit,
including tests (
-> None), fixtures and helpers
CI
- The
test-py314 (flaky)job runs tests that depend on external services (e.g. test.opendap.org) and fails regularly for unrelated reasons. It does not block merging, so don't skip or change these tests, ask for reruns, or explain these failures in PRs.
GitHub Interaction Guidelines
- NEVER impersonate the user on GitHub, always sign off with something like
"[This is
<tool name>on behalf of Jane Doe]" - Never create issues nor pull requests on the xarray GitHub repository unless explicitly instructed
- Never post "update" messages, progress reports, or explanatory comments on GitHub issues/PRs unless specifically instructed
- Don't comment on an issue to ask to be assigned or to announce that you are working on it or will open a PR. xarray does not assign issues: just open the PR and reference the issue in its description.
- When creating commits, always include a co-authorship trailer for the tool,
e.g.
Co-authored-by: Claude <noreply@anthropic.com>
Trending
Quiet since February.about the whole repository
Who's talking about pydata/xarray
- numpy/numpy“Ecosystem compatibility with numpy 2.0”GitHub · Apr 1, 2024 · 42 reactions
- numba/numba“Error on import with numpy HEAD”GitHub · Nov 22, 2022 · 18 reactions
- dask/dask“Silencing warnings issued by numpy functions within dask.array”GitHub · Mar 5, 2018 · 12 reactions
- vylor/rioxarray“Add raster index”GitHub · Feb 20, 2025 · 11 reactions
- scipy/scipy“RFC: switch documentation to markdown, remove rst (over time)”GitHub · Jan 8, 2024 · 10 reactions
The biggest 5 of 59 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 59
Talked about on Stack Overflow, GitHub and Hacker News (59 times).
On Stack Overflow · 30
- Dec 6, 2022xarray ERROR : ValueError: did not find a match in any of xarray's currently installed IO backends10 votes
- Oct 2, 2018Grouping by multiple dimensions9 votes
- Jan 30, 2018Xarray rolling mean with weights9 votes
- Dec 14, 2016Why is 'invalid value encountered in greater' warning thrown in python xarray for nan? Shouldn't the nan commute without any issues?8 votes
- Apr 20, 2016How to merge xArray datasets with conflicting coordinates8 votes
25 more on Stack Overflow
- Jun 3, 2021ValueError: unrecognized engine zarr must be one of: ['scipy', 'store']6 votes
- Oct 31, 2017How to flatten an xarray dataset into a 1D numpy array?6 votes
- Nov 23, 2020Getting a view of a zarr array slice5 votes
- Apr 7, 2022edit an existing NetCDF / write a netcdf to the same name4 votes · 1 answer
- Sep 30, 2020Writing xarray multiindex data in chunks4 votes
- Aug 1, 2019Iteratively fill NaN values in xarray with dask4 votes
- Nov 29, 2017concat Datasets along multiple dimensions4 votes · 1 answer
- May 19, 2021Dask: convert a dask.DataFrame to an xarray.Dataset3 votes
- Jan 7, 2020xarray select on 2 dimensional coordinates3 votes
- Nov 14, 2019How to create scalar dimension in xarray?3 votes
- Jan 26, 2017What are “unindexed dimensions” and why are coordinates *empty*?3 votes
- Aug 1, 2022getting typerror while importing xarray and odc python packages2 votes
- Jan 25, 2021using scipy curve_fit with dask/xarray2 votes
- Sep 7, 2017Read grib2 file with xarray2 votes
- Dec 28, 2016dask and parallel hdf5 writing2 votes
- Nov 9, 2016Take a 1D list of results and convert it to a N-D xarray.DataArray2 votes · 2 answers
- Dec 18, 2024Variable 'lat' has conflicting _FillValue (nan) and missing_value (-9999.0). Cannot encode data1 vote
- Jul 21, 2023How to store a subset of Xaray data into Zarr?1 vote
- Jun 22, 2023xarray/dask - limiting the number of threads/cpus1 vote
- Jan 20, 2023Create Xarray dataset from grd files and list of grid coordinates1 vote
- Jun 19, 2020Xarray Distributed Failed to serialize1 vote · 2 answers
- Feb 21, 2020How to find top 10 values in a xarray dataset with coordinates?1 vote
- Nov 27, 2019What is xarray.DataArray.expand_dims supposed to do?1 vote
- May 16, 2018xarray: rolling mean of dask array conflicting sizes for data and coordinate in rolling operation1 vote
- Oct 20, 2016Time series composite of python-xarray.1 vote
On GitHub · 27
- Apr 1, 2024Ecosystem compatibility with numpy 2.0 — numpy/numpy42 reactions · 167 comments
- Nov 22, 2022Error on import with numpy HEAD — numba/numba18 reactions · 31 comments
- Mar 5, 2018Silencing warnings issued by numpy functions within dask.array — dask/dask12 reactions · 30 comments
- Feb 20, 2025Add raster index — vylor/rioxarray11 reactions · 4 comments
- Jan 8, 2024RFC: switch documentation to markdown, remove rst (over time) — scipy/scipy10 reactions · 5 comments
22 more on GitHub
- Aug 2, 2022Add Kvikio backend entrypoint — xarray-contrib/cupy-xarray10 reactions · 10 comments
- Feb 23, 2020QGIS Plugin and Xarray Extension — pyvista/pyvista9 reactions · 18 comments
- Jan 21, 2022Multiscale convention — zarr-developers/zarr-specs8 reactions · 16 comments
- Apr 21, 2021Regression: poor memory management in threads and sync schedulers — dask/dask8 reactions · 25 comments
- Jul 26, 2024Zarr as a "universal reader" for netCDF etc., via new CF decoding codecs — zarr-developers/zarr-specs6 reactions · 3 comments
- Mar 23, 2022Alignment with xarray — scverse/anndata6 reactions · 18 comments
- Sep 20, 2020xarray 0.16.1 breaks compatibility — arviz-devs/arviz6 reactions · 8 comments
- Jul 5, 2016Deprecation of Panel ? — pandas-dev/pandas6 reactions · 10 comments
- May 23, 2025Add async oindex and vindex methods to AsyncArray — zarr-developers/zarr-python5 reactions · 10 comments
- Sep 25, 2024Of APE 14 WCS and Xarray flexible coordinate transform — astropy/astropy5 reactions · 5 comments
- Jan 21, 2024BUG: `to_timedelta` raises unexpected `OutOfBoundsTimedelta` error with development version of NumPy — pandas-dev/pandas5 reactions · 1 comment
- Oct 29, 2023TYP: Improved support for typing with __array_function__ usage — numpy/numpy5 reactions · 2 comments
- Sep 29, 2023spec-0 and spec-4 endorsements by xarray — scientific-python/specs5 reactions · 1 comment
- Jun 21, 2022open up discussion tab on github? — ecmwf/eccodes-python5 reactions · 2 comments
- Sep 10, 2019A convention for complex numbers? — cf-convention/discuss5 reactions · 44 comments
- Dec 4, 2024Datatree release blog post — xarray-contrib/xarray.dev4 reactions · 3 comments
- Oct 12, 2024Virtual Dataset Workflow Tracking Issue — earth-mover/icechunk4 reactions · 11 comments
- Mar 31, 2023Many HDF5-DIAG warnings when used with xarray and dask — Unidata/netcdf4-python4 reactions · 3 comments
- Oct 13, 2022Idea: Xarray interface — Open-EO/openeo-python-client4 reactions · 5 comments
- Aug 2, 2022Requirements for better Xarray integration — xarray-contrib/cupy-xarray4 reactions
- Feb 17, 2026feat: Support variable chunking — zarr-developers/VirtualiZarr3 reactions · 2 comments
- Apr 17, 2025fix: Special-case suffix requests in obstore backend to support Azure — zarr-developers/zarr-python3 reactions · 11 comments
On Hacker News · 2
- Sep 16, 2021xarray: N-Dimensional labeled arrays and datasets in Python3 points
- Jun 11, 2021Python: xarray2 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- drop-python-versionSkill
- upgrade-min-versionsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

