neuralqx.utils.misc.modifiers module

get_modifier_value(mod, max_terms)

Format an integer modifier as a zero-padded string with a consistent width.

The returned width is determined by the number of digits of max_terms. This ensures that all modifier strings produced with the same max_terms have the same length and can be concatenated safely into a single identifier.

Example

If max_terms == 120 (width 3), then mod == 7 becomes "007" and mod == 42 becomes "042".

Parameters:
  • mod (int) – Integer modifier to format.

  • max_terms (int) – Reference value that determines the output width via len(str(max_terms)).

Return type:

str

Returns:

Zero-padded string representation of mod.

get_modifier_string(*args, max_terms)

Build a concatenated modifier string from multiple integer modifiers.

Each modifier in args is formatted using get_modifier_value() so that all components have the same fixed width determined by max_terms (i.e. len(str(max_terms))). The final string is the concatenation of these fixed-width components.

Parameters:
  • args – One or more integer modifiers to include in the final string.

  • max_terms (int) – Reference value that determines the width of each modifier component.

Return type:

str

Returns:

Concatenated fixed-width modifier string.