Bring xr.align objects specification in line with other top-level functions?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Was wondering if this might be useful given that I ran into this point of confusion. Observing the following argument specifications for various top-level xarray functions:
xarray.align(*objects, join='inner', copy=True, indexes=None, exclude=frozenset())
xarray.concat(objs, dim=None, data_vars='all', coords='different', compat='equals', positions=None, indexers=None, mode=None, concat_over=None)
xarray.concat(objs, dim=None, data_vars='all', coords='different', compat='equals', positions=None, indexers=None, mode=None, concat_over=None)
xarray.merge(objects, compat='no_conflicts', join='outer')
the odd man out here would be xr.align utilizing the *args formulation whereas all the others just take a single objs / objects param, instead. Would it make sense to add functionality to align such that if *args (*objects) is of length 1 and is a list or tuple (or something in this ballpark), you just treat it as the other methods currently operate?
For reference, if you don't notice that align works differently, if you pass an iterable without *args-ifying it, you get this somewhat unhelpful error:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the public xarray.align API and comparing its signature and input handling with xarray.concat and xarray.merge. Clarify the intended behavior for a single list or tuple versus the existing argument forms, then verify that the resulting error handling and documented usage match the requested consistency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100