Skip to content

Fill all-NaN series with zeros in TimesFM 2.5 interpolation - #486

Open
gyanu2507 wants to merge 1 commit into
google-research:masterfrom
gyanu2507:fix/linear-interpolation-all-nan
Open

Fill all-NaN series with zeros in TimesFM 2.5 interpolation#486
gyanu2507 wants to merge 1 commit into
google-research:masterfrom
gyanu2507:fix/linear-interpolation-all-nan

Conversation

@gyanu2507

@gyanu2507 gyanu2507 commented Sep 3, 2026

Copy link
Copy Markdown

Summary

TimesFM 2.5 linear_interpolation falls back with if non_nans_values: when np.interp has no anchors. On NumPy 2.x that is ValueError: The truth value of an empty array is ambiguous, so an all-NaN series crashes before a forecast. v1 uses len(...) > 0 and TimesFM3 uses .size > 0, both filling 0.0.

Test plan

  • all-NaN input becomes [0.0, 0.0, 0.0]
  • existing interpolation cases still pass

@google-cla

google-cla Bot commented Sep 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

`if non_nans_values` is ambiguous for an empty ndarray on NumPy 2.x, so
an all-NaN input crashed instead of filling 0.0 like v1 and TimesFM3.
@gyanu2507
gyanu2507 force-pushed the fix/linear-interpolation-all-nan branch from f649ec2 to e660476 Compare September 4, 2026 05:23
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