Skip to content

[Claude] Bug haul: 7 bugs in grid and core #1657

Description

@cmdupuis3

Version

v2026.07.0

How did you install UXarray?

Source

What happened?

Seven incidental bugs were found in scraping for performance issues. These line numbers are from the cmd/merge-OFE branch #1560, which will presumably be merged in soon.

Done Site Bug
grid/geometry.py:895, :904 _check_intersection returns True (abort signal) where siblings return an intersection count. Numba unifies to int64, so True1, and the parity test at :838 counts the abort as one intersection — flipping the pole-inside-polygon verdict.
grid/utils.py:432, grid/bounds.py:429, :431 np.isclose(a, b, tol) — the third positional parameter is rtol, not atol. Intended 1e-8 absolute becomes ~1.57e-8 effective on every pole test.
core/dataarray.py:1066 weighted_mean on non-face/non-edge data warns, leaves weights=None, then calls weights.sum() at :1076AttributeError instead of the documented unweighted mean.
core/api.py:587, :595, :599 concat compares grids by id(), so two structurally identical grids that went through Grid.copy() are rejected; and it returns the loop variable uxgrid rather than ref_uxgrid.
core/utils.py:59, :61, :63 dim_ordered is assigned inside a loop and consumed after it — last-match-wins, and NameError if no variable matches.
core/dataset.py:756 sel re-wraps with the unsliced self.uxgrid, so a sel on a grid dim leaves the grid inconsistent (isel does slice it).
grid/connectivity.py:547 _face_nodes_to_sparse_matrix is CSR-sorted by construction and test-covered (test/test_helpers.py:190) but has no production callers — the CSR builder this design wants, already sitting unused. Its non_filled_element_flags return is a wasted float64 all-ones array.

What did you expect to happen?

Good things?

Can you provide a MCVE to repoduce the bug?

Multiple

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    📚 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions