pysis.binning package

Submodules

pysis.binning.abstract module

exception pysis.binning.abstract.BoundsError[source]

Bases: exceptions.IndexError

class pysis.binning.abstract.AbstractBinnedKeys[source]

Bases: object

Flexible base class for binning data.

class Bounds(min, max)

Bases: tuple

max

Alias for field number 1

min

Alias for field number 0

class AbstractBinnedKeys.Item(key, value, data)

Bases: tuple

data

Alias for field number 2

key

Alias for field number 0

value

Alias for field number 1

AbstractBinnedKeys.get_bin_index(value)[source]

Get the index of the bin to place a particular value.

AbstractBinnedKeys.get_bounds(bin_num)[source]

Get the bounds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.
AbstractBinnedKeys.insert(key, value, data={})[source]

Insert the key into a bin based on the given value.

Optionally, data dictionary may be provided to attach arbitrary data to the key.

AbstractBinnedKeys.iterbins_bounds()[source]

Iterate over each bin and its bounds.

AbstractBinnedKeys.iterbounds()[source]

An iterator over each bins bounds.

AbstractBinnedKeys.iterkeys()[source]

An iterator over the keys of each bin.

AbstractBinnedKeys.iterkeys_bounds()[source]

Iterate over the keys of each bin as well as its bounds.

pysis.binning.bounded module

class pysis.binning.bounded.BoundedBinnedKeys(bounds)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct where bins are defined by a list of their bounds.

get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.

pysis.binning.const_width module

class pysis.binning.const_width.ConstWidthBinnedKeys(min_value, max_value, num_bins=None, max_bin_size=None)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct where bins are of a constant width.

get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.

pysis.binning.geometric module

class pysis.binning.geometric.GeometricBinnedKeys(min_value, max_value)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct for creating geometrically binned data.

C = 2.8853900817779268
get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.

Module contents

Utilities to help with various binning methods.

class pysis.binning.ConstWidthBinnedKeys(min_value, max_value, num_bins=None, max_bin_size=None)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct where bins are of a constant width.

get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.
class pysis.binning.BoundedBinnedKeys(bounds)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct where bins are defined by a list of their bounds.

get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.
class pysis.binning.GeometricBinnedKeys(min_value, max_value)[source]

Bases: pysis.binning.abstract.AbstractBinnedKeys

A Binned Keys construct for creating geometrically binned data.

C = 2.8853900817779268
get_bin_index(value)[source]

Used to get the index of the bin to place a particular value.

get_bounds(bin_num)[source]

Get the bonds of a bin, given its index bin_num.

Returns:a Bounds namedtuple with properties min and max respectively.