Skip to content

Commit

Permalink
Fix compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Oct 8, 2024
1 parent 0fea2ae commit 68d6caf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
fail-fast: false
matrix:
version:
- "1.9"
- "1" # automatically expands to the latest stable 1.x release of Julia
- "pre"
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ OrderedCollections = "1"
Random = "1"
TestItems = "0.1, 1"
Unrolled = "0.1"
julia = "1.9"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
16 changes: 8 additions & 8 deletions src/layers/comparison.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end
Compute an euclidean norm with domain size `dom_size` of a scalar.
"""
function co_euclidean(x; dom_size, params...)
return co_euclidean_val(x; val=0.0, dom_size)
return co_euclidean_val(x; val = 0.0, dom_size)
end

"""
Expand All @@ -48,13 +48,13 @@ co_abs_diff_var_vars(x; nvars, params...) = abs(x - nvars)
co_var_minus_vars(x; nvars)
Return the difference `x - nvars` if positive, `0.0` otherwise, where `nvars` denotes the numbers of variables.
"""
co_var_minus_vars(x; nvars, params...) = co_var_minus_val(x; val=nvars)
co_var_minus_vars(x; nvars, params...) = co_var_minus_val(x; val = nvars)

"""
co_vars_minus_var(x; nvars)
Return the difference `nvars - x` if positive, `0.0` otherwise, where `nvars` denotes the numbers of variables.
"""
co_vars_minus_var(x; nvars, params...) = co_val_minus_var(x; val=nvars)
co_vars_minus_var(x; nvars, params...) = co_val_minus_var(x; val = nvars)


# Parametric layers
Expand Down Expand Up @@ -89,7 +89,7 @@ end
comparison_layer(param = false)
Generate the layer of transformations functions of the ICN. Iff `param` value is set, also includes all the parametric comparison with that value. The operations are mutually exclusive, that is only one will be selected.
"""
function comparison_layer(parameters=Vector{Symbol}())
function comparison_layer(parameters = Vector{Symbol}())
comparisons = make_comparisons(:none)

for p in parameters
Expand Down Expand Up @@ -123,7 +123,7 @@ end

for (f, results) in funcs_param
for (key, vals) in enumerate(data)
@test f(vals.first; val=vals.second[1]) == results[key]
@test f(vals.first; val = vals.second[1]) == results[key]
end
end

Expand All @@ -135,15 +135,15 @@ end

for (f, results) in funcs_vars
for (key, vals) in enumerate(data)
@test f(vals.first, nvars=vals.second[2]) == results[key]
@test f(vals.first, nvars = vals.second[2]) == results[key]
end
end

funcs_val_dom = [CN.co_euclidean_val => [1.4, 2.0]]

for (f, results) in funcs_val_dom
for (key, vals) in enumerate(data)
@test f(vals.first, val=vals.second[1], dom_size=vals.second[2])
@test f(vals.first, val = vals.second[1], dom_size = vals.second[2])
results[key]
end
end
Expand All @@ -152,7 +152,7 @@ end

for (f, results) in funcs_dom
for (key, vals) in enumerate(data)
@test f(vals.first, dom_size=vals.second[2]) results[key]
@test f(vals.first, dom_size = vals.second[2]) results[key]
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end
as_bitvector(n::Int, max_n::Int = n)
Convert an Int to a BitVector of minimal size (relatively to `max_n`).
"""
function as_bitvector(n::Int, max_n::Int=n)
function as_bitvector(n::Int, max_n::Int = n)
nm1 = n - 1
v = falses(ceil(Int, log2(max_n)))
i = 0
Expand Down Expand Up @@ -86,7 +86,7 @@ end
reduce_symbols(symbols, sep)
Produce a formatted string that separates the symbols by `sep`. Used internally for `show_composition`.
"""
function reduce_symbols(symbols, sep, parenthesis=true; prefix="")
function reduce_symbols(symbols, sep, parenthesis = true; prefix = "")
str = reduce((x, y) -> "$y$sep$x", map(s -> "$prefix$s", symbols))
return parenthesis ? "[$str]" : str
end
Expand Down

0 comments on commit 68d6caf

Please sign in to comment.