Skip to content

Commit

Permalink
minor changes at GraphPolytope interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartorell committed May 15, 2024
1 parent 688b936 commit e0c627a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/ReferenceFEs/GraphPolytopes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ function GraphPolytope{D}(
GraphPolytope{D}(vertices,graph,isopen,data)
end

function get_polytope_data(p::Polytope;metadata=nothing)
get_polytope_data(p,metadata)
function generate_polytope_data(p::Polytope;metadata=nothing)
generate_polytope_data(p,metadata)
end

function get_polytope_data(p::Polytope,::Nothing)
function generate_polytope_data(p::Polytope,::Nothing)
nothing
end

Expand All @@ -134,7 +134,7 @@ function Polygon(p::Polytope{2},vertices::AbstractVector{<:Point};kwargs...)
e_v_graph = map(Reindex(e_v_graph),perm)
e_v_graph = map(i->replace(i, Dict(perm .=> 1:length(perm))...),e_v_graph)
e_v_graph = map(i->Int32.(i),e_v_graph)
data = get_polytope_data(p;kwargs...)
data = generate_polytope_data(p;kwargs...)
Polygon(vertices,e_v_graph,data)
end

Expand Down Expand Up @@ -164,7 +164,7 @@ function Polyhedron(p::Polytope{3},vertices::AbstractVector{<:Point};kwargs...)
@unreachable

Check warning on line 164 in src/ReferenceFEs/GraphPolytopes.jl

View check run for this annotation

Codecov / codecov/patch

src/ReferenceFEs/GraphPolytopes.jl#L164

Added line #L164 was not covered by tests
end
e_v_graph = map(i->Int32.(i),e_v_graph)
data = get_polytope_data(p;kwargs...)
data = generate_polytope_data(p;kwargs...)
Polyhedron(vertices,e_v_graph,data)
end

Expand Down Expand Up @@ -201,11 +201,11 @@ Base.getindex(a::GraphPolytope,i::Integer) = a.vertices[i]


"""
get_data(p::GraphPolytope)
get_metadata(p::GraphPolytope)
It return the metadata stored in the polytope `p`.
"""
get_data(a::GraphPolytope) = a.metadata
get_metadata(a::GraphPolytope) = a.metadata

Check warning on line 208 in src/ReferenceFEs/GraphPolytopes.jl

View check run for this annotation

Codecov / codecov/patch

src/ReferenceFEs/GraphPolytopes.jl#L208

Added line #L208 was not covered by tests


"""
Expand Down Expand Up @@ -551,7 +551,7 @@ function Base.copy(poly::Polyhedron)
vertices = get_vertex_coordinates(poly)
graph = get_graph(poly)
open = isopen(poly)
data = get_data(poly)
data = get_metadata(poly)
data = !isnothing(data) ? copy(data) : nothing
Polyhedron(vertices,graph,open,data)

Check warning on line 556 in src/ReferenceFEs/GraphPolytopes.jl

View check run for this annotation

Codecov / codecov/patch

src/ReferenceFEs/GraphPolytopes.jl#L550-L556

Added lines #L550 - L556 were not covered by tests
end
Expand Down

0 comments on commit e0c627a

Please sign in to comment.