Properties

Latest version: v0.6.1

Safety actively analyzes 629564 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.5.2

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](https://github.com/seequent/vectormath/releases/tag/v0.2.0)). Now, either version of the library may be used with `properties`

0.5.1

Minor Changes
- Pickling `HasProperties` instances works better now. They no longer override `__reduce__` and `__setstate__`, and instead are just tweaked so the default pickle behavior is satisfactory (see 243).

Bug Fixes
- Bug where union deserialization leads to invalid state has been fixed (see 245).

0.5.0

Backwards-Incompatible Changes

- `Union` property deserialization has been improved more reliably reconstruct correct instances (see 228)
- This requires new `strict_instances` attribute on `Union` properties
- It also adds `strict` and `assert_valid` on `deserialize`, instead of `verbose.
- There is no guarantee that `Union` properties behave identically to their previous behaviour.
- `Task` classes are moved from `properties.task.Task` to `properties.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
- New extras classes:
- `HasUID` and `Pointer` (see 234)
- `Singleton` (see 227)

0.4.0

Backwards-Incompatible Changes

- Container properties no longer use an empty container as their `_class_default`; instead, the class default is `properties.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` to `v0.4.0`, you may simply add the appropriate default on each container property. For example:

python
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
python
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` and `directional_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.htmllinks. (See 155)
- `properties.Bool` has been renamed `properties.Boolean` to normalize naming conventions across the library (e.g. the integer property is `properties.Integer`, not `property.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:
- `shape` may now be unspecified (if set to `None`) or have multiple valid values (if set to a `set` of valid shapes). Vector array properties may also specify specific shapes, as long as the second dimension is correct. (See 195, issue 192)
- `complex` is now a valid `dtype`. (See 215, issue 208)
- Dynamic properties:
- May be serialized with a HasProperties instance by specifying `save_dynamic=True`. (See 202)
- No longer raise an error if they evaluate to `None`/`undefined`. (See 187, issue 173)
- 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:
- `__IPYTHON__` interrogation to determine sphinx or plain text formatting. (See 156)
- Better wording on limited-size container properties. (See 185, issue 178)
- Custom docs for renamed properties. (See 207)

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 standard `dict` on `validate`). (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)

0.3.5

Bug Fixes
----------
- `v0.3.4` attempted to clean up some code that looked like `if len(val) > 0:` to just `if val:`. This works for `list`s, but not `np.ndarray`s since they have a different way of determining truth. This release reverts these changes back to checking length.

0.3.4

Minor Changes
---------------
- Properties has been moved under ARANZ Geo Limited branding
- `auto_create` on `Instance` property has been deprecated (to be removed in a future release)
- Instead of using `auto_create`, the instance class should be specified as `default`. This will maintain identical behavior.

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.