On this page

SettingsValue

gammaloop Class

SettingsValue()

Read-only, detached view over serialized GammaLoop settings.

Member details

path

Property · read-only
#
path: str

Dot-separated location of this value within the settings tree.

kind

Property · read-only
#
kind: str

JSON value kind: object, array, string, number, boolean, or null.

is_object

Method
#
is_object() -> bool

Return whether this value is an object with named children.

is_array

Method
#
is_array() -> bool

Return whether this value is an array with indexed children.

is_scalar

Method
#
is_scalar() -> bool

Return whether this value is a scalar JSON value, including null.

keys

Method
#
keys() -> list[str]

Return this object's child keys in lexical order.

Raises

TypeError

If this value is not an object.

get

Method
#
get(path: str) -> Any

Resolve a dot-separated descendant path.

An empty path returns this value. Objects become SettingsValue views, while scalar values become their ordinary Python equivalents.

Raises

KeyError

If the path does not exist below this value.

Parameters

NameTypeDefaultDescription
pathstr

Relative path such as "sampling.parameterization".

to_dict

Method
#
to_dict() -> Any

Convert the complete detached value tree to ordinary Python containers and scalars.

__getattr__

Method
#
__getattr__(name: str) -> Any

Resolve an object child by attribute name.

Parameters

NameTypeDefaultDescription
namestr

Immediate child key to resolve.

__dir__

Method
#
__dir__() -> list[str]

Return object-child names in lexical order, or an empty list for other kinds.

__len__

Method
#
__len__() -> int

Return the number of object or array children.

__str__

Method
#
__str__() -> str

Return the detached settings value as pretty-printed JSON.

__repr__

Method
#
__repr__() -> str

Return a compact representation containing this value's path and kind.

__getitem__

Method
#
__getitem__(key: Any, /) -> Any

Resolve a relative string path or array index.

Parameters

NameTypeDefaultDescription
keyAny

Descendant path for an object, or zero-based index for an array.