Length

class ase2sprkkr.common.generated_configuration_definitions.Length(*of, default_values=<object object>)[source]

Sometimes, the length of some array should appear in the config file

Class hierarchy

Inheritance diagram of ase2sprkkr.common.generated_configuration_definitions.Length


Constructor

__init__(*of, default_values=<object object>)[source]
is_generated = True
is_validated = True
is_stored = True
type

alias of int

_NO_DEFAULT = <object object>
validators = (<function _validate_length>,)
modify_definition(what)[source]
copy(**kwargs)[source]

Copy this modifier while preserving length metadata overrides.

Parameters:

kwargs (Any)

Return type:

ase2sprkkr.common.generated_configuration_definitions.Length

stage_generated(option, transaction, value, key=<object object>)[source]

Resize source arrays to value within transaction.

key is accepted for the generated-value protocol but length assignment always applies to whole values.

Parameters:
Return type:

None

getter(container, key=None)[source]

Return the length of the first source value in container.

Parameters:
  • container (Any)

  • key (Any)

Return type:

int | None

validate_parsed(option)[source]

Check whether option was present as required by parse conditions.

Parameters:

option (ase2sprkkr.common.options.Option)

Return type:

None

_create_grammar(allow_dangerous, *, allow_incomplete=False)[source]

Add check for the length