Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address Aqua type piracy errors #31

Merged
merged 7 commits into from
Nov 27, 2024
Merged

Address Aqua type piracy errors #31

merged 7 commits into from
Nov 27, 2024

Conversation

ReubenJ
Copy link
Member

@ReubenJ ReubenJ commented Nov 15, 2024

The following methods from HerbGrammar were picked up by Aqua as pirated. They should be defined here because their input arguments are all types defined here in HerbCore.

The interface to AbstractTrees.jl

# Interface to AbstractTrees.jl
AbstractTrees.children(node::AbstractRuleNode) = get_children(node)
AbstractTrees.nodevalue(node::AbstractRuleNode) = get_rule(node)

These RuleNode/Hole Constructors

function RuleNode(ind::Int, grammar::AbstractGrammar)

function RuleNode(ind::Int, _val::Any, grammar::AbstractGrammar)

function UniformHole(domain::BitVector, grammar::AbstractGrammar)

Base.show and Base.getindex definitions for AbstractGrammars

function Base.show(io::IO, grammar::AbstractGrammar)
for i in eachindex(grammar.rules)
println(io, i, ": ", grammar.types[i], " = ", grammar.rules[i])
end
end
Base.getindex(grammar::AbstractGrammar, typ::Symbol) = grammar.bytype[typ]

Addresses Herb-AI/HerbGrammar.jl#96 and Herb-AI/HerbGrammar.jl#97.

@ReubenJ ReubenJ added bug Something isn't working enhancement New feature or request labels Nov 15, 2024
@ReubenJ ReubenJ self-assigned this Nov 15, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.54%. Comparing base (2d5dcc6) to head (e3189be).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #31      +/-   ##
==========================================
+ Coverage   72.52%   73.54%   +1.01%     
==========================================
  Files           1        2       +1     
  Lines         182      189       +7     
==========================================
+ Hits          132      139       +7     
  Misses         50       50              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ReubenJ ReubenJ marked this pull request as draft November 15, 2024 16:38
@ReubenJ ReubenJ marked this pull request as ready for review November 15, 2024 16:41
@ReubenJ ReubenJ changed the title Add pirated methods from HerbGrammar Address Aqua type piracy errors Nov 25, 2024
@ReubenJ ReubenJ requested review from THinnerichs and pwochner and removed request for THinnerichs November 25, 2024 11:53
They are better-suited as functions in `HerbGrammar`
Copy link
Contributor

@pwochner pwochner left a comment

Choose a reason for hiding this comment

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

No complaints.

@ReubenJ ReubenJ merged commit 52359a7 into master Nov 27, 2024
5 checks passed
@ReubenJ ReubenJ deleted the feat/anti-piracy branch November 27, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants