pyhs3.domains.ProductDomain

class pyhs3.domains.ProductDomain(**data)[source]

Product domain specification for multi-dimensional parameter spaces.

Defines a Cartesian product of axes to create multi-dimensional parameter domains. Used for specifying integration regions, parameter constraints, and likelihood evaluation domains in HS3 specifications.

The domain represents the Cartesian product: axis₁ x axis₂ x … x axisₙ where each axis defines a one-dimensional range.

Parameters:
  • name – Name identifier for the domain

  • type – Domain type identifier (always “product_domain”)

  • axes – List of axis specifications defining each dimension

  • data (Any)

Fields

Field

Type

Required

Default

axes

DomainAxes

No

factory

name

str

Yes

type

Literal[‘product_domain’]

No

'product_domain'

Validators

Validator

Mode

Fields

initialize_axes_map

after

model

validate_unique_axis_names

after

model

__init__(**data)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

Methods

get(axis_name[, default])

Get axis bounds for a parameter name.

initialize_axes_map()

Initialize the internal axes mapping for fast lookup.

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

validate_unique_axis_names()

Validate that all axis names are unique within the domain.

Attributes

axis_names

List of axis names in this domain.

dimension

Number of dimensions (axes) in this domain.

type

axes

name

ProductDomain.get(axis_name, default=(None, None))[source]

Get axis bounds for a parameter name.

Parameters:
  • axis_name (str) – Name of the axis to get bounds for.

  • default (tuple[float | None, float | None]) – Default value to return if axis not found.

Return type:

tuple[float | None, float | None]

Returns:

Tuple of (min, max) bounds if axis exists, otherwise default.

ProductDomain.initialize_axes_map()[source]

Initialize the internal axes mapping for fast lookup.

Return type:

ProductDomain

ProductDomain.model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

ProductDomain.validate_unique_axis_names()[source]

Validate that all axis names are unique within the domain.

Return type:

ProductDomain

ProductDomain.axis_names

List of axis names in this domain.

ProductDomain.dimension

Number of dimensions (axes) in this domain.

ProductDomain.type
ProductDomain.axes
ProductDomain.name