Skip to content

Simplify to_samples: replace OnlyAccsVarInfo block with rand(model)#1315

Closed
anurag-mds wants to merge 1 commit intoTuringLang:breakingfrom
anurag-mds:anurag/simplify-only-accs-varinfo
Closed

Simplify to_samples: replace OnlyAccsVarInfo block with rand(model)#1315
anurag-mds wants to merge 1 commit intoTuringLang:breakingfrom
anurag-mds:anurag/simplify-only-accs-varinfo

Conversation

@anurag-mds
Copy link

Closes #1312

Replaces the manual OnlyAccsVarInfo initialization block in to_samples with a single rand(model) call, which does the same thing, which samples from the model prior to obtain a template VarNamedTuple the same result in one line.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.69%. Comparing base (840c5d7) to head (3452131).

Additional details and impacted files
@@             Coverage Diff              @@
##           breaking    #1315      +/-   ##
============================================
- Coverage     78.70%   78.69%   -0.02%     
============================================
  Files            49       49              
  Lines          3484     3482       -2     
============================================
- Hits           2742     2740       -2     
  Misses          742      742              

☔ 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.

@penelopeysm
Copy link
Member

As it turns out, looking at this more closely, the comment directly above the changed code was correct, and we can't use rand(model) because that doesn't include the results of := statements. So my issue was wrong as well. Sorry!

@penelopeysm penelopeysm closed this Mar 9, 2026
@anurag-mds anurag-mds deleted the anurag/simplify-only-accs-varinfo branch March 9, 2026 10:48
@anurag-mds
Copy link
Author

Thanks for looking into it more closely, Penny! Good to know the distinction -- I learned something about := variables from this.

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.

2 participants