Skip to content

Commit 673e223

Browse files
authored
New ncdatasets version (#113)
* bump dependency first, fix breakage later * fix first instance of using map over dicts * fix incorrectly used `BaseAttributes` * also bump DimData.jl again... * nah wait with DD for now * fix failing datetime test * also update dd dependency * correct version
1 parent 2c67b69 commit 673e223

7 files changed

Lines changed: 12 additions & 11 deletions

File tree

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ClimateBase"
22
uuid = "35604d93-0fb8-4872-9436-495b01d137e2"
33
authors = ["Datseris <datseris.george@gmail.com>", "Philippe Roy <borghor@yahoo.ca>"]
4-
version = "0.17.4"
4+
version = "0.17.5"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -20,10 +20,10 @@ GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
2020
ClimateBaseVisualizations = "GeoMakie"
2121

2222
[compat]
23-
DimensionalData = "0.29"
23+
DimensionalData = "≥ 0.30"
2424
GeoMakie = "0.6, 0.7"
2525
Interpolations = "0.13.2, 0.14, 0.15, 0.16"
26-
NCDatasets = "0.11, 0.12"
26+
NCDatasets = "0.14"
2727
SignalDecomposition = "1.1"
2828
StaticArrays = "0.12, 1.0"
2929
Statistics = "1"

src/core/aggregation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export otheridxs
120120

121121
"""
122122
otheridxs(A::ClimArray, Dim)
123+
123124
Return an iterator of indices, that when used can access all indices of `A` *except* those
124125
belonging to dimension(s) `Dim`.
125126

src/core/coredefs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Basic imports and dimension definitions
33
##########################################################################################
44
using DimensionalData
5-
using DimensionalData.Dimensions, DimensionalData.LookupArrays
5+
using DimensionalData.Dimensions, DimensionalData.Lookups
66
using DimensionalData: basetypeof, broadcast_dims
77
using DimensionalData.Dimensions: setdims
88
using Dates
@@ -26,7 +26,7 @@ of the given object. Convenience function for quickly getting the numeric data o
2626
dimensional arrays or dimensions.
2727
"""
2828
gnv(x) = x
29-
gnv(x::Union{AbDimArray, LookupArray}) = parent(x)
29+
gnv(x::Union{AbDimArray, Lookup}) = parent(x)
3030
gnv(x::Dimension) = parent(parent(x))
3131

3232
export At, (..), Between, Near # Selectors from DimensionalArrays.jl

src/io/netcdf_read.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ end
101101

102102
function autodetect_grid(ds)
103103
if haskey(ds, "reduced_points") || haskey(ds, "clon") ||
104-
any(x -> x ds.dim, POSSIBLE_CELL_NAMES)
104+
any(x -> x keys(ds.dim), POSSIBLE_CELL_NAMES)
105105
# Common cases of coordinate spaces in NetCDF
106106
return CoordinateSpace()
107107
elseif haskey(ds, "lat") && length(size(ds["lat"])) > 1
@@ -157,7 +157,7 @@ function create_dims(ds::NCDatasets.AbstractDataset, dnames, sel = selecteveryth
157157
end
158158
optimal_values = vector2range.(dim_values)
159159
attribs = [
160-
(haskey(ds, d) && ds[d].attrib isa NCDatasets.BaseAttributes) ?
160+
(haskey(ds, d) && ds[d].attrib isa NCDatasets.CommonDataModel.Attributes) ?
161161
Dict(ds[d].attrib) :
162162
Dict()
163163
for d in dnames

src/io/vector2range.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ function vector2range(x::AbstractVector{<:Real})
1111
return x[1]:dx:x[end]
1212
end
1313

14-
function vector2range(t::AbstractVector{<:Z}) where {Z<:Dates.AbstractTime}
14+
function vector2range(t::AbstractVector{<:Dates.AbstractTime})
1515
tsamp = temporal_sampling(t)
1616
period = tsamp2period(tsamp)
1717
isnothing(period) && return t
18-
special_format = Z <: NCDatasets.CFTime.AbstractCFDateTime
18+
special_format = eltype(t) <: NCDatasets.CFTime.AbstractCFDateTime
1919
use_base_date = (tsamp == :hourly || special_format)
2020
ti = use_base_date ? t[1] : Date(t[1])
2121
tf = use_base_date ? t[end] : Date(t[end])

src/physical_dimensions/spatial_equalarea.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ end
204204

205205
# This modifies what happens on A[Coord(Lat(x..y))]
206206
function DimensionalData.selectindices(c::Coord,
207-
sel::Tuple{<:Lat{ <: DimensionalData.LookupArrays.IntervalSets.AbstractInterval}})
207+
sel::Tuple{<:Lat{ <: DimensionalData.Lookups.IntervalSets.AbstractInterval}})
208208
l1 = sel[1].val.left; l2 = sel[1].val.right
209209
return coord_latitudes_between(gnv(c), l1, l2) # this is Vector{Int}
210210
end

test/io_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ end
103103
ncwrite("cftime_test.nc", X)
104104
@test isfile("cftime_test.nc")
105105
X2 = ncread("cftime_test.nc", "x")
106-
@test eltype(dims(X2, Tim)) == DateTime360Day
106+
@test eltype(dims(X2, Tim)) <: DateTime360Day
107107
@test gnv(dims(X2, Tim)) == cfdates
108108
end
109109

0 commit comments

Comments
 (0)