Skip to content

Commit

Permalink
Doc, CI, coverage (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare authored Mar 26, 2024
1 parent ff6c4cf commit 307bc29
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- '1.10'
- 'nightly'
os:
- ubuntu-latest
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# ConstraintCommons

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaConstraints.github.io/ConstraintCommons.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaConstraints.github.io/ConstraintCommons.jl/dev/)
[![JuliaConstraints](https://img.shields.io/badge/docs-Julia_Constraints-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAEpElEQVRYhcWWXWxUVRSF1z53pk7pFClQhJLSgQGjUUGYWgOkpS2hTcWfWBFNNEZDsAX0QV8EHuikPhihKJlgMaM1Gh6MtVZf+ZFOAgRsq1Ki0URaywwibaWUwkz/7j3LhxaDTWemt1rdyX25Z521vuxzs88F/ueSqW70vOuZJSPygCihNvQPna919v03APUwvJ3etyl8FUDK2NthgQTac9p3YjMsO3aG3XxvnvdNCt8Yt9cAsGbW9VnSd6yvyY6frQ54/B6XSlM9ANxxJDd1VGd2+jsHJ+up7AA4XA5vgnAAcDvcjiV2PG0BaKWHk2momFQzZYCOWEc7gN8SSC6197d3TBsA/NAOc54fACdYpXNkgR9+6OkDAGVhuP65zK6qHuew1wIwAmDEObzUyuyu6smKfPo8QFsfti2A4u2RZwGmzIwVlGZd+rDH3VWe4e4qz8i69EFParSgFGDKqGaaAEi9U4kELEoVRPaer6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Odup5B5Tqa6Fc/hTbjB35N/0n3L9CX2f79jwHLzSAAAAAElFTkSuQmCC)](https://JuliaConstraints.github.io/dev/)
[![ConstraintCommons](https://img.shields.io/badge/docs-ConstraintCommons.jl-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAEpElEQVRYhcWWXWxUVRSF1z53pk7pFClQhJLSgQGjUUGYWgOkpS2hTcWfWBFNNEZDsAX0QV8EHuikPhihKJlgMaM1Gh6MtVZf+ZFOAgRsq1Ki0URaywwibaWUwkz/7j3LhxaDTWemt1rdyX25Z521vuxzs88F/ueSqW70vOuZJSPygCihNvQPna919v03APUwvJ3etyl8FUDK2NthgQTac9p3YjMsO3aG3XxvnvdNCt8Yt9cAsGbW9VnSd6yvyY6frQ54/B6XSlM9ANxxJDd1VGd2+jsHJ+up7AA4XA5vgnAAcDvcjiV2PG0BaKWHk2momFQzZYCOWEc7gN8SSC6197d3TBsA/NAOc54fACdYpXNkgR9+6OkDAGVhuP65zK6qHuew1wIwAmDEObzUyuyu6smKfPo8QFsfti2A4u2RZwGmzIwVlGZd+rDH3VWe4e4qz8i69EFParSgFGDKqGaaAEi9U4kELEoVRPaer6mJnq+piUJkr6JUKZEAqXdOGwAoJqmDhHj6ze6Dt173m90HCfGQDIJi2rGc1HkVvvirCyl4Rgz1FhX33DFoNB6py+69XVO6JTJ7yIVysXQ1td6FYXwW+nhx0oE0qQ5IqgoqQ6oBpMPJhvHhAHCkLrsXTrMBgnRRUi2pKjgZ76QA67eF8wGsFi1lIAfNIRW3a+aQEpCDilIGYPXY3n8GoKF3G8A+baACwOFTh3KuxdOOrR3WBioMYJ+G3p3M35FMACLFEtSAco0uvSKp3MVqGVJtFvRLIFqS6eN2wO+nKn4lUiaQLFLtJ611oQOLk/50hA4s7iOtdaSxHwpZxdsiZX4/4+bEPc+i7eFqkFsAZJgWvSeDnt+Thd9e+S93LnAY6BBRvQTqmmoX7ZlINyFZQUVkGcitClYZRa4aDiPNTjgAGA4jjaL+EJplILcWVESWJQUgIG3Ll6cZytoFIEBRJUKeCdVmX7ALEKrNviDkGYoqARAwlLWr/ukf3Rx3VwgAnMvLu9uyrHcArAPgjjnTB85mbnAcXbC513IaD594b8lFuwAAULyjI0eZ6ps1sdjs5bFB00WmArhJQQhQrz/2xcpfpNXnWyTAtwDmjje44Zx5vPBs04aphN+q+k3fHZ+huX6CpR7TsnzS6vMdEqAynkHz3PUvfL5kx+hIFbmu52WfCPnFLKq8uFYEWQBA4nLT+zmnC/10qO5IMcg7AaDkRjT1/tjAJwn4ah0AEk6rq675QZBfUjAISD6uhM8VVoavQLiJwNFRMJQUVoYb1JXwfIo8CPCkEK7rSj2ZsD2CfAcAZyKNQQta2CxQMRCrRLhUgDkUMUGeHutMsQLvI5ghkCghZ7XoGQpICECNFKWAtoSQ2qqDGF4IVgFsdNIsHXCpjaAOgFwx+ujAgEttdNIsJdgIwSqI4YXGR4kbgDZpyc3NU+SpOJ34vj89Pa8oFLJ1x9+qpsImR3T2zFYAE43wEQ21Vj3U2toM8ikAf5t0AhwTrR+dajgAFIWKTMuUR0B8PW7pshDljzeubPlrKLT6fE4h79VK3UWRn/NaWiJTDZ6ovnqiOdup5B5Tqa6Fc/hTbjB35N/0n3L9CX2f79jwHLzSAAAAAElFTkSuQmCC)](https://juliaconstraints.github.io/dev/constraints/constraint_commons)
[![Build Status](https://github.com/JuliaConstraints/ConstraintCommons.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaConstraints/ConstraintCommons.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/JuliaConstraints/ConstraintCommons.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaConstraints/ConstraintCommons.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
<!-- [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/C/ConstraintCommons.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/report.html)
[![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/C/ConstraintCommons.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/report.html) -->

ConstraintCommons.jl is an essential package within the Julia Constraints ecosystem designed to facilitate the development and interoperability of constraint programming solutions in Julia. It serves as a foundational layer that provides shared structures, abstract types, functions, and generic methods utilized by both basic feature packages and learning-oriented packages.
8 changes: 6 additions & 2 deletions src/automata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ end
(:e, 0) => :e,
)
start = :a
finish = :e
a = Automaton(states, start, finish)
finish_a = :e
finish_b = [:d, :e]
a = Automaton(states, start, finish_a)
b = Automaton(states, start, finish_b)

@test accept(a, [0,0,1,1,0,0,1,0,0])
@test !accept(a, [1,1,1,0,1])
@test accept(b, [0,0,1,1,0,0,1,0,0])
@test !accept(b, [1,1,1,0,1])
end
23 changes: 13 additions & 10 deletions src/diagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ function accept(a::MDD, w)
return true
end

"""
Automaton(a::MDD)
# """
# Automaton(a::MDD)

Construct an automaton based on a given Multivalued Decision Diagrams (MDD).
"""
function Automaton(a::MDD)
start = first(a.states)
finish = last(a.states)
states = collect(Iterators.flatten(a.states))
return Automaton(states, start, finish)
end
# Construct an automaton based on a given Multivalued Decision Diagrams (MDD).
# """
# function Automaton(a::MDD)
# start = first(a.states)
# finish = last(a.states)
# states = Dict(Iterators.flatten(a.states))
# @info "debug" states start finish
# return Automaton(states, start, finish)
# end

# SECTION - Test Items for Automata
@testitem "MDD" tags = [:automata, :mdd] begin
Expand All @@ -57,6 +58,8 @@ end
]
a = MDD(states)

# b = Automaton(a)

@test accept(a, [0,2,0])
@test accept(a, [1,2,0])
@test accept(a, [2,0,0])
Expand Down
1 change: 1 addition & 0 deletions src/extrema.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ end
# SECTION - Test Items for δ_extrema
@testitem "δ_extrema" tags = [:δ_extrema] begin
X = map(_ -> rand(1:100,100), 1:3)

@test 0 δ_extrema(X[1]) 100
@test 0 δ_extrema(X[1:2]...) 100
@test 0 δ_extrema(X...) 100
Expand Down

0 comments on commit 307bc29

Please sign in to comment.