Skip to content

Collapse duplicated accessor methods#69

Closed
thodson-usgs wants to merge 1 commit into
xarray-contrib:mainfrom
thodson-usgs:refactor/collapse-accessor-methods
Closed

Collapse duplicated accessor methods#69
thodson-usgs wants to merge 1 commit into
xarray-contrib:mainfrom
thodson-usgs:refactor/collapse-accessor-methods

Conversation

@thodson-usgs
Copy link
Copy Markdown

Small refactor of regrid.py accessor methods — no behavior change, public API unchanged.

  • linear / nearest / cubic had identical 3-line bodies differing only in the method string. Extracted a private _interp.
  • most_common / least_common were near-identical with an anti_mode flag already threaded through to compute_mode. Extracted a private _mode that also builds the error label from the same flag.

Net: +29 / -32 LOC in one file. Existing tests pass.

Touches the same methods as #68 — whichever merges first, the other rebases cleanly.

The three interp methods (linear/nearest/cubic) had identical 3-line
bodies differing only in the method string; extract a private `_interp`.
most_common/least_common were near-identical with an `anti_mode` flag
already threaded through to `compute_mode`; extract a private `_mode`
that also builds the error label from the same flag.

No behavior change; public API unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant