schema_header_util

Functions

validate_attributes(attrib_dict, name)

Validate attributes in the dictionary.

validate_library_name(library_name)

Check the validity of the library name.

validate_present_attributes(attrib_dict, name)

Validate combinations of attributes

validate_version_string(version_string)

Check validity of the version.

validate_attributes(attrib_dict, name)[source]

Validate attributes in the dictionary.

Parameters:
  • attrib_dict (dict) – Dictionary of attributes to be evaluated.

  • name (str) – name to use in reporting errors.

Returns:

List of issues. Each issue is a dictionary.

Return type:

list

Raises:

HedFileError

  • Invalid library name

  • Version not present

  • Invalid combinations of attributes in header

validate_library_name(library_name)[source]

Check the validity of the library name.

Parameters:

library_name (str) – Name of the library.

Returns:

If not False, string indicates the issue.

Return type:

bool or str

validate_present_attributes(attrib_dict, name)[source]

Validate combinations of attributes

Parameters:
  • attrib_dict (dict) – Dictionary of attributes to be evaluated.

  • name (str) – File name to use in reporting errors.

Returns:

List of issues. Each issue is a dictionary.

Return type:

list

Raises:

HedFileError

  • withStandard is found in th header, but a library attribute is not specified

validate_version_string(version_string)[source]

Check validity of the version.

Parameters:

version_string (str) – A version string.

Returns:

If not False, string indicates the issue.

Return type:

bool or str