Skip to content

Commit

Permalink
New release (#59)
Browse files Browse the repository at this point in the history
* Fixes for tests

* Fix format

* Update Project.toml
  • Loading branch information
Azzaare authored Aug 5, 2024
1 parent 3c14c4e commit 7e8f095
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
9 changes: 4 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
name = "ConstraintDomains"
uuid = "5800fd60-8556-4464-8d61-84ebf7a0bedb"
authors = ["Jean-François Baffier"]
version = "0.3.12"
version = "0.3.13"

[deps]
ConstraintCommons = "e37357d9-0691-492f-a822-e5ea6a920954"
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Intervals = "d8418881-c3e1-53bb-8760-2df7ec849ed5"
PatternFolds = "c18a7f1d-76ad-4ce4-950d-5419b888513b"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"

[compat]
ConstraintCommons = "0.2"
Dictionaries = "0.4"
Intervals = "1"
PatternFolds = "0.2"
StatsBase = "0.34"
TestItemRunner = "0.2, 1"
TestItems = "0.1, 1"
julia = "1.8"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[targets]
test = ["Aqua", "Test", "TestItemRunner"]
test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"]
12 changes: 6 additions & 6 deletions src/ConstraintDomains.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module ConstraintDomains

# SECTION - Imports
using ConstraintCommons
using Dictionaries
using PatternFolds
using StatsBase
using TestItems
import ConstraintCommons: ConstraintCommons, δ_extrema
# import Dictionaries
import PatternFolds: PatternFolds, Interval, Closed
import StatsBase: sample
import TestItems: @testitem

# Exports
export AbstractDomain
export ContinuousDomain
export DiscreteDomain
# export DiscreteSet # not defined
export ExploreSettings
export RangeDomain
export SetDomain

export add!
export delete!
Expand Down
4 changes: 2 additions & 2 deletions src/general.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Extends `Base.convert` for domains.
"""
function Base.convert(::Type{Intervals}, d::RangeDomain{T}) where {T<:Real}
a, b = extrema(get_domain(d))
return domain(Float64(a) .. Float64(b))
return domain(Interval{T,Closed,Closed}(a, b))
end

function Base.convert(::Type{RangeDomain}, d::Intervals{T}) where {T<:Real}
Expand All @@ -23,6 +23,6 @@ function Base.convert(::Type{RangeDomain}, d::Intervals{T}) where {T<:Real}
return domain(a:b)
end

function Base.convert(::Type{RangeDomain}, d::SetDomain{T}) where {T<:Integer}
function Base.convert(::Type{RangeDomain}, d::SetDomain)
return domain(collect(get_domain(d)))
end
9 changes: 1 addition & 8 deletions test/Aqua.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
@testset "Aqua.jl" begin
import Aqua
import ConstraintDomains
import Dictionaries

# TODO: Fix the broken tests and remove the `broken = true` flag
Aqua.test_all(
ConstraintDomains;
Expand All @@ -20,9 +16,6 @@
end

@testset "Dependencies compatibility (no extras)" begin
Aqua.test_deps_compat(
ConstraintDomains;
check_extras = false, # ignore = [:Random]
)
Aqua.test_deps_compat(ConstraintDomains; check_extras = false)
end
end
3 changes: 3 additions & 0 deletions test/ExplicitImports.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@testset "Look for Explicit Imports" begin
@test check_no_implicit_imports(ConstraintDomains) === nothing
end
3 changes: 3 additions & 0 deletions test/JET.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@testset "Code linting (JET.jl)" begin
JET.test_package(ConstraintDomains; target_defined_modules = true)
end
9 changes: 8 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
using ConstraintDomains

using Aqua
using ExplicitImports
using JET
using Test
using TestItemRunner

@testset "Package tests: ConstraintDomains" begin
@testset "Package tests: ConstraintCommons" begin
include("Aqua.jl")
include("ExplicitImports.jl")
include("JET.jl")
include("TestItemRunner.jl")
end

0 comments on commit 7e8f095

Please sign in to comment.