From bbe0c6a386944e41c109f5bf297a16584ae1625d Mon Sep 17 00:00:00 2001 From: giopaglia <24519853+giopaglia@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:47:45 +0100 Subject: [PATCH] Fix FullDimensionalFrame --- .../algebras/frames/full-dimensional-frame/main.jl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/algebras/frames/full-dimensional-frame/main.jl b/src/utils/algebras/frames/full-dimensional-frame/main.jl index b151a87..c5098d3 100644 --- a/src/utils/algebras/frames/full-dimensional-frame/main.jl +++ b/src/utils/algebras/frames/full-dimensional-frame/main.jl @@ -66,10 +66,18 @@ struct FullDimensionalFrame{N,W<:AbstractWorld} <: AbstractDimensionalFrame{N,W} W = OneWorld FullDimensionalFrame{0,W}(channelsize) end - function FullDimensionalFrame(channelsize::Tuple{Int}, W::Type{<:AbstractWorld} = Interval{Int}) + function FullDimensionalFrame(channelsize::Tuple{Int}, W::Union{Nothing,Type{<:AbstractWorld}} = nothing) + if isnothing(W) + @warn "Unknown world type. Defaulting to Interval{Int}." + W = Interval{Int} + end FullDimensionalFrame{1,W}(channelsize) end - function FullDimensionalFrame(channelsize::Tuple{Int,Int}, W::Type{<:AbstractWorld} = Interval2D{Int}) + function FullDimensionalFrame(channelsize::Tuple{Int,Int}, W::Union{Nothing,Type{<:AbstractWorld}} = nothing) + if isnothing(W) + @warn "Unknown world type. Defaulting to Interval2D{Int}." + W = Interval2D{Int} + end FullDimensionalFrame{2,W}(channelsize) end function FullDimensionalFrame(channelsize::Vararg{Int,N}) where {N}