ProfilesConfigurationContainer

class ase2sprkkr.profiles.ProfilesConfigurationContainer(definition, container=None)[source]

Dict-like repeated section with persistent and virtual profile views.

Class hierarchy

Inheritance diagram of ase2sprkkr.profiles.ProfilesConfigurationContainer


Constructor

__init__(definition, container=None)

Create the container and its members, according to the definition

class RemovalChange(profiles)[source]

Rollback state for removing one stored profile.

commit()[source]
rollback()[source]
reserved_names = frozenset({'ase', 'default', 'legacy'})
legacy_fields = ('mpi', 'mpi_warning', 'executable_dir', 'executable_suffix')
_add(id=None)[source]

Create one stored profile while keeping ase strictly virtual.

_legacy_profile(create=False)[source]

Return the mutable backing profile used by deprecated options.

_legacy_available()[source]
Return type:

bool

legacy_value(name, default=None)[source]

Return a value from the internal legacy profile.

_warn_legacy_write()[source]
_set_legacy_value(name, value)[source]

Stage a deprecated option into the internal legacy profile.

static _ase_config()[source]
static _parse_ase_value(section, name, option, value)[source]

Parse one ASE INI value using the common profile type contract.

_parse_ase_profile(cfg)[source]

Parse ASE’s text configuration through the common profile schema.

_ase_available()[source]
Return type:

bool

classmethod _reserved_in(values)[source]
stage(transaction, values=None, value=None, *, unknown='find', merge=False, **kwargs)[source]

Stage public profile changes without exposing reserved profiles.

_stage_persisted(transaction, values=None, value=None, *, unknown='find', merge=False, **kwargs)[source]

Stage profiles read from persisted ASE2SPRKKR configuration.

add(id=None)[source]
remove(name)[source]

Transactionally remove one mutable named profile.

property ase

ASE-owned profile, editable via the ASE configuration file.

property default

Selected profile; a virtual alias, not a stored configuration.

_virtual_names()[source]
Return type:

collections.abc.Iterator[str]

items()[source]

Iterate over public profile views only.

values()[source]

Iterate over public profile views only.

_as_dict(get)[source]

Serialize stored profiles while preserving empty named profiles.

available_items()[source]

Backward-compatible alias for public profile items.

_get_members(name, unknown, is_option, lower_case, *, accept)[source]
resolve_name(name=None)[source]

Resolve a profile name according to configuration precedence.

The reserved name “default” always means the currently selected profile, never a persistent profile called “default”.

default_write_target()[source]

Resolve a write to the default profile without redundant state.

An explicitly selected named profile remains the write target. Otherwise ASE’s [sprkkr] settings are the natural user default. A write to a missing ASE profile creates that section in the authoritative ASE config.ini, rather than a parallel YAML copy.

save_ase_changes(*, system=False)[source]

Write staged ASE changes, leaving the staging intact on failure.

This is the single persistence boundary for ASE-owned profiles, shared by explicit profile saving, CLI writes, and the root Configuration.save_user_preferences() method.

resolve(name=None)[source]

Return the resolved profile object, or None for auto fallback.

_abc_impl = <_abc._abc_data object>