Skip to content

Conversation

@meggart
Copy link
Member

@meggart meggart commented Oct 30, 2025

This fixes a bug similar to the one described by @felixcremer in rafaqz/Rasters.jl#1000 by rounding to the closest millisecond before converting time stamps to DateTime.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.87%. Comparing base (8bd94a0) to head (afd160e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #560      +/-   ##
==========================================
+ Coverage   69.80%   69.87%   +0.07%     
==========================================
  Files          14       14              
  Lines        2113     2118       +5     
==========================================
+ Hits         1475     1480       +5     
  Misses        638      638              
Files with missing lines Coverage Δ
src/DatasetAPI/Datasets.jl 85.54% <100.00%> (+0.12%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tsteps = try
timedecode(ar[:], aratts["units"], lowercase(get(aratts, "calendar", "standard")))
dec = timedecode(ar[:], aratts["units"], lowercase(get(aratts, "calendar", "standard")), prefer_datetime=false)
round_datetime.(dec)
Copy link
Member

Choose a reason for hiding this comment

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

This is breaking because it changes the output type to a DateTime. This function should only be called when the prefer_datetime keyword is true.
This is also the cause of the doc build failure.

Suggested change
round_datetime.(dec)
prefer_datetime && round_datetime.(dec)

Copy link
Collaborator

@lazarusA lazarusA Nov 3, 2025

Choose a reason for hiding this comment

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

unfortunately,

failed to run `@example` block in docs/src/UserGuide/select.md:45-49
│ ```@example subset
│ using CFTime
│ time1 = DateTime360Day(2001,01,16)
│ tos[time = At(time1)]
│ ```
│   exception =
│    promotion of types CFTime.DateTime360Day{CFTime.Period{Int64, Val{1}(), Val{-3}()}, Val{(1900, 1, 1)}()} and DateTime failed to change any arguments
│    Stacktrace:
│      [1] error(::String, ::String, ::String)

Copy link
Member

Choose a reason for hiding this comment

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

Is this with my suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh, sorry is still a suggestion! Not merged yet. Sorry, my bad 😞. We need to apply the suggestion to see the effect then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants