lale.schema_simplifier module

lale.schema_simplifier.enumValues(es: lale.schema_simplifier.set_with_str_for_keys[Any], s: Any) → lale.schema_simplifier.set_with_str_for_keys[Any][source]

Given an enumeration set and a schema, return all the consistent values of the enumeration.

lale.schema_simplifier.filterForOptimizer(schema: Any) → Optional[Any][source]
lale.schema_simplifier.findRelevantFields(schema: Any) → Optional[Set[str]][source]

Either returns the relevant fields for the schema, or None if there was none specified

lale.schema_simplifier.impossible() → Any[source]
lale.schema_simplifier.liftAllOf(schemas: List[Any]) → Iterator[Any][source]

Given a list of schemas, if any of them are allOf schemas, lift them out to the top level

lale.schema_simplifier.liftAnyOf(schemas: List[Any]) → Iterator[Any][source]

Given a list of schemas, if any of them are anyOf schemas, lift them out to the top level

lale.schema_simplifier.makeAllOf(schemas: List[Any]) → Any[source]
lale.schema_simplifier.makeAnyOf(schemas: List[Any]) → Any[source]
lale.schema_simplifier.makeOneOf(schemas: List[Any]) → Any[source]
lale.schema_simplifier.makeSingleton_(k: str, schemas: List[Any]) → Any[source]
lale.schema_simplifier.narrowSimplifyAndFilter(schema: Any, floatAny: bool) → Optional[Any][source]
lale.schema_simplifier.narrowToGivenRelevantFields(schema: Any, relevantFields: Set[str]) → Any[source]
lale.schema_simplifier.narrowToRelevantFields(schema: Any) → Any[source]
class lale.schema_simplifier.set_with_str_for_keys(elems: Union[Dict[str, VV], Iterator[VV]])[source]

Bases: typing.Generic

This mimicks a set, but uses the string representation of the elements for comparison tests. It can be used for unhashable elements, as long as the str function is injective

difference(*others)[source]
intersection(*others)[source]
union(*others)[source]
lale.schema_simplifier.simplify(schema: Any, floatAny: bool) → Any[source]

Tries to simplify a schema into an equivalent but more compact/simpler one. If floatAny if true, then the only anyOf in the return value will be at the top level. Using this option may cause a combinatorial blowup in the size of the schema

lale.schema_simplifier.simplifyAll(schemas: List[Any], floatAny: bool) → Any[source]
lale.schema_simplifier.simplifyAny(schema: List[Any], floatAny: bool) → Any[source]
lale.schema_simplifier.simplifyNot(schema: Any, floatAny: bool) → Any[source]
lale.schema_simplifier.simplifyNot_(schema: Any, floatAny: bool, alreadySimplified: bool = False) → Any[source]

alreadySimplified=true implies that schema has already been simplified

lale.schema_simplifier.toAllOfList(schema: Any) → List[Any][source]
lale.schema_simplifier.toAnyOfList(schema: Any) → List[Any][source]