Clorm

Latest version: v1.6.0

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

Scan your dependencies

Page 3 of 4

1.3.0

Main new features

1. Partial support for `pickling` Clorm fact objects. Pickled clorm objects encode internal `clingo.Symbol` objects using a proxy `clorm.noclingo.Symbol` library to provide pickling of pure-Python only objects.
2. Provided a switching mode where `clorm.noclingo.Symbol` is used instead of `clingo.Symbol`.
3. Combining 1. and 2. it is possible to have a main long running processes that uses Clorm facts but doesn't create any underlying `clingo.Symbol` objects (which cannot be released from memory); then these Clorm facts can be easily passed to sub-processes created using the standard Python `multiprocessing` library and passed to the solver.
4. A factory function `define_enum_field` to allow `enum.Enum` classes to used as a Clorm field.
5. More options for `define_nested_list_field` to allow different asp encodings of a list.
6. More options when generating an ASP string from a `FactBase` that is self documenting based on the docstring of the Predicate sub-class.

Breaking changes

For most usages of the library there should be no changes required. However, for some advanced cases it may require some small modifications. In particular:

1. If you are defining your own fields that inherit directly from `RawField` then you will need to change your field definition. The field sub-classes now inherit from a new `BaseField` class and not `RawField`. `RawField` is now a special purpose class that encapsulates either `clingo.Symbol` or `clorm.noclingo.Symbol` objects into a `Raw` class object. You can still access an underlying `clingo.Symbol` object from the `Raw` object.
2. The function signature for `refine_field`, `define_nested_list_field`, `combine_fields`, and `simple_predicate` have changed slightly. If you are providing a class name then this must be provided as a keyword argument after the positional arguments.

1.2.1

1.2.0

1.1.0

1.0.4

Small bug fix and minor improvements:

* Improved the Control/Model/SolveHandle wrapper classes to make it possible to create a wrapper of a wrapper. The goal is to make it easily use to use the Clorm Control wrapper when using Clingo with a theory propagator (eg clingocon and clingo-dl).

* Improved the Factbase query syntax. Can now write more intuitive complex queries using the overloaded ``&``, ``|``, ``~`` operators.

1.0.3

Bug fix and better wrapping of clingo.Control:

* Rewrote the clingo Control/Model/SolveHandle wrapper class to make it more flexible. There should now be fewer quirks when using clorm.clingo.Control as a replacement for clingo.Control.

* Added the on_statistics callback to clorm.clingo.Control

* Fixed the RawField.unifies() function to properly catch expections when something doesn't unify.

* Added __iter__() function to Predicate so it appears as Iterable

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.