pyhs3.axes.RegularAxis

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

  • min – Minimum value (inherited from BoundedAxis)

  • max – Maximum value (inherited from BoundedAxis)

  • nbins – Number of bins (for regular binning)

Parameters:

data (Any)

Fields

Field

Type

Required

Default

max

float

Yes

min

float

Yes

name

str

Yes

nbins

int

Yes

Validators

Validator

Mode

Fields

check_binning

after

model

check_min_le_max

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

check_binning()

Validate that max >= min.

check_min_le_max()

Validate that max >= min.

to_hist()

Convert this axis to a hist.axis object.

Attributes

edges

Get the bin edges for this axis.

nbins

min

max

name

RegularAxis.check_binning()[source]

Validate that max >= min.

Return type:

RegularAxis

RegularAxis.check_min_le_max()

Validate that max >= min.

Return type:

BoundedAxis

RegularAxis.to_hist()[source]

Convert this axis to a hist.axis object.

Return type:

Regular

Returns:

A hist.axis.Regular object

RegularAxis.edges

Get the bin edges for this axis.

Returns:

List of bin edges. Generates edges using linspace.

RegularAxis.nbins
RegularAxis.min
RegularAxis.max
RegularAxis.name