Skip to content

Commit 196c162

Browse files
committed
Use meta_table instead of collect_metat
1 parent e6cd046 commit 196c162

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/GeometryBasics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module GeometryBasics
3535
export GLTriangleFace, GLNormalMesh3D, GLPlainTriangleMesh, GLUVMesh3D, GLUVNormalMesh3D
3636
export AbstractMesh, Mesh, TriangleMesh
3737
export GLNormalMesh2D, PlainTriangleMesh
38-
export MetaT, collect_MetaT
38+
export MetaT, meta_table
3939

4040
# all the different predefined mesh types
4141
# Note: meshes can contain arbitrary meta information,

src/metadata.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,14 @@ function StructArrays.createinstance(::Type{F}, x, args...) where {F<:MetaT}
272272
end
273273

274274
"""
275-
Accepts an iterable of MetaTs and put it into a StructArray
275+
Puts an iterable of MetaT's into a StructArray
276276
"""
277-
function collect_MetaT(iter)
277+
function meta_table(iter)
278278
cols = Tables.columntable(iter)
279-
collect_MetaT(first(cols), Base.tail(cols))
279+
meta_table(first(cols), Base.tail(cols))
280280
end
281281

282-
function collect_MetaT(main, meta::NamedTuple{names, types}) where {names, types}
282+
function meta_table(main, meta::NamedTuple{names, types}) where {names, types}
283283
F = MetaT{eltype(main), names, StructArrays.eltypes(types)}
284284
return StructArray{F}(; main=main, meta...)
285285
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ end
613613
push!(prop, (country_states = 12, rainfall = 1000)) # a pinch of heterogeneity
614614

615615
feat = [MetaT(i, j) for (i,j) = zip(geom, prop)]
616-
sa = collect_MetaT(feat)
616+
sa = meta_table(feat)
617617

618618
@test nameof(eltype(feat)) == :MetaT
619619
@test eltype(sa) === MetaT{Any,(:country_states, :rainfall),Tuple{Any,Float64}}

0 commit comments

Comments
 (0)