Skip to content

fix: make @poissonians return a Vector like @variables and @brownians#4274

Merged
AayushSabharwal merged 1 commit intoSciML:masterfrom
isaacsas:use_vecs_with_poissonians
Feb 8, 2026
Merged

fix: make @poissonians return a Vector like @variables and @brownians#4274
AayushSabharwal merged 1 commit intoSciML:masterfrom
isaacsas:use_vecs_with_poissonians

Conversation

@isaacsas
Copy link
Member

@isaacsas isaacsas commented Feb 7, 2026

Summary

@poissonians returned inconsistent types compared to @variables and @brownians:

Case @variables / @brownians @poissonians (before)
Single, inline [x] (1-element Vector) bare Num
Multiple, inline [x, y] (Vector) (x, y) (Tuple)
Block syntax [x, y] (Vector) bare Num or Tuple

This happened because @variables and @brownians delegate to Symbolics.parse_vars (which always returns a Vector via Expr(:vect, ...)), while @poissonians used custom codegen that returned a bare name for single declarations and an Expr(:tuple, ...) for multiple.

Fix

One-line change in _poissonians: replace the conditional bare/tuple return with Expr(:vect, names...) so it always returns a Vector.

No existing tests break since all current usages rely on the side effect of binding variables into scope, not on the return value. New tests verify the return type across all permutations (single/multiple, inline/block).

Previously @poissonians returned a bare Num for single declarations and
a Tuple for multiple declarations. Now it always returns a Vector,
consistent with @variables and @brownians which use Symbolics.parse_vars.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@isaacsas
Copy link
Member Author

isaacsas commented Feb 7, 2026

@AayushSabharwal if relevant tests pass this should be good to go. It is a minor change to just be consistent with @variables and always return a vector.

@AayushSabharwal AayushSabharwal merged commit 79897d2 into SciML:master Feb 8, 2026
35 of 68 checks passed
@isaacsas isaacsas deleted the use_vecs_with_poissonians branch February 8, 2026 11:38
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