Skip to content

UxDataset.to_array() missing args/kwargs dim and name #1520

@Sevans711

Description

@Sevans711

Version

2026.4.2.dev20+g4ef52a78e

How did you install UXarray?

Source

What happened?

I called uxds.to_array(dim='data_vars_dim'), where uxds is a UxDataset object. This caused crash: TypeError: UxDataset.to_array() got an unexpected keyword argument 'dim'.

What did you expect to happen?

I expected this to return a UxDataArray with data_vars stacked along a dimension named "data_vars_dim" instead of along a dimension named "variable". This would follow xarray's interface for xr.Dataset.to_array() which accepts "dim" (and "name") inputs.

Can you provide a MCVE to repoduce the bug?

import uxarray as ux
uxds = ux.UxDataset(data_vars={"a": ("x", [1, 2])})
uxds.to_array(dim='data_vars_dim')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    📚 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions