xCDAT / xcdat

An extension of xarray for climate data analysis on structured grids.
https://xcdat.readthedocs.io/en/latest/
Apache License 2.0
101 stars 11 forks source link

[PR] time type conversion to timedelta if timedelta64 is given #660

Closed lee1043 closed 3 weeks ago

lee1043 commented 4 weeks ago

Description

make sure time diff type is timedelta: in case it was timedelta64 convert it, so following .seconds line could run without error

Checklist

If applicable:

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (9ad91a0) to head (189e526).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #660 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 15 15 Lines 1542 1544 +2 ========================================= + Hits 1542 1544 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tomvothecoder commented 3 weeks ago

I pushed commit https://github.com/xCDAT/xcdat/pull/660/commits/c6b314a1c7e33df200a3bba2bd0e73ae0748acad to add test coverage for the new code. This PR should be good to go.

lee1043 commented 3 weeks ago

@tomvothecoder thanks for the addition.

I am merging this PR.