Cheatsheet#

As a convenience, all modifiers, utility functions and overridables that are useful within *.solconf files are gathered inside module soleil.solconf and linked in the tables below.

Modifiers#

Modifers for class and module members

soleil.resolvers.modifiers.hidden

The member should not be passed as an argument to type

soleil.resolvers.modifiers.visible

The member should be passed as a type arg

soleil.resolvers.modifiers.name(value)

Change the name of the member when passed as a type arg

soleil.resolvers.modifiers.cast(value)

Used to format the value after pre-processing but before resolution

soleil.resolvers.modifiers.noid

Indicates that the specified member should not be used by soleil.utils.id_str()

soleil.resolvers.class_resolver.as_type

Annotates a variable containing a class or callable (or the fully qualified name of one) that will be used to instantiate the meta object.

soleil.resolvers.class_resolver.as_args

The member is a list or tuple containing variable un-named args to pass to the as_type member.

Modifers for module members

soleil.resolvers.module_resolver.as_run

Indicates that the annotated member is a callable that solex() will run on the module

soleil.resolvers.module_resolver.promoted

When a module's member is annotated as promoted it will be returned when that module is loaded without resolving.

soleil.resolvers.module_resolver.resolves

When a module's member is annotated as resolves, the module will resolve to the resolution of that member.

Utility functions#

soleil.utils.id_str([glue, safe, full, ...])

A special class that resolves to an id string built from the overrides that are not annotated with noid.

soleil.utils.root()

Returns the path to the root config

soleil.utils.root_stem([root_config])

Returns the stem of the filename name of the root configuration.

soleil.utils.sub_dir(root[, create])

Returns a sub-directory with a sequential number

soleil.utils.derive(*parents, **new_vars)

Derives the specified class, overloading the supplied indicated members. Example::.

soleil.utils.temp_dir([suffix, prefix, dir])

User-callable function to create and return a unique temporary directory.

soleil.utils.spawn(rel_module_name[, ...])

Takes the name of a target module that promotes a class, and loads it in a new package (the spawned package), by default providing the calling package's overrides as possible overrides in the spawned package.

soleil.utils.package_overrides([as_source])

Returns a list of all supplied package overrides.

soleil.rcall.rcall(fxn, *args, **kwargs)

Supports calling resolvables with resolvable parameters

soleil.special.resolved.resolved(resolvable)

Returns an object that will resolve to the resolution of the input resolvable but that can be accessed (i.e., attributes and subscripts accessed) as if the object were already resolved.

Overridables#

soleil.overrides.overridable.submodule(*args)

Loads, from a sub-package, a submodule with an overridable name.

soleil.overrides.overridable.choices(values, ...)

Choice supporting convenient string-based CLI override

soleil.overrides.req.req()

Required but unset members can be initialized with an instance of this class.