Releases: seequent/properties
Releases · seequent/properties
v0.6.1 - Support np.bool_ in Boolean.from_json
v0.6.0 - Fix Diamond Inheritance, Allow Unsigned Int Arrays
Minor Changes
properties.Array
now supports unsigned integer arrays. (See #274)coerce
is added as a new keyword argument forproperties.Array
. By default, this isTrue
and inputs are coerced to the corresponding numpy array class, matching previous behaviour. However, ifcoerce=False
inputs are not coerced and aValidationError
is raised if they do not match the corresponding numpy array class. (See #272)- Properties defined on mixin classes which use the
PropertyMetaclass
but do inheritHasProperties
are now respected. (See #283 - thanks @hishnash!) - Explicit support added for Python 3.7 and removed for 3.4. (See #281)
Bug Fixes
- Order of property resolution for
HasProperties
classes with diamond inheritance was fixed to be more sensible and in line with attribute resolution forobject
diamond inheritance. Although this is considered a fix, it does fundamentally change inheritance logic for existing classes with diamond inheritance and is therefore not backwards compatible. (See #275 and additional conversation #276) - Ensure
ValidationErrors
with noreason
/prop
/instance
are not ignored. (See #271)
v0.5.6 - Speed up Vector3Array validation
Bug fix
Vector3Array
validation is simplified to not include the check for string representations (e.g. 'up', 'east') if using a numpy array. This vastly speeds up validation for large arrays since we no longer must iterate through every value. This fix is already present inVector2Array
. See gmggroup/omf#43
v0.5.5 - Better Error Messaging
New Feature
- Improved
ValidationError
messaging, including more details on property errors and info about underlying errors onUnion
andInstance
property validation (See: #261)
Bug Fixes
- Remove
functools.wraps
on serializer/deserializer functions to fix Python 2 bug (See: https://github.com/gmggroup/omf/issues/30 and #265)
v0.5.4 - URL property under web extras
New Features
- New
URL
property underweb
extras
Bug Fixes
- Fix typo in
Pointer
uid_prop
getter
v0.5.3 - Task refactor, minor bug fixes
Minor Changes
properties.extras.Task
has been refactored for more distinction between inputs/outputs and the task itself (see #252 for slightly more context).
Bug Fixes
v0.5.2 - Unpin vectormath
Minor Updates
- Unpin
vectormath
dependency to allow any release >=0.1.4 (see #247).- This is in response to the
vectormath
update from version 0.1.4 to 0.2.0, which introduced some backwards-incompatible changes (see the release notes). Now, either version of the library may be used withproperties
- This is in response to the
v0.5.1 - Make picklable, fix union deserialization
v0.5.0 - Better validation errors, new extras, Union property tweaks
Backwards-Incompatible Changes
Union
property deserialization has been improved more reliably reconstruct correct instances (see #228)- This requires new
strict_instances
attribute onUnion
properties - It also adds
strict
andassert_valid
ondeserialize
, instead of `verbose. - There is no guarantee that
Union
properties behave identically to their previous behaviour.
- This requires new
Task
classes are moved fromproperties.task.Task
toproperties.extras.Task
Major Features
- New
ValidationError
is raised when validation fails (see #224)- This is a subclass of
ValueError
- Multiple validation errors are now collected and raised together in one error description.
- There is also an error hook called on validation error to customize error behaviour
- This is a subclass of
- New extras classes:
v0.4.0 - Links, Dictionary property, and more
Backwards-Incompatible Changes
-
Container properties no longer use an empty container as their
_class_default
; instead, the class default isproperties.undefined
, like all other built-in property types. This gives consistent behavior across all built-in property defaults. It also avoids unexpected problems with validation outlined in #169. (See #219)In order to update code from
properties v0.3.5
tov0.4.0
, you may simply add the appropriate default on each container property. For example:import properties assert properties.__version__ == '0.3.5' class MyClass(properties.HasProperties): my_list = properties.List( doc='List of strings', prop=properties.String(''), )
behaves identically to
import properties assert properties.__version__ == '0.4.0' class MyClass(properties.HasProperties): my_list = properties.List( doc='List of strings', prop=properties.String(''), default=list, )
Major New Features
- New
Dictionary
property. (See #188, issue #165) link
anddirectional_link
objects allow values for properties (and traits) across HasProperties (and HasTraits) instances to be linked. The API for links mimics that from traitlets: http://traitlets.readthedocs.io/en/stable/utils.html#links. (See #155)properties.Bool
has been renamedproperties.Boolean
to normalize naming conventions across the library (e.g. the integer property isproperties.Integer
, notproperty.Int
). (See #209)
Minor Changes
- Properties may now be private (i.e. names may begin with underscore). (See #194, issue #191)
- Container properties may now leave
prop
unspecified for untyped contents. (See #188) - Array properties:
- Dynamic properties:
- Renamed properties now have an option to not raise a warning. (See #203, issue #201)
stop_recursion_with
util function has been deprecated. (See #204, issue #168)- Docstring improvements:
Bug Fixes
- For container properties, when an instance of a subclass of the base container type are assigned to a property, their class is now maintained (e.g.
OrderedDict
is no longer coerced to standarddict
onvalidate
). (See #221) default
value validation no longer fails due to the order which property attributes are set. (See #186, issue #177)properties.copy
now maintains classes of the original. (See #184, issue #175)- Union properties with
required=False
no longer fail validation when unset. (See #199, issue #198) - Deserialization from dictionary that includes a renamed property no longer fails. (See #217)
- Conflicts can no longer arise from setting dynamic properties on init. (See #187, issue #173)
- Metaclass setup no longer fails if
__setattr__
is overridden. (See #158) - Sphinx linking for custom property classes now works. (See #156, issue #153)