Skip to content

Commit

Permalink
Fix zonalmean(::EqArea) not preserving name/attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Feb 18, 2021
1 parent 1d33399 commit e2488e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimateBase"
uuid = "35604d93-0fb8-4872-9436-495b01d137e2"
authors = ["Datseris <[email protected]>", "Philippe Roy <[email protected]>"]
version = "0.10.3"
version = "0.10.4"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 2 additions & 2 deletions src/physical_dimensions/spatial_equalarea.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function zonalmean(::EqArea, A::AbDimArray)
idxs, lats = uniquelats(A)
other = otherdims(A, Coord())
r = zeros(eltype(A), (length(lats), size.(Ref(A), other)...))
R = ClimArray(r, (Lat(lats), other...), A.name)
R = ClimArray(r, (Lat(lats), other...); name=A.name, attrib=A.attrib)
for (i, r) in enumerate(idxs)
for j in otheridxs(A, Coord())
R[Lat(i), j...] = mean(view(A, Coord(r), j...))
Expand All @@ -85,7 +85,7 @@ function zonalmean(::EqArea, A::AbDimArray{T, 1}) where {T}
for (i, r) in enumerate(idxs)
res[i] = mean(view(A.data, r))
end
return ClimArray(res, (Lat(lats),))
return ClimArray(res, (Lat(lats),); name=A.name, attrib=A.attrib)
end


Expand Down

0 comments on commit e2488e1

Please sign in to comment.