BUG: XTensorVariable.stack/.unstack methods reject keyword dims (x.stack(z=[...])) that the stack/unstack functions accept

Open
#2,716 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@atishay-kasliwal is already working on this.

Since Nov 24, 2026.

  • #2719 by @atishay-kasliwal — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start from the XTensorVariable.stack and XTensorVariable.unstack methods and compare their signatures with the module-level stack/unstack functions the issue says already accept keyword dims; the gap is in how the methods pass their arguments through. Read the call that x.stack(z=[...]) reaches and make it accept the same keyword form as the functions and as xarray's DataArray.stack. Done looks like x.stack(z=[...]) and the matching unstack call behaving like their function counterparts, with a test covering the keyword form.

Written by the indexing model from the issue text.

Description

xarray's DataArray.stack(z=[...]) works so xtensor should too

Dominant language
Python
Stars
655
Forks
266
Avg merge
3d 23h
Merged PRs (30d)
43

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pymc-devs/pytensor

All issues in pymc-devs/pytensor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.