Parameter functionality#

ParamDict1D#

Custom subclass of dict to define parameters with 1-dim scalar keys.

Constructor#

ParamDict1D([mapping, key_name, value_name])

Custom subclass of dict to define parameters with 1-dim scalar keys.

Attributes#

ParamDict1D.key_name

Name to refer to 1-dim scalar keys.

ParamDict1D.value_name

Name to refer to Dict values.

Numerical operations#

ParamDict1D.sum()

Calculate the sum of parameter values.

ParamDict1D.mean()

Calculate the mean of parameter values.

ParamDict1D.median()

Calculate the median of parameter values.

ParamDict1D.median_high()

Calculate the high median of parameter values.

ParamDict1D.median_low()

Calculate the low median of parameter values.

Mapping operations#

ParamDict1D.clear()

Remove all items from the ParamDict.

ParamDict1D.get(key[, default])

Get the parameter value for the specified key, or the default if not found.

ParamDict1D.lookup(key)

Get the parameter value for the specified key, or zero if it is not found.

ParamDict1D.pop(key[, default])

Remove the specified key and return it's parameter value, or the default if not found.

ParamDict1D.popitem()

Remove and return the last inserted key and parameter value pair from the ParamDict.

ParamDict1D.setdefault(key, default, /)

Get the parameter value for the specified key, or the default if not found.

Views#

  • ParamDict1D.items()

  • ParamDict1D.keys()

  • ParamDict1D.values()

ParamDictND#

Custom subclass of dict to define parameters with N-dim tuple keys.

Constructor#

ParamDictND([mapping, key_names, value_name])

Custom subclass of dict to define parameters with N-dim tuple keys.

Attributes#

ParamDictND.key_names

Names to refer to each dimension of N-dim tuple keys.

ParamDictND.value_name

Name to refer to Dict values.

Numerical operations#

ParamDictND.sum(*pattern)

Calculate the sum of all parameter values or a subset based on wildcard pattern.

ParamDictND.mean(*pattern)

Calculate the mean of all parameter values or a subset based on wildcard pattern.

ParamDictND.median(*pattern)

Calculate the median of all parameter values or a subset based on wildcard pattern.

ParamDictND.median_high(*pattern)

Calculate the high median of all parameter values or a subset based on wildcard pattern.

ParamDictND.median_low(*pattern)

Calculate the low median of all parameter values or a subset based on wildcard pattern.

Mapping operations#

ParamDictND.clear()

Remove all items from the ParamDict.

ParamDictND.get(key[, default])

Get the parameter value for the specified key, or the default if not found.

ParamDictND.lookup(*key)

Get the parameter value for the specified key, or zero if it is not found.

ParamDictND.pop(key[, default])

Remove the specified key and return it's parameter value, or the default if not found.

ParamDictND.popitem()

Remove and return the last inserted key and parameter value pair from the ParamDict.

ParamDictND.setdefault(key, default, /)

Get the parameter value for the specified key, or the default if not found.

Efficient subset selection#

VarDictND.subset_keys(*pattern)

Get a subset of the N-dim tuple keys of the Dict with a wildcard pattern.

VarDictND.subset_values(*pattern)

Get Dict values for all keys that match the wildcard pattern.

Views#

  • ParamDictND.items()

  • ParamDictND.keys()

  • ParamDictND.values()

Casting from pandas Series/DataFrame#

Methods to cast pandas Series/DataFrame into ParamDict1D/ParamDictND are provided through the custom .dex accessor.

Series.dex.to_paramdict()

Cast a Series into a ParamDict1D/ParamDictND.

DataFrame.dex.to_paramdict()

Cast a single-column DataFrame into a ParamDict1D/ParamDictND.