DomainInterface#

Module for the Domain Interface.

class DomainInterface[source]#

Bases: object

Abstract interface for all geometric domains.

abstract is_inside(point, check_border)[source]#

Check if a point is inside the domain.

Parameters:
  • point (LabelTensor) – The point to check.

  • check_border (bool) – If True, the boundary is considered inside the domain.

Returns:

Whether the point is inside the domain or not.

Return type:

bool

abstract update(domain)[source]#

Update the current domain by adding the labels contained in domain. Each new label introduces a new dimension. Only domains of the same type can be used for update.

Parameters:

domain (BaseDomain) – The domain whose labels are to be merged into the current one.

Returns:

A new domain instance with the merged labels.

Return type:

DomainInterface

abstract sample(n, mode, variables)[source]#

The sampling routine.

Parameters:
  • n (int) – The number of samples to generate.

  • mode (str) – The sampling method.

  • variables (list[str]) – The list of variables to sample.

Returns:

The sampled points.

Return type:

LabelTensor

abstract partial()[source]#

Return the boundary of the domain as a new domain object.

Returns:

The boundary of the domain.

Return type:

DomainInterface

abstract property sample_modes#

The list of available sampling modes.

Returns:

The list of available sampling modes.

Return type:

list[str]

abstract property variables#

The list of variables of the domain.

Returns:

The list of variables of the domain.

Return type:

list[str]

abstract property domain_dict#

The dictionary representing the domain.

Returns:

The dictionary representing the domain.

Return type:

dict

abstract property range#

The range variables of the domain.

Returns:

The range variables of the domain.

Return type:

dict

abstract property fixed#

The fixed variables of the domain.

Returns:

The fixed variables of the domain.

Return type:

dict