pydata / pydata/xarray

Add a new broadcasting mode that inserts size-1 dimensions.

Open
#10,033 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

I've found it useful to broadcast to size-1 unlabeled dimensions. This allows you to avoid useless extra work in functions that accept unlabeled arrays, and would be very convenient when paired with apply_ufunc.

For example: https://github.com/xarray-contrib/flox/blob/ca576812e78b3978421eace6e9dde5a76729ebcc/flox/xarray.py#L45-L62

This should be paired with #2171

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading the flox example at xarray.py lines 45-62 and the related issue #2171 to understand the intended broadcasting behavior. Done means adding a broadcasting mode that inserts size-1 unlabeled dimensions and coordinating it with #2171.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.