earthkit.data.core.config

Attributes

Classes

Functions

env_var_name(name)

forward(func)

new_config(s)

Context manager to create new config.

save_config(path, config)

Module Contents

earthkit.data.core.config.CONFIG
earthkit.data.core.config.CONFIG_AND_HELP
earthkit.data.core.config.CONFIG_DIR
earthkit.data.core.config.CONFIG_FILE_ENV_NAME = 'CONFIG_FILE'
earthkit.data.core.config.CONFIG_FILE_NAME = 'config.yaml'
class earthkit.data.core.config.Config(config_yaml, defaults, callbacks=[])
property auto_save_settings
property autosave
dump()
env()
get(name, default=NONE)

Get the value of a configuration option.

Parameters:
  • name (str) – The name of the configuration option.

  • default ([type]) – [description]. Defaults to NONE.

Returns:

[type]

Return type:

[description]

on_change(callback)
reset(name=None)

Reset config to default values.

Parameters:

name (str, optional) – The name of the config option to reset to default. If it does not have a default, it is removed. If None is passed, all config options are reset to their default values. Defaults to None.

save_as(path)
set(*args, **kwargs)

Set the value of a configuration option.

Parameters:
  • name (str) – The name of the configuration option.

  • value ([type]) – [description]

temporary(*args, config_yaml=None, **kwargs)
class earthkit.data.core.config.ConfigOption(default, description, getter=None, none_ok=False, kind=None, docs_default=None, validator=None)
default
description
docs_default
property docs_description
getter = None
kind
none_ok = False
save(name, value, f)
validate(name, value)
validator = None
earthkit.data.core.config.DEFAULTS
earthkit.data.core.config.ENV_PREFIX = 'EARTHKIT_DATA_'
class earthkit.data.core.config.IntervalValidator(interval)

Bases: Validator

check(value)
explain()
interval
static make(value)
class earthkit.data.core.config.ListValidator(values)

Bases: Validator

check(value)
explain()
static make(value)
values
earthkit.data.core.config.NONE
earthkit.data.core.config.OLD_CONFIG_FILE
class earthkit.data.core.config.Validator
abstractmethod check(value)
abstractmethod explain()
static make(value)
class earthkit.data.core.config.ValueValidator(value)

Bases: Validator

check(value)
explain()
static make(value)
value
earthkit.data.core.config.config_yaml = None
earthkit.data.core.config.env_var_name(name)
earthkit.data.core.config.forward(func)
earthkit.data.core.config.new_config(s)

Context manager to create new config.

earthkit.data.core.config.save = False
earthkit.data.core.config.save_config(path, config)