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

Implement splatting variables #255

Merged
merged 5 commits into from
Oct 8, 2024

Conversation

wouterwln
Copy link
Member

The implementation is slightly ugly since I'm creating a vector of ProxyLabels which I am splatting again, but I think this is the issue with splatting altogether. At least this implementation works and is supposed to fix the issue at hand. Also @bvdmitri do you have an alternative for my implementation of Base.iterate for VariableRefs? I couldn't get it to work without duplicating all code unfortunately.

@wouterwln wouterwln linked an issue Oct 7, 2024 that may be closed by this pull request
Copy link
Member

@bvdmitri bvdmitri left a comment

Choose a reason for hiding this comment

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

It looks fine, I thought of a different implementation to be honest, but this seems to work as well, so it shouldn't be a big problem I guess. I also added a couple of extra tests, please double check if those make sense.

P.S. Regarding the implementation I had in mind is to have Splat as an index in the proxylabel, not as a wrapper for proxied. Later on we could dispatch on the type of the index when creating the node, but your implementation seems to work fine too.

@bvdmitri
Copy link
Member

bvdmitri commented Oct 8, 2024

(I guess docs build may fail because the new struct is not present in the documentation as a GraphPPL.Splat)

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.

Project coverage is 90.61%. Comparing base (4807717) to head (4fcf2c8).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/graph_engine.jl 57.89% 8 Missing ⚠️
src/model_macro.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #255      +/-   ##
==========================================
- Coverage   90.86%   90.61%   -0.25%     
==========================================
  Files          15       15              
  Lines        2090     2121      +31     
==========================================
+ Hits         1899     1922      +23     
- Misses        191      199       +8     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@bvdmitri
Copy link
Member

bvdmitri commented Oct 8, 2024

@wouterwln the iterate function is not actually being used (as coverage suggests), maybe we remove it?

@wouterwln wouterwln merged commit c7dca52 into main Oct 8, 2024
6 of 8 checks passed
@wouterwln wouterwln deleted the 240-error-when-running-infer-due-to-splatting branch October 8, 2024 11:44
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.

Error when running infer due to splatting
2 participants