# Buggy code
def decode_compu_method(compu_method, ea, float_factory):
    # type: (_Element, _DocRoot, str, _FloatFactory) -> typing.Tuple
    values = {}
    factor = float_factory(1.0)
    offset = float_factory(0)
    unit = ea.follow_ref(compu_method, "UNIT-REF")
    const = None
    compu_scales = ea.find_children_by_path(
        compu_method, "COMPU-INTERNAL-TO-PHYS/COMPU-SCALES/COMPU-SCALE"
    )
    for compu_scale in compu_scales:
        ll = ea.get_child(compu_scale, "LOWER-LIMIT")
        ul = ea.get_child(compu_scale, "UPPER-LIMIT")
        sl = ea.get_child(compu_scale, "SHORT-LABEL")
        if sl is None:
            desc = ea.get_element_desc(compu_scale)
        else:
            desc = sl.text
        #####################################################################################################
        # Modification to support sourcing the COMPU_METHOD info from the Vector NETWORK-REPRESENTATION-PROPS
        # keyword definition. 06Jun16
        #####################################################################################################

        if (
            ll is not None
            and desc is not None
            and canmatrix.utils.decode_number(ul.text)
            == canmatrix.utils.decode_number(ll.text)
        ):
            #####################################################################################################
            #####################################################################################################
            values[ll.text] = desc

        scale_desc = ea.get_element_desc(compu_scale)
        rational = ea.get_child(compu_scale, "COMPU-RATIONAL-COEFFS")
        if rational is not None:
            numerator_parent = ea.get_child(rational, "COMPU-NUMERATOR")
            numerator = ea.get_children(numerator_parent, "V")
            denominator_parent = ea.get_child(rational, "COMPU-DENOMINATOR")
            denominator = ea.get_children(denominator_parent, "V")
            try:
                factor = float_factory(numerator[1].text) / float_factory(
                    denominator[0].text
                )
                offset = float_factory(numerator[0].text) / float_factory(
                    denominator[0].text
                )
            except decimal.DivisionByZero:
                if (
                    numerator[0].text != denominator[0].text
                    or numerator[1].text != denominator[1].text
                ):
                    logger.warning(
                        "ARXML signal scaling: polynom is not supported and it is replaced by factor=1 and offset =0."
                    )
                factor = float_factory(1)
                offset = float_factory(0)
        else:
            const = ea.get_child(compu_scale, "COMPU-CONST")
            # add value
            if const is None:
                logger.warning(
                    "Unknown Compu-Method: at sourceline %d ", compu_method.sourceline
                )
    return values, factor, offset, unit, const


# Traceback (ValueError)
Traceback (most recent call last):
File "/home/nostar/.local/bin/canconvert", line 11, in <module>
load_entry_point('canmatrix==0.9.1', 'console_scripts', 'canconvert')()
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/cli/convert.py", line 131, in cli_convert
canmatrix.convert.convert(infile, outfile, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/convert.py", line 40, in convert
dbs = canmatrix.formats.loadp(infile, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/__init__.py", line 77, in loadp
return load(fileObject, import_type, key, **options)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/__init__.py", line 94, in load
dbs = module_instance.load(file_object, **options)  # type: ignore
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1723, in load
frame = get_frame(frameTrig, search_point, multiplex_translation, ns, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1419, in get_frame
get_signals(pdu_sig_mapping, new_frame, root_or_cache, ns, None, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 1098, in get_signals
(values, factor, offset, unit_elem, const) = decode_compu_method(compu_method, root_or_cache, ns, float_factory)
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/formats/arxml.py", line 921, in decode_compu_method
if ll is not None and desc is not None and canmatrix.utils.decode_number(ul.text) == canmatrix.utils.decode_number(ll.text):
File "/home/nostar/.local/lib/python3.8/site-packages/canmatrix/utils.py", line 106, in decode_number
return int(value, base)
ValueError: invalid literal for int() with base 10: '1023.0'

# Fixed code
def decode_compu_method(compu_method, ea, float_factory):
    # type: (_Element, _DocRoot, str, _FloatFactory) -> typing.Tuple
    values = {}
    factor = float_factory(1.0)
    offset = float_factory(0)
    unit = ea.follow_ref(compu_method, "UNIT-REF")
    const = None
    compu_scales = ea.find_children_by_path(
        compu_method, "COMPU-INTERNAL-TO-PHYS/COMPU-SCALES/COMPU-SCALE"
    )
    for compu_scale in compu_scales:
        ll = ea.get_child(compu_scale, "LOWER-LIMIT")
        ul = ea.get_child(compu_scale, "UPPER-LIMIT")
        sl = ea.get_child(compu_scale, "SHORT-LABEL")
        if sl is None:
            desc = ea.get_element_desc(compu_scale)
        else:
            desc = sl.text
        #####################################################################################################
        # Modification to support sourcing the COMPU_METHOD info from the Vector NETWORK-REPRESENTATION-PROPS
        # keyword definition. 06Jun16
        #####################################################################################################

        if (
            ll is not None
            and desc is not None
            and canmatrix.utils.decode_number(ul.text, float_factory)
            == canmatrix.utils.decode_number(ll.text, float_factory)
        ):
            #####################################################################################################
            #####################################################################################################
            values[ll.text] = desc

        scale_desc = ea.get_element_desc(compu_scale)
        rational = ea.get_child(compu_scale, "COMPU-RATIONAL-COEFFS")
        if rational is not None:
            numerator_parent = ea.get_child(rational, "COMPU-NUMERATOR")
            numerator = ea.get_children(numerator_parent, "V")
            denominator_parent = ea.get_child(rational, "COMPU-DENOMINATOR")
            denominator = ea.get_children(denominator_parent, "V")
            try:
                factor = float_factory(numerator[1].text) / float_factory(
                    denominator[0].text
                )
                offset = float_factory(numerator[0].text) / float_factory(
                    denominator[0].text
                )
            except decimal.DivisionByZero:
                if (
                    numerator[0].text != denominator[0].text
                    or numerator[1].text != denominator[1].text
                ):
                    logger.warning(
                        "ARXML signal scaling: polynom is not supported and it is replaced by factor=1 and offset =0."
                    )
                factor = float_factory(1)
                offset = float_factory(0)
        else:
            const = ea.get_child(compu_scale, "COMPU-CONST")
            # add value
            if const is None:
                logger.warning(
                    "Unknown Compu-Method: at sourceline %d ", compu_method.sourceline
                )
    return values, factor, offset, unit, const