Skip to content

Return NaN for YAC targets that receive no weights - #1924

Merged
rajeeja merged 2 commits into
mainfrom
rajeeja/yac-nan-unreached
Nov 25, 2026
Merged

rajeeja merged 2 commits into
mainfrom
rajeeja/yac-nan-unreached

Conversation

@rajeeja

@rajeeja rajeeja commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Closes #1923

Overview

_YacRemapper.apply now fills the target buffer with NaN before calling YAC, so targets that receive no weights come back as NaN instead of uninitialized memory. Adds test_yac_unreached_targets_are_nan.

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

  • [N/A] 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 (_)
  • [N/A] 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.

@rajeeja rajeeja added the bug Something isn't working label Nov 25, 2026

@erogluorhan erogluorhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@cmdupuis3 cmdupuis3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but note that the conservative method still returns 0 instead of NaN for targets it can’t reach.

@rajeeja
rajeeja merged commit fe9b48c into main Nov 25, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YAC remap returns uninitialized values for targets with no weights

3 participants