Skip to content

Coerce lists/arrays to the expected ArrayParameter subtype in ParameterSpace#832

Merged
apdavison merged 1 commit intoNeuralEnsemble:masterfrom
apdavison:issue709
May 5, 2026
Merged

Coerce lists/arrays to the expected ArrayParameter subtype in ParameterSpace#832
apdavison merged 1 commit intoNeuralEnsemble:masterfrom
apdavison:issue709

Conversation

@apdavison
Copy link
Copy Markdown
Member

When the schema specifies a subclass of ArrayParameter (e.g. Sequence), _setitem_value was hardcoding ArrayParameter as the coercion target. This meant passing a list of numpy arrays as spike_times would produce ArrayParameter elements rather than Sequence elements, causing .get() to fail. Fix by using expected_dtype in all three coercion branches.

Fixes #709

…erSpace

When the schema specifies a subclass of ArrayParameter (e.g. Sequence),
_setitem_value was hardcoding ArrayParameter as the coercion target.
This meant passing a list of numpy arrays as spike_times would produce
ArrayParameter elements rather than Sequence elements, causing .get() to
fail. Fix by using expected_dtype in all three coercion branches.

Fixes NeuralEnsemble#709
@apdavison apdavison added this to the 0.13.0 milestone May 4, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 71.146% (-0.008%) from 71.154% — apdavison:issue709 into NeuralEnsemble:master

@apdavison apdavison merged commit f3af051 into NeuralEnsemble:master May 5, 2026
7 checks passed
@apdavison apdavison deleted the issue709 branch May 5, 2026 10:46
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.

List with homogeneous array-like parameter entries only work for the corresponding default parameter type

2 participants