openest.generate.functions module

class openest.generate.functions.AuxillaryResult(subcalc_main, subcalc_aux, auxname)[source]

Bases: openest.generate.calculation.Calculation

Produce an additional output, but then pass the main result on.

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.

class openest.generate.functions.AuxillaryResultApplication(region, subapp_main, subapp_aux)[source]

Bases: openest.generate.calculation.Application

Perform both main and auxillary calculation, and order as main[0], aux, main[1:]

done()[source]
push(ds)[source]

Returns an interator of (yyyy, value, …).

class openest.generate.functions.ConstantScale(subcalc, coeff)[source]

Bases: openest.generate.calculation.Calculation

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.

class openest.generate.functions.Exponentiate(subcalc)[source]

Bases: openest.generate.calculation.Calculation

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.

class openest.generate.functions.InstaZScore(subcalc, lastyear, units='z-score')[source]

Bases: openest.generate.calculation.CustomFunctionalCalculation

Collects up to baseyear of values and then uses them to represent all values as a z-score.

column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
init_apply()[source]
pushhandler(ds, lastyear)[source]

Returns an interator of (yyyy, value, …).

class openest.generate.functions.Instabase(subcalc, baseyear, func=<function <lambda>>, units='portion', skip_on_missing=True)[source]

Bases: openest.generate.calculation.CustomFunctionalCalculation

Re-base the results of make_generator(…) to the values in baseyear baseyear is the year to use as the ‘denominator’; None for the first year Default func constructs a porportional change; x - y makes simple difference. skip_on_missing: If we never encounter the year and this is false,

still print out the existing results.

Tacks on the value to the front of the results

column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
donehandler(baseyear, func, skip_on_missing)[source]
format_handler(equation, lang, baseyear, func, skip_on_missing)[source]
init_apply()[source]
pushhandler(ds, baseyear, func, skip_on_missing)[source]

Returns an interator of (yyyy, value, …).

class openest.generate.functions.Positive(subcalc)[source]

Bases: openest.generate.calculation.Calculation

Return 0 if subcalc is less than 0

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
class openest.generate.functions.Scale(subcalc, scale_dict, from_units, to_units, func=<function <lambda>>, latexpair=('\bar{I}', 'Region-specific scaling'))[source]

Bases: openest.generate.calculation.Calculation

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.

class openest.generate.functions.SpanInstabase(subcalc, year1, year2, func=<function <lambda>>, units='portion', skip_on_missing=True)[source]

Bases: openest.generate.functions.Instabase

Re-base the results of a calculation to the average of values between two years. Default func constructs a porportional change; x - y makes simple difference. skip_on_missing: If we never encounter the year and this is false,

still print out the existing results.
static describe()[source]
format_handler(equation, lang, baseyear, func, skip_on_missing)[source]
init_apply()[source]
pushhandler(ds, baseyear, func, skip_on_missing)[source]

Returns an interator of (yyyy, value, …).

class openest.generate.functions.Sum(subcalcs)[source]

Bases: openest.generate.calculation.Calculation

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
enable_deltamethod()[source]

When applied, yield will contain arrays of coefficient multiplicands as a vector the length of the CSVV coefficients.

format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.

class openest.generate.functions.Transform(subcalc, from_units, to_units, func, description, long_description)[source]

Bases: openest.generate.calculation.Calculation

apply(region, *args, **kwargs)[source]
column_info()[source]

Returns an array of dictionaries, with ‘name’, ‘title’, and ‘description’.

static describe()[source]
format(lang, *args, **kwargs)[source]

Returns a dictionary of FormatElements. Only keys in the tree of dependencies will be output.