Skip to content

Commit

Permalink
fix: convert numpy.float64 to Python float in xarray interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
yaugenst-flex committed Jan 8, 2025
1 parent e3212ef commit 1a2e77d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Unreleased]

### Fixed

- NumPy 2.1 compatibility issue where `numpy.float64` values passed to xarray interpolation would raise TypeError.

## [2.8.0rc1] - 2024-12-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion tidy3d/components/geometry/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2536,7 +2536,7 @@ def derivative_face(
def integrate_face(arr: xr.DataArray) -> complex:
"""Interpolate and integrate a scalar field data over the face using bounds."""

arr_at_face = arr.interp(**{dim_normal: coord_normal_face}, assume_sorted=True)
arr_at_face = arr.interp(**{dim_normal: float(coord_normal_face)}, assume_sorted=True)

integral_result = integrate_within_bounds(
arr=arr_at_face,
Expand Down

0 comments on commit 1a2e77d

Please sign in to comment.