nuctransportdb.generate_id

Attributes

yaml

Functions

ntd_namespace()

Generate the NTD namespace UUID.

get_list_from_sequence(value)

Helper function to convert a string or None to a list.

normalize_str(val)

Normalize function for splitting and sorting strings.

flatten_entry_dict(property_entry, nuclide_name)

Flatten the entry dictionary.

get_entry_str(property_entry, nuclide_name)

Function for combining all entry fields into a single string.

generate_property_id(→ None)

Check for missing ID and generate a unique ID for each data in the YAML file.

generate_id_for_all(→ None)

Generate IDs for all YAML files in the property directory.

Module Contents

nuctransportdb.generate_id.yaml[source]
nuctransportdb.generate_id.ntd_namespace()[source]

Generate the NTD namespace UUID.

Returns:

The NTD namespace UUID.

Return type:

uuid.UUID

nuctransportdb.generate_id.get_list_from_sequence(value)[source]

Helper function to convert a string or None to a list.

Parameters:

value (str, None, list) – the input value to convert.

Raises:

ValueError – if the input value is not a string, None, or a list.

Returns:

the converted list.

Return type:

list

nuctransportdb.generate_id.normalize_str(val)[source]

Normalize function for splitting and sorting strings.

Parameters:

val (str) – The input string to normalize.

Returns:

The normalized string.

Return type:

str

nuctransportdb.generate_id.flatten_entry_dict(property_entry, nuclide_name)[source]

Flatten the entry dictionary.

Parameters:
  • property_entry (dict) – The property dictionary.

  • nuclide_name (str) – Nuclide name.

Returns:

The flattened entry dictionary.

Return type:

dict

nuctransportdb.generate_id.get_entry_str(property_entry, nuclide_name)[source]

Function for combining all entry fields into a single string.

Parameters:
  • property_entry (dict) – The property dictionary.

  • nuclide_name (str) – Nuclide name.

Returns:

The combined entry string.

Return type:

str

nuctransportdb.generate_id.generate_property_id(yaml_file_path) None[source]

Check for missing ID and generate a unique ID for each data in the YAML file.

Parameters:

yaml_file_path (str) – The path to the YAML file.

nuctransportdb.generate_id.generate_id_for_all(property_dir) None[source]

Generate IDs for all YAML files in the property directory.

Parameters:

property_dir (str) – The path to the property directory.