Skip to content

DescriptorArray.variance = None crashes instead of clearing variances #265

@rozyczko

Description

@rozyczko

Finding V-H1 in DEEP_ANALYSIS.md (parent #261).

src/easyscience/variable/descriptor_array.py:320-335 — the final assignment sits outside the if variance is not None: guard:

        # Values must be floats for optimization
        self._array.variances = variance.astype('float')   # None.astype -> AttributeError

Passing None (explicitly allowed by the guard and the docstring) raises AttributeError. There is currently no way to clear variances on an array via this property. The sibling error setter (lines 373-388) handles None correctly in an else branch — mirror that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions