Repository navigation
Fix datetime assume UTC allow ranges - #31
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
==========================================
- Coverage 75.77% 75.00% -0.78%
==========================================
Files 9 9
Lines 322 336 +14
==========================================
+ Hits 244 252 +8
- Misses 78 84 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks a lot for the PR! (I removed Concerning the start_datetime and end_datetime: would it be better to return a tuple with both (rather than the first)? The function is already now (somewhat) type unstable ( Alternatively, there could also be the methods Maybe we can have a function like function tryparse_utc(s)
try
return DateTime(s, Dates.dateformat"yyyy-mm-ddTHH:MM:SS.sZ")
catch
return nothing
end
end |
There was a problem hiding this comment.
The method is called DateTime(item::Item) thus I think it would be confusing to also return a tuple of time span. There is also STAC extension timestamps defining the entire life cycle from capture to publishing, motivating new calls like get_datetime(item, :published). How about having the general method get_datetime and maybe add the exposure duration to the show method if a range is present?
|
Thanks a lot ! Would you be ok to call the function |
|
This is great, thank you! |
This PR aims to fix the error of parsing datetime e.g. at CDSE. Consider the README example:
returns error
According to STAC Spec 1.1, acquisition time of STAC items is mainly stored in filed
datetime, SHOULD be in UTC, and may be an interval instead fromstart_datetimetoend_datetime.Therefore, I used
Dates.dateformat"yyyy-mm-ddTHH:MM:SS.sZ", also tried start of datetime range, and kept returningnothingotherwise.