BaseDomain#

Module for the Base class for domains.

class BaseDomain(variables_dict=None)[source]#

Bases: DomainInterface

Base class for all geometric domains, implementing common functionality.

All specific domain types should inherit from this class and implement the abstract methods of DomainInterface.

This class is not meant to be instantiated directly.

Initialization of the BaseDomain class.

Parameters:

variables_dict (dict | None) – A dictionary where the keys are the variable names and the values are the domain extrema. The domain extrema can be either a list or tuple with two elements or a single number. If the domain extrema is a single number, the variable is fixed to that value.

Raises:
  • TypeError – If the domain dictionary is not a dictionary.

  • ValueError – If the domain dictionary is empty.

  • ValueError – If the domain dictionary contains variables with invalid ranges.

  • ValueError – If the domain dictionary contains values that are neither numbers nor lists/tuples of numbers of length 2.

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.

Raises:

TypeError – If the provided domain is not of the same type as the current one.

Returns:

A new domain instance with the merged labels.

Return type:

BaseDomain

property sample_modes#

The list of available sampling modes.

Returns:

The list of available sampling modes.

Return type:

list[str]

property variables#

The list of variables of the domain.

Returns:

The list of variables of the domain.

Return type:

list[str]

property domain_dict#

The dictionary representing the domain.

Returns:

The dictionary representing the domain.

Return type:

dict

property range#

The range variables of the domain.

Returns:

The range variables of the domain.

Return type:

dict

property fixed#

The fixed variables of the domain.

Returns:

The fixed variables of the domain.

Return type:

dict