seequent / properties

An organizational aid and wrapper for validation and tab completion of class properties/traits.
http://propertiespy.rtfd.org
MIT License
18 stars 9 forks source link

Array properties create a new view of the array on validation #272

Closed fwkoch closed 5 years ago

fwkoch commented 5 years ago

When validating an Array, a new view is always created - see here: https://github.com/seequent/properties/blob/9fd6fb0a787e4e8692beb36e537ae8735bdec247/properties/math.py#L129

This results in some strange behavior, especially with using Arrays as DynamicProperties: image

I propose adding a coerce key-word argument similar to container properties: https://github.com/seequent/properties/blob/9fd6fb0a787e4e8692beb36e537ae8735bdec247/properties/base/containers.py#L170-L172 Then if coerce=False we would skip the new view creation step. image