Skip to content

Commit

Permalink
Merge branch 'dev' into dev-autologiset
Browse files Browse the repository at this point in the history
  • Loading branch information
giopaglia committed Jan 4, 2025
2 parents b8fe552 + 579104e commit d006894
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
13 changes: 11 additions & 2 deletions src/dimensional-structures/logiset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ end
function allfeatvalues(
X::UniformFullDimensionalLogiset,
)
unique(X.featstruct)
error("TODO only look at upper half")
vec(X.featstruct)
end

function allfeatvalues(
Expand All @@ -461,12 +462,20 @@ end
function allfeatvalues(
X::UniformFullDimensionalLogiset,
i_instance,
f,
f::AbstractFeature,
)
return error("Please, provide method allfeatvalues(::" *
"$(typeof(X)), i_instance::$(typeof(i_instance)), f::$(typeof(f))).")
end

function allfeatvalues(
X::UniformFullDimensionalLogiset,
f::AbstractFeature,
)
return error("Please, provide method allfeatvalues(::" *
"$(typeof(X)), f::$(typeof(f))).")
end

############################################################################################

function instances(
Expand Down
2 changes: 1 addition & 1 deletion src/scalar/conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ function _multivariate_scalar_alphabet(
domains::AbstractVector{<:AbstractVector};
sorted = true,
truerfirst = true,
# skipextremes::Bool = true,
# skipextremes::Bool = true, # TODO
discretizedomain::Bool = false, # TODO default behavior should depend on test_operator
y::Union{Nothing,AbstractVector} = nothing,
)::MultivariateScalarAlphabet
Expand Down
3 changes: 2 additions & 1 deletion src/scalar/propositional-logiset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ function alphabet(
force_i_variables::Bool = false,
test_operators::Union{Nothing,AbstractVector{<:TestOperator},Base.Callable} = nothing,
discretizedomain::Bool = false,
unique::Bool = false,
kwargs...
)::MultivariateScalarAlphabet
feats = collect(features(X; force_i_variables = force_i_variables))
Expand All @@ -221,7 +222,7 @@ function alphabet(

domains = [begin
domain = Tables.getcolumn(gettable(X), i_variable(feat))
if !discretizedomain
if unique && !discretizedomain
domain = unique(domain)
end
domain
Expand Down
2 changes: 1 addition & 1 deletion test/scalar-alphabet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ a = ExplicitAlphabet(collect(atoms(myalphabet_symbol)))
@test_nowarn SoleData.scalaralphabet(a)

a = ExplicitAlphabet(collect(atoms(alphabet(X, test_operators = [<, ]))))
@test (@test_logs (:warn,) SoleData.scalaralphabet(a; discretizedomain = true))
@test_logs (:warn,) SoleData.scalaralphabet(a; discretizedomain = true)
# @test_throws ErrorException SoleData.scalaralphabet(a; discretizedomain = true)
# @test_nowarn SoleData.scalaralphabet(a; discretizedomain = true, y = y)

0 comments on commit d006894

Please sign in to comment.