Schema v2

Second iteration of the schema

Download json.

CorrectionSet

type

object

properties

  • schema_version

Schema Version

The overall schema version

type

integer

enum

2

const

2

  • description

Description

A nice description of what is in this CorrectionSet means

default

null

anyOf

type

string

type

null

  • corrections

Corrections

type

array

items

Correction

  • compound_corrections

Compound Corrections

default

null

anyOf

type

array

items

CompoundCorrection

type

null

additionalProperties

False

Binning

1-dimensional binning in an input variable

type

object

properties

  • nodetype

Nodetype

type

string

enum

binning

const

binning

  • input

Input

The name of the correction input variable this binning applies to

type

string

  • edges

Edges

Edges of the binning, either as a list of monotonically increasing floats or as an instance of UniformBinning. edges[i] <= x < edges[i+1] => f(x, …) = content[i](…)

anyOf

type

array

items

anyOf

type

number

type

string

enum

inf, +inf, -inf

UniformBinning

  • content

Content

type

array

items

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

  • flow

Flow

Overflow behavior for out-of-bounds values

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

type

string

enum

clamp, error

additionalProperties

False

Category

A categorical lookup

type

object

properties

  • nodetype

Nodetype

type

string

enum

category

const

category

  • input

Input

The name of the correction input variable this category node applies to

type

string

  • content

Content

type

array

items

CategoryItem

  • default

Default

default

null

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

type

null

additionalProperties

False

CategoryItem

A key-value pair

The key type must match the type of the Category input variable

type

object

properties

  • key

Key

anyOf

type

integer

type

string

  • value

Value

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

additionalProperties

False

CompoundCorrection

A compound correction

This references other Correction objects in a CorrectionSet and can provide a canned recipe for serial application of dependent corrections. For example, given corrections corr1(x, y) and corr2(x’, z), where x’ = corr1(x, y) * x, the compound correction corr(x, y, z) = corr2(x * corr1(x, y), z) can be expressed with reference to its component corrections.

type

object

properties

  • name

Name

type

string

  • description

Description

Detailed description of the correction stack

default

null

anyOf

type

string

type

null

  • inputs

Inputs

The function signature of the correction

type

array

items

Variable

  • output

Output type for this correction

allOf

Variable

  • inputs_update

Inputs Update

Names of the input variables to update with the output of the previous correction

type

array

items

type

string

  • input_op

Input Op

How to accumulate changes in the input variables

type

string

enum

+, *, /

  • output_op

Output Op

How to accumulate changes in the output variable

type

string

enum

+, *, /, last

  • stack

Stack

Names of the component corrections. Each component should have a subset of the inputs listed in this object.

type

array

items

type

string

additionalProperties

False

Correction

type

object

properties

  • name

Name

type

string

  • description

Description

Detailed description of the correction

default

null

anyOf

type

string

type

null

  • version

Version

Some value that may increase over time due to bugfixes

type

integer

  • inputs

Inputs

The function signature of the correction

type

array

items

Variable

  • output

Output type for this correction

allOf

Variable

  • generic_formulas

Generic Formulas

A list of common formulas that may be used

For corrections with many parameterized formulas that follow a regular pattern, the expression and inputs can be declared once with a generic formula, deferring the parameter declaration to the more lightweight FormulaRef nodes. This can speed up both loading and evaluation of the correction object

default

null

anyOf

type

array

items

Formula

type

null

  • data

Data

The root content node

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

additionalProperties

False

Formula

A general formula type

type

object

properties

  • nodetype

Nodetype

type

string

enum

formula

const

formula

  • expression

Expression

type

string

  • parser

Parser

type

string

enum

TFormula

const

TFormula

  • variables

Variables

The names of the correction input variables this formula applies to

type

array

items

type

string

  • parameters

Parameters

Parameters, if the parser supports them (e.g. [0] for TFormula)

default

null

anyOf

type

array

items

type

number

type

null

additionalProperties

False

FormulaRef

A reference to one of the Correction generic_formula items, with specific parameters

type

object

properties

  • nodetype

Nodetype

type

string

enum

formularef

const

formularef

  • index

Index

Index into the Correction.generic_formulas list

type

integer

minimum

0

  • parameters

Parameters

Same interpretation as Formula.parameters

type

array

items

type

number

additionalProperties

False

HashPRNG

A node that generates a pseudorandom number deterministic in its inputs

The output distribution can be chosen from a set of fixed values, downstream code could then shift and scale it as necessary.

type

object

properties

  • nodetype

Nodetype

type

string

enum

hashprng

const

hashprng

  • inputs

Inputs

The names of the input variables to use as entropy sources

type

array

items

type

string

minItems

1

  • distribution

Distribution

The output distribution to draw from

type

string

enum

stdflat, stdnormal, normal

additionalProperties

False

MultiBinning

N-dimensional rectangular binning

type

object

properties

  • nodetype

Nodetype

type

string

enum

multibinning

const

multibinning

  • inputs

Inputs

The names of the correction input variables this binning applies to

type

array

items

type

string

minItems

1

  • edges

Edges

Bin edges for each input

type

array

items

anyOf

type

array

items

anyOf

type

number

type

string

enum

inf, +inf, -inf

UniformBinning

  • content

Content

Bin contents as a flattened array

This is a C-ordered array, i.e. content[d1*d2*d3*i0 + d2*d3*i1 + d3*i2 + i3] corresponds to the element at i0 in dimension 0, i1 in dimension 1, etc. and d0 = len(edges[0])-1, etc.

type

array

items

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

  • flow

Flow

Overflow behavior for out-of-bounds values

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

type

string

enum

clamp, error

additionalProperties

False

Transform

A node that rewrites one real or integer input according to a rule as given by a content node

Any downstream nodes will see a different value for the rewritten input If the input is an integer type, the rule output will be cast from a double to integer type before using. These should be used sparingly and at high levels in the tree, since they require an allocation.

type

object

properties

  • nodetype

Nodetype

type

string

enum

transform

const

transform

  • input

Input

The name of the input to rewrite

type

string

  • rule

Rule

A subtree that implements the rewrite rule

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

  • content

Content

A subtree that will be evaluated with transformed values

anyOf

Binning

MultiBinning

Category

Formula

FormulaRef

Transform

HashPRNG

type

number

additionalProperties

False

UniformBinning

Uniform binning description, to be used as the edges attribute of Binning or MultiBinning.

type

object

properties

  • n

N

Number of bins

type

integer

  • low

Low

Lower edge of first bin

type

number

  • high

High

Higher edge of last bin

type

number

additionalProperties

False

Variable

An input or output variable

type

object

properties

  • name

Name

type

string

  • type

Type

A string, a 64 bit integer, or a double-precision floating point value

type

string

enum

string, int, real

  • description

Description

A nice description of what this variable means

default

null

anyOf

type

string

type

null

additionalProperties

False