Conversation
jonnew
commented
Jul 30, 2026
Member
- Flip the channel map direction from contact -> channel to channel -> contact. A hardware channel can only ever be wired to one contact, so channel is the value that actually needs uniqueness enforcement; keying by channel makes that structural (a Dictionary can't hold two entries for the same key), so duplicate-channel detection in Probe's constructor and ProbeGroup.ValidateDeviceChannelIndices no longer need a separate manual scan.
- Move channel map ownership off Probe: Probe.ChannelMap and Probe.TryGetMappedChannel are now internal. Public access goes through ProbeGroup.ChannelMap / ProbeGroup.TryGetMappedChannel, or through the new SingleProbeGroup base class for groups that always contain exactly one probe. Probe.GetChannelMap() and ProbeGroup.GetChannelMap() are removed in favor of the ChannelMap properties.
- Add SingleProbeGroup: an abstract ProbeGroup subclass that enforces the single-probe invariant and exposes Probe, ChannelMap, and TryGetMappedChannel without a probe-index argument.
- Add deep copy constructors to Probe, ProbeAnnotations, and ProbeGroup. Copies no longer share a channel map or contact/probe annotation store with their source.
- Add schema-accurate validation to Probe's JSON constructor:
- ndim must be 2 or 3
- contact_positions, contact_plane_axes, and probe_planar_contour rows must match ndim
- contact_plane_axes entries can't be null and must contain exactly 2 axis vectors
- contact_shape_params must be consistent with contact_shapes (circle requires radius, rect requires width and height, square requires width)
- Add validation to ContactShapeParam: radius/width/height must be non-negative, and at least one of radius or width must be specified.
- Require model_name and manufacturer in ProbeAnnotations, matching the probeinterface schema.
- Add ProbeGroup.NumberOfProbes.
- Enable InternalsVisibleTo for OpenEphys.ProbeInterface.NET.Tests.
- Correct and complete XML doc comments across the public API.
…ation
- Flip the channel map direction from contact -> channel to
channel -> contact. A hardware channel can only ever be wired to one
contact, so channel is the value that actually needs uniqueness
enforcement; keying by channel makes that structural (a Dictionary
can't hold two entries for the same key), so duplicate-channel
detection in Probe's constructor and ProbeGroup.ValidateDeviceChannelIndices
no longer need a separate manual scan.
- Move channel map ownership off Probe: Probe.ChannelMap and
Probe.TryGetMappedChannel are now internal. Public access goes through
ProbeGroup.ChannelMap / ProbeGroup.TryGetMappedChannel, or through the
new SingleProbeGroup base class for groups that always contain exactly
one probe. Probe.GetChannelMap() and ProbeGroup.GetChannelMap() are
removed in favor of the ChannelMap properties.
- Add SingleProbeGroup: an abstract ProbeGroup subclass that enforces the
single-probe invariant and exposes Probe, ChannelMap, and
TryGetMappedChannel without a probe-index argument.
- Add deep copy constructors to Probe, ProbeAnnotations, and ProbeGroup.
Copies no longer share a channel map or contact/probe annotation store
with their source.
- Add schema-accurate validation to Probe's JSON constructor:
- ndim must be 2 or 3
- contact_positions, contact_plane_axes, and probe_planar_contour rows
must match ndim
- contact_plane_axes entries can't be null and must contain exactly 2
axis vectors
- contact_shape_params must be consistent with contact_shapes (circle
requires radius, rect requires width and height, square requires
width)
- Add validation to ContactShapeParam: radius/width/height must be
non-negative, and at least one of radius or width must be specified.
- Require model_name and manufacturer in ProbeAnnotations, matching the
probeinterface schema.
- Add ProbeGroup.NumberOfProbes.
- Enable InternalsVisibleTo for OpenEphys.ProbeInterface.NET.Tests.
- Correct and complete XML doc comments across the public API.
…ontact - ChannelWiring.WireChannels' assignments parameter (IDictionary<int,int>) now reads channel -> contact, matching the direction already used by ProbeGroup.ChannelMap, TryGetMappedChannel, and the JSON device_channel_indices handling. Previously it was the one remaining API surface still keyed by contact. - Note: This is a silent breaking change: the parameter type is unchanged (IDictionary<int,int>), so existing callers will keep compiling but wire the wrong contacts to the wrong channels unless updated. WireChannel, UnwireChannel, and UnwireChannels are unaffected. - Validation swaps accordingly: channel keys must be >= 0; contact values must be within [0, contact count) and unique within the call. Duplicate-channel-within-a-call is now structurally impossible (can't construct a Dictionary with two identical keys), so that manual check is removed; a new check catches the mirror case, the same contact targeted by two different channels in one call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.