- Notifications
You must be signed in to change notification settings - Fork37
VNT Part 3: VarNamedTuple with concretized slices#1181
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:mhauru/arraylikeblock
Are you sure you want to change the base?
Conversation
github-actionsbot commentedDec 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Benchmark Report
Computer InformationBenchmark Results |
codecovbot commentedDec 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## mhauru/arraylikeblock #1181 +/- ##=========================================================- Coverage 80.13% 76.95% -3.18%========================================================= Files 42 42 Lines 4298 4343 +45 =========================================================- Hits 3444 3342 -102- Misses 854 1001 +147 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DynamicPPL.jl documentation for PR#1181 is available at: |
This PR primarily adds support for concretized slices to VarNamedTuple. That is actually all that is needed to make it support (Ithink) all the same
:syntax we previously supported in@model. Turns out we were already concretising allVarNames in the model body itself, so there was little to do.The PR also addresses some related issues, adds a test for
:s (we previously had zero models in our test suite that used:in an assume statement), and starts a HISTORY.md entry.If we are happy with all the new limitations on square bracket indexing, we could say that this makes VNT-for-LDF feature complete. However, adding support for dictionaries shouldn't be too hard, and maybe linear indexing wouldn't be awful either, so I would give those a day's worth of work before deciding that we just flat out ban them. Would be a shame to have a few DPPL versions for which they don't work, just to then add support in a few week's time.
To add support for the aforementioned cases (see also the HISTORY.md entry), my idea is that you would somehow provide VNT with information about which type of object this
VarNamethat has anIndexLensis indexing, and you could then do different things withmake_leafandPartialArraydepending on the type. That would solve theDictand linear indexing cases. Unusually indexed arrays would be harder, I don't know how to make e.g.OffsetArrays work without manually writing a version ofPartialArraythat explicitly uses them. Maybe there could be some way to do this generically for anyAbstractArraysubtype, but I worry that the interface forAbstractArraymay not be well-defined enough for that.