idmtools.plugins.item_sequence module

Defines a id generator plugin that generates ids in sequence by item type. To configure, set ‘id_generator’ in .ini configuration file to ‘item_sequence’: [COMMON] id_generator = item_sequence

You can also customize the sequence_file that stores the sequential ids per item type as well as the id format using the following parameters in the .ini configuration file: [item_sequence] sequence_file = <file_name>.json ex: index.json id_format_str = <custom_str_format> ex: {item_name}{data[item_name]:06d}

Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.

idmtools.plugins.item_sequence.load_existing_sequence_data(sequence_file)[source]

Loads item sequence data from sequence_file into a dictionary.

Parameters:

sequence_file – File that user has indicated to store the sequential ids of items

Returns:

Data loaded from sequence_file as a dictionary

idmtools.plugins.item_sequence.get_plugin_config()[source]

Retrieves the sequence file and format string (for id generation) from the .ini config file.

Returns:

specified json file in .ini config in which id generator keeps track of sequential id’s id_format_str: string specified in .ini config by which id’s are formatted when assigned to sequential items

Return type:

sequence_file

idmtools.plugins.item_sequence.idmtools_generate_id(item: IEntity) str[source]

Generates a UUID.

Parameters:

item – IEntity using the item_sequence plugin

Returns:

ID for the respective item, based on the formatting defined in the id_format_str (in .ini config file)

idmtools.plugins.item_sequence.idmtools_platform_post_run(item: IEntity, kwargs) IEntity[source]

Do a backup of sequence file if it is the id generator.

Parameters:
  • item – Item(we only save on experiments/suites at the moment)

  • kwargs – extra args

Returns:

None