iucm.utils module¶
General utilities for the iucm package
Functions
append_doc(namedtuple_cls, doc) |
Append a documentation to a namedtuple |
str_ranges(s) |
Convert a string of comma separated values to an iterable |
-
iucm.utils.append_doc(namedtuple_cls, doc)[source]¶ Append a documentation to a namedtuple
Parameters: - namedtuple_cls (type) – The type that has been created with
collections.namedtuple() - doc (str) – The documentation docstring
- namedtuple_cls (type) – The type that has been created with
-
iucm.utils.str_ranges(s)[source]¶ Convert a string of comma separated values to an iterable
Parameters: s (str) – A semicolon ( ';') separated string. A single value in this string represents one number, ranges can also be used via a separation by comma (','). Hence,'2009;2012,2015'will be converted to[2009,2012, 2013, 2014]and2009;2012,2015,2to[2009, 2012, 2015]Returns: The values in s converted to a list Return type: list