Skip to content

Commit

Permalink
Update 1/? for CBLS.jl (#113)
Browse files Browse the repository at this point in the history
* Temp save

* Tag new version. Update CI
  • Loading branch information
Azzaare authored Jan 19, 2023
1 parent 27a7c8a commit 9d8b01d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
name: CI
on:
- push
- pull_request
push:
branches:
- main
tags: '*'
pull_request:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LocalSearchSolvers"
uuid = "2b10edaa-728d-4283-ac71-07e312d6ccf3"
authors = ["Jean-Francois Baffier"]
version = "0.4.0"
version = "0.4.1"

[deps]
CompositionalNetworks = "4b67e4b5-442d-4ef5-b760-3f5df3a57537"
Expand Down
3 changes: 0 additions & 3 deletions src/LocalSearchSolvers.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module LocalSearchSolvers

using Dictionaries: include
using CompositionalNetworks: include
using Constraints: include
using Base.Threads
using CompositionalNetworks
using ConstraintDomains
Expand Down
11 changes: 10 additions & 1 deletion src/constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,13 @@ Base.in(var::Int, c::Constraint) = var ∈ c.vars
DOCSTRING
"""
constraint(f, vars) = Constraint(f, collect(Int == Int32 ? map(Int,vars) : vars))
function constraint(f, vars)
b1 = hasmethod(f, NTuple{1, Any}, (:X,))
b2 = hasmethod(f, NTuple{1, Any}, (:do_not_use_this_kwarg_name,))

g = f
if !b1 || b2
g = (x; X=nothing) -> f(x)
end
return Constraint(g, collect(Int == Int32 ? map(Int,vars) : vars))
end

0 comments on commit 9d8b01d

Please sign in to comment.