pyhs3.axes.IrregularAxis

class pyhs3.axes.IrregularAxis(**data)[source]
Variables:
  • name – Name of the axis/variable

  • edges – Bin edges array (length n+1)

Parameters:

data (Any)

Fields

Field

Type

Required

Default

edges

list[float]

Yes

name

str

Yes

Validators

Validator

Mode

Fields

validate_binning

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

to_hist()

Convert this axis to a hist.axis object.

validate_binning()

Ensure proper binning specification for binned data.

Attributes

max

Return upper edge.

min

Return lower edge.

nbins

Get the nbins for this axis.

edges

name

IrregularAxis.to_hist()[source]

Convert this axis to a hist.axis object.

Return type:

Variable

Returns:

A hist.axis.Variable object

IrregularAxis.validate_binning()[source]

Ensure proper binning specification for binned data.

Return type:

IrregularAxis

IrregularAxis.max

Return upper edge.

IrregularAxis.min

Return lower edge.

IrregularAxis.nbins

Get the nbins for this axis.

Returns:

Number of bins.

IrregularAxis.edges
IrregularAxis.name