Skip to content

Upgrade YAC to v3.21.0 and YAXT to v0.12.2.2, expose more YAC methods - #1907

Draft
rajeeja wants to merge 6 commits into
mainfrom
rajeeja/yac-3-21
Draft

rajeeja wants to merge 6 commits into
mainfrom
rajeeja/yac-3-21

Conversation

@rajeeja

@rajeeja rajeeja commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1906

Overview

  • ⬆️ Upgrade: optional YAC CI now builds YAC v3.21.0 (2026-08-25) and YAXT v0.12.2.2 (2026-11-11), up from v3.20.2 (2026-08-12) and v0.11.5.1 (2025-11-28).
  • 🐛 Bilinear fix: found during the upgrade. bilinear(backend="yac") now defaults to reduction_type="AVG_BARY" (barycentric) instead of YAC's arithmetic average, and matches the native backend. A user yac_options value still overrides it.
  • ✨ New yac_method values:
    • "ncc" (nearest corner cells): weight_type ("YAC_INTERP_NCC_AVG" default | "YAC_INTERP_NCC_DIST", also accepted as reduction_type), partial_coverage (bool, default False).
    • "rbf" (radial basis function): n (default 9 source points), max_search_distance (default 0.0, unlimited), scale (default 14.87973).
    • "bernstein_bezier": no options.
  • ➕ creep_distance (new yac_options key): adds a creep fill after the chosen method, so targets it left empty (for example DNN with a small search distance) are filled from filled neighbors. It is the maximum number of neighbor steps, -1 means unlimited, and it is not applied to "conservative".
  • 🚫 Not exposed: n_min (new in v3.21.0, but yac.core does not take it yet), spmap, user_file, check.
  • 🛡️ Clear errors: dnn to nodes or edges without a FIXED search distance, and ncc from a non-face source, now raise ValueError. YAC aborts the whole process on both.
  • 📚 Docs: accessor docstrings, and the method list and table in docs/user-guide/remapping.ipynb.

Expected Usage

import uxarray as ux

uxds = ux.open_dataset(grid_path, data_path)

# bilinear now uses barycentric weights with the YAC backend
out = uxds["var"].remap.bilinear(destination_grid=dest, backend="yac")

# new methods
out = uxds["var"].remap.nearest_neighbor(
    destination_grid=dest, backend="yac", yac_method="rbf", yac_options={"n": 9}
)

# fill targets the chosen method left empty
out = uxds["var"].remap.nearest_neighbor(
    destination_grid=dest,
    backend="yac",
    yac_method="dnn",
    yac_options={
        "search_distance_type": "FIXED",
        "search_distance": 0.02,
        "creep_distance": -1,
    },
)

PR Checklist

General

  • An issue is created and linked
  • Added appropriate labels (if your uxarray repo permissions allow it)
  • Filled out Overview and Expected Usage (if applicable) sections

Testing & Benchmarking

  • There is adequate test coverage of changes from this PR (add new tests if needed)
  • [N/A] If this PR could affect performance, ran ASV benchmarks and confirmed they show expected behavior (add a new benchmark if necessary)

Documentation and Examples

  • Docstrings updated with any function changes, and included in all new functions
  • [N/A] User (public) functions added to docs/api.rst; internal (private) function names start with an underscore (_)
  • If touched any notebook files, cleared the output of all cells before committing
  • [N/A] If added new notebook files, put into appropriate directories and referenced in appropriate files

AI Disclosure

AI Usage:

  • I have tested and take responsibility for all AI-generated content in my PR.

Both versions build and pass test/test_remap_yac.py locally with no source changes.
bilinear(backend='yac') used YAC's default arithmetic average, which is not bilinear. It now uses barycentric weights and matches the native result.
Adds the methods to yac_method, an optional creep_distance fill, tests, and docs.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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.

Upgrade the optional YAC backend to YAC v3.21.0 and YAXT v0.12.2.2

1 participant