DataType

class ramose.DataType[source]

Bases: object

This class implements all the possible data types that can be used within the configuration file of RAMOSE. In particular, it provides methods for converting a string into the related Python data type representation.

get_func(name_str)[source]

This method returns the method for handling a given data type expressed as a string name.

static duration(s)[source]

This method returns the data type for durations according to the XML Schema Recommendation (https://www.w3.org/TR/xmlschema11-2/#duration) from the input string. In case the input string is None or it is empty, an high duration value (i.e. 2000 years) is returned.

static datetime(s)[source]

This method returns the data type for datetime according to the ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) from the input string. In case the input string is None or it is empty, a low date value (i.e. 0001-01-01) is returned.

static str(s)[source]

This method returns the data type for strings. In case the input string is None, an empty string is returned.

static int(s)[source]

This method returns the data type for integer numbers from the input string. In case the input string is None or it is empty, a low integer value is returned.

static float(s)[source]

This method returns the data type for float numbers from the input string. In case the input string is None or it is empty, a low float value is returned.