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

Add typechecking for insert! #67

Closed
wants to merge 2 commits into from
Closed

Conversation

nicolaefilat
Copy link
Contributor

@nicolaefilat nicolaefilat commented Apr 22, 2024

This pull request add typechecking when calling insert.
If trying to insert a subtree in a place where the wrong type is expected an error in thrown.

For this check the grammar is also needed as an extra argument. This, however, breaks HerbSearch for now.
I will create a PR for HerbSearch soon.

This should close #66.

Add grammar to arguments to enable the check to be made.
@nicolaefilat nicolaefilat changed the base branch from master to dev April 22, 2024 14:02
@ReubenJ
Copy link
Member

ReubenJ commented Apr 25, 2024

This breaks tests in HerbSearch, by the way. Maybe this is intended, but can you take a look to confirm?

To reproduce errors

using Pkg

Pkg.activate(; temp=true)

packages = [
    PackageSpec(name="HerbConstraints", rev="dev"),
    PackageSpec(name="HerbGrammar", rev="add-typechecking-for-insert!"),
    PackageSpec(name="HerbCore", rev="dev"),
    PackageSpec(name="HerbInterpret", rev="dev"),
    PackageSpec(name="HerbSearch", rev="dev"), 
    PackageSpec(name="HerbSpecification", rev="dev")
]
Pkg.add(packages)

Pkg.test("HerbSearch")  # test only the HerbSearch package instead of all packages

@nicolaefilat
Copy link
Contributor Author

Yes it breaks because it adds an extra field to the cross_over function.
I have a fix ready for HerbSearch too but I did not make a PR for that.

@ReubenJ
Copy link
Member

ReubenJ commented Apr 29, 2024

I have a fix ready for HerbSearch too but I did not make a PR for that.

Would you mind posting a PR for that?

Copy link

codecov bot commented May 3, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 48.93%. Comparing base (aca61f9) to head (3e1a45d).

Files with missing lines Patch % Lines
src/nodelocation.jl 73.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #67      +/-   ##
==========================================
+ Coverage   46.10%   48.93%   +2.83%     
==========================================
  Files           8        8              
  Lines         462      470       +8     
==========================================
+ Hits          213      230      +17     
+ Misses        249      240       -9     

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

@ReubenJ
Copy link
Member

ReubenJ commented May 13, 2024

@nicolaefilat I'm sorry, but I've lost track of whether that PR for HerbSearch has already been posted and/or merged. Can you confirm, and if not, post one when you can?

Edit: looks like it's still causing some tests on HerbSearch to fail.

@ReubenJ ReubenJ deleted the branch dev November 14, 2024 09:01
@ReubenJ ReubenJ closed this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add type check for insert!
2 participants