hpcflow.sdk.core.utils.check_valid_py_identifier#

hpcflow.sdk.core.utils.check_valid_py_identifier(name)#

Check a string is (roughly) a valid Python variable identifier and return it.

The rules are:
  1. name must not be empty

  2. name must not be a Python keyword

  3. name must begin with an alphabetic character, and all remaining characters must be alphanumeric.

Notes

The following attributes are passed through this function on object initialisation:
  • ElementGroup.name

  • Executable.label

  • Parameter.typ

  • TaskObjective.name

  • TaskSchema.method

  • TaskSchema.implementation

  • Loop.name

Parameters:

name (str) –

Return type:

str