Skip to content

ObjectState reconstructs concrete nested subtypes through their base annotation #16

Description

@trissim

ObjectState flattens fields from the actual nested dataclass value but records its annotation type as the reconstruction owner, except for registered lazy dataclasses. A concrete subtype therefore contributes extra fields that its base annotation cannot accept.

OpenHCS original 3D CellProfiler configuration has VolumeSourceSpatialDomain in a field annotated SourceSpatialDomain. After the independent context merge fix (#14/#15), constructing ObjectState(config) fails in _reconstruct_from_parameter_snapshot with SourceSpatialDomain.__init__() got an unexpected keyword argument source_depth. This is the actual compiler configuration boundary, not a missing image declaration or a wire fallback.

The existing flattened parameter type index should retain the actual dataclass owner for concrete nominal subtypes as well as lazy values, so raw, live-resolved and saved-resolved reconstruction consume the same schema that was flattened. Replacement with a different nominal subtype must rebuild the existing parameter topology.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions