Shortcuts

ride.utils.utils

Module Contents

Functions

is_shape(x)

Tests whether x is a shape, i.e. one of

once(fn)

rsetattr(obj, attr, val)

rgetattr(obj, attr, *args)

attributedict(...)

If given a dict, it is converted it to an argparse.AttributeDict. Otherwise, no change is made

to_dict(d)

merge_dicts(*args)

merge_attributedicts(*args)

some(self, attr)

some_callable(self, attr[, min_num_args, max_num_args])

get(self, attr)

differ_and_exist(a, b)

missing(→ Set[str])

missing_or_not_in_other(→ Set[str])

name(thing)

prefix_keys(→ Dict)

camel_to_snake(→ str)

Convert from camel-case to snake-case

temporary_parameter(obj, attr, val)

flatten_dict(d[, parent_key, sep])

Attributes

DictLike

ride.utils.utils.DictLike[source]
ride.utils.utils.is_shape(x: Any)[source]

Tests whether x is a shape, i.e. one of - int - List[int] - Tuple[int] - Namedtuple[int]

Parameters:

x (Any) – instance to check

ride.utils.utils.once(fn: Callable)[source]
ride.utils.utils.rsetattr(obj, attr, val)[source]
ride.utils.utils.rgetattr(obj, attr, *args)[source]
ride.utils.utils.attributedict(dict_like: DictLike) pytorch_lightning.utilities.parsing.AttributeDict[source]

If given a dict, it is converted it to an argparse.AttributeDict. Otherwise, no change is made

ride.utils.utils.to_dict(d)[source]
ride.utils.utils.merge_dicts(*args)[source]
ride.utils.utils.merge_attributedicts(*args)[source]
ride.utils.utils.some(self, attr: str)[source]
ride.utils.utils.some_callable(self, attr: str, min_num_args=0, max_num_args=math.inf)[source]
ride.utils.utils.get(self, attr: str)[source]
ride.utils.utils.differ_and_exist(a, b)[source]
ride.utils.utils.missing(self, attrs: Collection[str]) Set[str][source]
ride.utils.utils.missing_or_not_in_other(first, other, attrs: Collection[str], must_be_callable=False) Set[str][source]
ride.utils.utils.name(thing)[source]
ride.utils.utils.prefix_keys(prefix: str, dictionary: Dict) Dict[source]
ride.utils.utils.camel_to_snake(s: str) str[source]

Convert from camel-case to snake-case Source: https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case

ride.utils.utils.temporary_parameter(obj, attr, val)[source]
ride.utils.utils.flatten_dict(d, parent_key='', sep='_')[source]
Read the Docs v: stable
Versions
latest
stable
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.