idmtools.utils.language module¶
Tools to format different outputs for human consumption.
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
- idmtools.utils.language.on_off(test) str ¶
Print on or off depending on boolean state of test.
- Parameters:
test – Boolean/object to check state
- Returns:
On or off
- idmtools.utils.language.pluralize(word, plural_suffix='s')¶
Convert work to plural form.
- Parameters:
word – Word
plural_suffix – plural suffix. Default to s
- Returns:
Pluralized string
- idmtools.utils.language.verbose_timedelta(delta)¶
The verbose_timedelta provides ms accurate, human readable of a time delta.
- Parameters:
delta –
- Returns:
Time delta
- idmtools.utils.language.get_qualified_class_name(cls: Type) str ¶
Return the full class name for an object.
- Parameters:
cls – Class object to get name
- Returns:
Fully qualified class name
- idmtools.utils.language.get_qualified_class_name_from_obj(obj: object) str ¶
Return the full class name from object.
- Parameters:
obj – Object
Example
` a = Platform('COMPS') class_name = get_qualified_class_name(a) print(class_name) 'idmtools_platform_comps.comps_platform.COMPSPlatform' `
- Returns:
Full module path to class of object