Skip to content

Conversation

@timmens
Copy link
Member

@timmens timmens commented Jan 28, 2026

Summary

  • Exclude internal weight_{transition_name} functions from available_targets to fix ValueError when calling to_dataframe(additional_targets="all") on models with stochastic transitions

Test plan

Fixes #215

The internal `weight_{transition_name}` functions used for stochastic
state transitions return multi-dimensional probability arrays, which
cannot be added as DataFrame columns. These functions are now excluded
from `available_targets` to prevent ValueError when users call
`to_dataframe(additional_targets="all")` on models with stochastic
transitions.

Fixes #215

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@timmens timmens force-pushed the fix/stochastic-transition-additional-targets-215 branch from aaa97d1 to a3d0700 Compare January 28, 2026 13:34
@timmens timmens requested a review from MImmesberger January 28, 2026 13:38
Copy link
Member

@MImmesberger MImmesberger left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks! Maybe the fact that additional_targets="all" didn't work previously warrants a new end-to-end test? Your call, I don't know much about this codebase

timmens and others added 2 commits January 29, 2026 17:23
…ransitions

The previous implementation generated weight_ prefixed names for ALL
transitions, but weight functions only exist for stochastic ones. Now
uses is_stochastic_transition() to correctly filter, matching the
pattern used elsewhere in the codebase (e.g., simulation/util.py).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@timmens timmens merged commit 8e51b89 into main Jan 29, 2026
8 checks passed
@timmens timmens deleted the fix/stochastic-transition-additional-targets-215 branch January 29, 2026 17:23
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.

BUG: Selecting stochastic state transition as additional_targets returns ValueError

3 participants