Skip to content

Commit

Permalink
Fix XArray LCS join (#861)
Browse files Browse the repository at this point in the history
* adjust reference time handling in xr_interp_coordinates_in_time

---------

Co-authored-by: Cagtay Fabry <43667554+CagtayFabry@users.noreply.github.com>
  • Loading branch information
marscher and CagtayFabry authored Apr 3, 2023
1 parent 4215eb0 commit ae16d42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 0.6.5 (unreleased)

### Dependencies

- require XArray >= 2022.9.0, as `LocalCoordinateSystem` now handles merges correctly \[{pull}`861`\].

## 0.6.4 (09.02.2023)

Version `0.6.4` is a small maintenance release with no changes affecting user code.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [
"numpy >=1.20",
"asdf >=2.8.2,!=2.14.0,!=2.14.1,!=2.14.2",
"pandas >=1.0",
"xarray >=0.19,<2022.09.0",
"xarray >=2022.9.0",
"scipy >=1.4,!=1.6.0,!=1.6.1",
"sympy >=1.6",
"pint >=0.18",
Expand Down
4 changes: 4 additions & 0 deletions weldx/util/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,14 @@ def xr_interp_coordinates_in_time(
return da

times = Time(times).as_pandas_index()
time_ref = da.weldx.time_ref
da = da.weldx.time_ref_unset()
da = xr_interp_like(
da, {"time": times}, assume_sorted=True, broadcast_missing=False, fillna=True
)
# resync and reset to correct format
if time_ref:
da.weldx.time_ref = time_ref
da = da.weldx.time_ref_restore()

if len(da.time) == 1: # remove "time dimension" for static cases
Expand Down

0 comments on commit ae16d42

Please sign in to comment.