Skip to content

Conversation

@penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Dec 23, 2025

Closes #49
Closes #136
Closes #148

See the HISTORY.md for details.

I'm aware that this is practically impossible to review, but if you are seeing this, you can take heart from the fact that pretty much all the tests for high-level functions like prefix, unprefix, varname_leaves, hasvalue, getvalue, have not been touched, and continue to pass.

Essentially, once you have constructed a @varname(...) it will pretty much behave the same way it used to.

Of course, this is no longer true if you are digging into getoptic(vn) and things like that. The data structure changes are all inside src/varname/optic.jl and src/varname/varname.jl. However, it's probably more productive to look at the corresponding tests instead to see what the behaviour is like.

It looks complicated, but that's because I have made it very general: more general than old VarName used to be (begin/end no longer need to be concretised so early), and also more general than Accessors.IndexLens is (it accepts keyword arguments). The reason for this is because, if we are undertaking a big refactoring, we may as well do it correctly. Otherwise in the future if we want Turing to work with other array types (looking at DimArray in particular) we will have to come back and fix it again.

TODO

@github-actions
Copy link
Contributor

AbstractPPL.jl documentation for PR #150 is available at:
https://TuringLang.github.io/AbstractPPL.jl/previews/PR150/

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 76.38484% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.96%. Comparing base (0086beb) to head (0317af7).

Files with missing lines Patch % Lines
src/varname/optic.jl 74.25% 52 Missing ⚠️
src/varname/varname.jl 83.09% 12 Missing ⚠️
src/varname/prefix.jl 0.00% 9 Missing ⚠️
src/varname/hasvalue.jl 80.00% 4 Missing ⚠️
src/varname/leaves.jl 75.00% 2 Missing ⚠️
src/varname/subsumes.jl 92.30% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #150       +/-   ##
===========================================
- Coverage   86.40%   69.96%   -16.45%     
===========================================
  Files           9       10        +1     
  Lines         456      546       +90     
===========================================
- Hits          394      382       -12     
- Misses         62      164      +102     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Drop Accessors dependency Fix method ambiguities Use views in concretization

2 participants