Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix LCS time handling for xarray>=2023.4.0 #868

Merged
merged 13 commits into from
Apr 18, 2023

Conversation

CagtayFabry
Copy link
Member

@CagtayFabry CagtayFabry commented Apr 16, 2023

Some time interpolation code seems to break with the new xarray release (seemingly unrelated of pandas major version 1 or 2)

Changes

  • add explicit handling of reference time for coordinates/orientation in LocalCoordinateSystem code
  • set keep_attrs=True when applying xarray.apply_ufunc

@CagtayFabry CagtayFabry added dependencies changes in package dependencies bug Something isn't working xarray issues related to handling xarray objects labels Apr 16, 2023
@codecov
Copy link

codecov bot commented Apr 16, 2023

Codecov Report

Merging #868 (5743a01) into master (9cb7f08) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #868   +/-   ##
=======================================
  Coverage   96.51%   96.51%           
=======================================
  Files          94       94           
  Lines        6283     6283           
=======================================
  Hits         6064     6064           
  Misses        219      219           
Impacted Files Coverage Δ
weldx/transformations/local_cs.py 96.35% <ø> (ø)
weldx/util/xarray.py 96.15% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

github-actions bot commented Apr 16, 2023

Test Results

2 189 tests  ±0   2 188 ✔️ ±0   4m 3s ⏱️ +2s
       1 suites ±0          1 💤 ±0 
       1 files   ±0          0 ±0 

Results for commit 5743a01. ± Comparison against base commit 9cb7f08.

♻️ This comment has been updated with latest results.

@marscher
Copy link
Contributor

marscher commented Apr 17, 2023

Thanks! It'd be good to have a stack trace or failed report inside an issue, since the logs gets deleted after some time.

@CagtayFabry
Copy link
Member Author

Thanks! It'd be good to have a stack trace or failed report inside an issue, since the logs gets deleted after some time.

The thing with these failures it the error itself is not that important, more the environment and installed packages. But we can paste those here

@marscher
Copy link
Contributor

It is also strange, that the conda build also installs pandas 1.5.3, but the tests succeed.

@CagtayFabry
Copy link
Member Author

It is also strange, that the conda build also installs pandas 1.5.3, but the tests succeed.

The problem seems to be related to xarray 2023.4.0, which is available on PyPi but not released on conda-forge yet

(maybe the error would also arise with pandas 2 but we cant test that against an older working xarray version)

@CagtayFabry CagtayFabry changed the title pin xarray<2023.4.0 fix LCS time handling for xarray>=2023.4.0 Apr 18, 2023
@CagtayFabry CagtayFabry added tests pytest (and other tests) related transformations everything related to the LCS / CSM labels Apr 18, 2023
@CagtayFabry CagtayFabry requested a review from marscher April 18, 2023 12:28
@CagtayFabry
Copy link
Member Author

I have tested this manually with old xarray=2022.9.0 and pandas=1.3.5 versions

The new code is more explicit in achieving the desired behavior. However much of the time related code should be reworked soon to reduce the compelxity

@@ -360,6 +364,7 @@ def _check_and_normalize_orientation(orientation: xr.DataArray) -> xr.DataArray:
orientation,
input_core_dims=[["c"]],
output_core_dims=[["c"]],
keep_attrs=True,
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure how or if default arguments changed with regards to keeping xarray attributes, however this is what we want

Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually, we should make these arguments explicit to avoid breaking changes due to upstream default argument changes?

@CagtayFabry CagtayFabry enabled auto-merge April 18, 2023 12:54
@CagtayFabry CagtayFabry disabled auto-merge April 18, 2023 12:55
@CagtayFabry CagtayFabry enabled auto-merge April 18, 2023 12:58
@CagtayFabry CagtayFabry added this pull request to the merge queue Apr 18, 2023
@CagtayFabry CagtayFabry removed this pull request from the merge queue due to a manual request Apr 18, 2023
@CagtayFabry CagtayFabry added this pull request to the merge queue Apr 18, 2023
@CagtayFabry CagtayFabry removed this pull request from the merge queue due to a manual request Apr 18, 2023
@CagtayFabry CagtayFabry merged commit 3b17483 into master Apr 18, 2023
@CagtayFabry CagtayFabry deleted the pip-list-build-environment branch April 18, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies changes in package dependencies tests pytest (and other tests) related transformations everything related to the LCS / CSM xarray issues related to handling xarray objects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants