JuliaDataCubes / YAXArrays.jl

Yet Another XArray-like Julia package
https://juliadatacubes.github.io/YAXArrays.jl/
Other
89 stars 14 forks source link

try to fix Ti error #337

Closed kongdd closed 9 months ago

kongdd commented 9 months ago

try to fix #336, #330, #320, might also works for #301

This issue is related to DD.dim2key(ti) and DD.name(ti). They return different values.

using DimensionalData
using DimensionalData: DimensionalData as DD
using Dates

ti = Ti(DateTime(2001):Month(1):DateTime(2002))

@show DD.dim2key(ti);
@show DD.name(ti);
DD.dim2key(ti) = :Ti
DD.name(ti) = :Time
lazarusA commented 9 months ago

Thanks for this PR, could you please try to include a test example. For now, I approved CI to check if nothing breaks as it is.

kongdd commented 9 months ago

Thank you. After all tests passed, I will add new.

codecov[bot] commented 9 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Files Coverage Δ
src/DatasetAPI/Datasets.jl 76.92% <100.00%> (+41.77%) :arrow_up:

... and 2 files with indirect coverage changes

:loudspeaker: Thoughts on this report? Let us know!.

kongdd commented 9 months ago

@lazarusA, do you know about the Broken in tests?

It shows that 9 broken. But I can't found out which test failed.

image

https://github.com/JuliaDataCubes/YAXArrays.jl/actions/runs/6368945266/job/17288790299?pr=337

kongdd commented 9 months ago

The test of Datasets is commented. I am not sure whether should I uncomment this line. https://github.com/JuliaDataCubes/YAXArrays.jl/blob/4f4f555cb1583dff91e437bbd684a7de471ed498/test/runtests.jl#L15

kongdd commented 9 months ago

https://github.com/JuliaDataCubes/YAXArrays.jl/issues/336, https://github.com/JuliaDataCubes/YAXArrays.jl/issues/330 are solved now. https://github.com/JuliaDataCubes/YAXArrays.jl/issues/320 should also be. But I have no data to test.

lazarusA commented 9 months ago

I'm doing another CI run. Let's see, I cannot do much today, only things from my phone. I could take a deeper look once I'm at my computer

kongdd commented 9 months ago

Thank you @lazarusA. An ugly test was added here. All tests in datasets.jl are uncommented and passsed now. image

lazarusA commented 9 months ago

Could you use https://juliadatacubes.github.io/YAXArrays.jl/dev/examples/generated/UserGuide/openNetCDF/ ? It's Ti still appearing when reading the files?

kongdd commented 9 months ago

Sure. New test Added and Passed. image

kongdd commented 9 months ago

I found both of DD.dim2key and DD.name are used in YAXArrays.jl. Their different return values might lead to bugs unexpectedly.