Skip to content

Commit

Permalink
Merge pull request #127 from Herb-AI/compathelper/new_version/2024-11…
Browse files Browse the repository at this point in the history
…-16-01-46-08-093-02170095097

CompatHelper: bump compat for HerbSpecification to 0.2, (keep existing compat)
  • Loading branch information
THinnerichs authored Dec 12, 2024
2 parents 9ff0f71 + 058ac94 commit 13e24a7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HerbConstraints = "^0.2.0"
HerbCore = "^0.3.0"
HerbGrammar = "^0.4.0"
HerbInterpret = "^0.1.3"
HerbSpecification = "^0.1.0"
HerbSpecification = "0.2"
MLStyle = "^0.4.17"
Random = "1.8.0,1.9.0,1.10.0,1.11.0"
StatsBase = "^0.34"
Expand Down
8 changes: 7 additions & 1 deletion src/evaluate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ Optional parameters:
Returns a score in the interval [0, 1]
"""
function evaluate(problem::Problem{Vector{IOExample}}, expr::Any, symboltable::SymbolTable; shortcircuit::Bool=true, allow_evaluation_errors::Bool=false)::Number
function evaluate(
problem::Problem{<:AbstractVector{<:IOExample}},
expr::Any,
symboltable::SymbolTable;
shortcircuit::Bool=true,
allow_evaluation_errors::Bool=false
)::Number
number_of_satisfied_examples = 0

crashed = false
Expand Down
2 changes: 1 addition & 1 deletion src/stochastic_iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ end
Returns the cost of the `program` using the examples and the `cost_function`. It first convert the program to an expression and evaluates it on all the examples.
"""
function _calculate_cost(program::Union{RuleNode, StateHole}, cost_function::Function, spec::AbstractVector{IOExample}, grammar::AbstractGrammar, evaluation_function::Function)
function _calculate_cost(program::Union{RuleNode, StateHole}, cost_function::Function, spec::AbstractVector{<:IOExample}, grammar::AbstractGrammar, evaluation_function::Function)
results = Tuple{<:Number,<:Number}[]

expression = rulenode2expr(program, grammar)
Expand Down
4 changes: 2 additions & 2 deletions test/test_search_procedure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Index = List[Number]
end

problem = Problem([IOExample(Dict(), x) for x 1:5])
problem = Problem([IOExample(Dict{Symbol,Any}(), x) for x 1:5])
iterator = BFSIterator(g₂, :Index, max_depth=2)
solution, flag = synth(problem, iterator, allow_evaluation_errors=true)

Expand Down Expand Up @@ -70,7 +70,7 @@
Index = List[Number]
end

problem = Problem([IOExample(Dict(), x) for x 1:5])
problem = Problem([IOExample(Dict{Symbol,Any}(), x) for x 1:5])
iterator = BFSIterator(g₃, :Index, max_depth=2)
solution, flag = synth(problem, iterator, allow_evaluation_errors=true)

Expand Down

2 comments on commit 13e24a7

@ReubenJ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/121260

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 13e24a76836c2b7edf5c4fe180666644a847e6f6
git push origin v0.4.0

Please sign in to comment.