mt.geo.bounding

Registry to store all the functions to upper-bound and lower-bound a geometric object of type A with an object of type B.

Functions

mt.geo.bounding.upper_bound(obj, dst_type)

Upper-bounds an object to a target type.

Parameters:
  • obj (object) – object to upper-bound

  • dst_type (type) – type or class to upper-bound to

Returns:

the upper-bounded version of obj

Return type:

object

Raises:

NotImplementedError – if the upper-bound function has not been registered using function register_upper_bound

mt.geo.bounding.upper_boundable(obj, dst_type)

Checks if an object can be upper-bounded to a target type.

Parameters:
  • obj (object) – object to upper-bound

  • dst_type (type) – type or class to upper-bound to

Returns:

whether or not the object is upper-boundable to dst_type

Return type:

bool

Raises:

NotImplementedError – if the upper-boundable function has not been registered using functions register_upper_boundable or register_upper_bound

mt.geo.bounding.register_upper_bound(src_type, dst_type, func)

Registers a function to upper-bound an object from type A to type B.

Parameters:
  • src_type (type) – type or class to upper-bound from

  • dst_type (type) – type or class to upper-bound to

  • func (function) – upper-bound function to register

mt.geo.bounding.register_upper_boundable(src_type, dst_type, func)

Registers a function to check if we can upper-bound an object from type A to type B.

Parameters:
  • src_type (type) – type or class to upper-bound from

  • dst_type (type) – type or class to upper-bound to

  • func (function) – upper-boundable function to register

mt.geo.bounding.lower_bound(obj, dst_type)

Lower-bounds an object to a target type.

Parameters:
  • obj (object) – object to lower-bound

  • dst_type (type) – type or class to lower-bound to

Returns:

the lower-bounded version of obj

Return type:

object

Raises:

NotImplementedError – if the lower-bound function has not been registered using function register_lower_bound

mt.geo.bounding.lower_boundable(obj, dst_type)

Checks if an object can be lower-bounded to a target type.

Parameters:
  • obj (object) – object to lower-bound

  • dst_type (type) – type or class to lower-bound to

Returns:

whether or not the object is lower-boundable to dst_type

Return type:

bool

Raises:

NotImplementedError – if the lower-boundable function has not been registered using functions register_lower_boundable or register_lower_bound

mt.geo.bounding.register_lower_bound(src_type, dst_type, func)

Registers a function to lower-bound an object from type A to type B.

Parameters:
  • src_type (type) – type or class to lower-bound from

  • dst_type (type) – type or class to lower-bound to

  • func (function) – lower-bound function to register

mt.geo.bounding.register_lower_boundable(src_type, dst_type, func)

Registers a function to check if we can lower-bound an object from type A to type B.

Parameters:
  • src_type (type) – type or class to lower-bound from

  • dst_type (type) – type or class to lower-bound to

  • func (function) – lower-boundable function to register