Skip to content

UxDataset and UxDataArray should not allow uxgrid=None #1620

Description

@Sevans711

Version

v2026.7.0

How did you install UXarray?

Source

What happened?

UxDataset and UxDataArray currently allow uxgrid=None, but their docstrings say "If None, it needs to be an instance of uxarray.Grid." I'm not really sure what that is supposed to mean.

Additionally, using uxgrid=None leads to confusing errors later, such as AttributeError: 'NoneType' object has no attribute 'n_face'. It would be much easier to debug an error like TypeError: UxDataArray.__init__() missing one required argument: 'uxgrid' instead.

What did you expect to happen?

I expected instantiating UxDataset and UxDataArray to fail if uxgrid is not provided.

Or, I expected a docstring which correctly clarifies what happens if uxgrid is None, perhaps providing at least one example use-case clarifying why uxgrid=None is supported?

Can you provide a MCVE to repoduce the bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    Status
    📝 To-Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions