bucky.config#

Global configuration handler for Bucky, also include prior parameters

Module Contents#

Classes#

BuckyConfig

Bucky configuration.

YamlPath

Class to wrap path-like objects fromt he yaml files.

Functions#

locate_base_config()

Locate the base_config package that shipped with bucky (it's likely in site-packages).

locate_current_config()

Find the config file/directory to use.

Attributes#

base_cfg

cfg

def load_base_cfg(path):

file

yaml

bucky.config.base_cfg[source]#
bucky.config.cfg[source]#
def load_base_cfg(path):

base_cfg.load_cfg(path)

def roll_cfg_distributions():

cfg = base_cfg.sample_distributions()

bucky.config.file = par2/#
bucky.config.yaml[source]#
class bucky.config.BuckyConfig(dict_of_dicts=None, seperator='.', ordered=True)[source]#

Bases: bucky.util.nested_dict.NestedDict

Bucky configuration.

_cast_floats(self, copy=False)[source]#

Cast all yaml float objects to python floats.

_load_one_cfg(self, par_path)[source]#

Read in the YAML cfg file(s).

_set_default_variances(self, copy=False)[source]#

Set gaussian variance to the default for params that don’t do so explictly.

_to_arrays(self, copy=False)[source]#

Cast all terminal sub-lists into xp.arrays.

_to_lists(self, copy=False)[source]#

Cast all terminal sub-arrays into lists.

interp_age_bins(self)[source]#

Interpolate any age stratified params to the model specified age bins.

load_cfg(self, par_path)[source]#

Load the bucky config from disk.

promote_sampled_values(self)[source]#

Promote sampled distributions up in the hierarchy so they are more easily referenced.

sample_distributions(self)[source]#

Draw a sample from each distributional parameter and drop it inline (in a returned copy of self)

to_yaml(self, *args, **kwargs)[source]#

Dump the object to yaml.

class bucky.config.YamlPath[source]#

Bases: pathlib.PosixPath

Class to wrap path-like objects fromt he yaml files.

yaml_tag = !path#
classmethod from_yaml(cls, constructor, node)[source]#

from_yaml.

classmethod to_yaml(cls, representer, node)[source]#

to_yaml.

bucky.config.locate_base_config()[source]#

Locate the base_config package that shipped with bucky (it’s likely in site-packages).

bucky.config.locate_current_config()[source]#

Find the config file/directory to use.