def merge_value_range_fields(nmdc_objs: list, tx_attributes: list, **kwargs) -> list:
    """
    Takes each nmdc object (either a dict or class instance) and merges two
    attributues into a single attribute separated by a "-".
    Additionaly, the has_minuimum_numeric_value and has_maximum_numeric_value
    attrubutes are given values.
    The unit of the first attribute is preserved.
    The second attribute is removed.

    For example, if an object has the attributes "depth: 5.0, has_unit: meter"
    and "depth2: 10.0", the two attribute are merged into a single attribute
    with the form:

      depth: 5.0-10.0
      has_unit: meter
      has_minimum_numeric_value: 5.0
      has_maximum_numeric_value: 10.0

    Args:
        nmdc_objs (list): list of objects to be updated with has_numeric_value and/or has_unit values
        tx_attributes (list): list of two attributes whose values need to be merged

    Returns:
        list: updated nmdc_objs with has_minimum_numeric_value and has_maximum_numeric_value values
              in the first attribute; the second attriubte is removed

    """

    def has_range_fields(obj, field1, field2):
        # check that keys exist
        if isinstance(obj, dict):
            # check that keys have values
            if field1 in obj.keys() and field2 in obj.keys():
                # check if vals are None
                if obj[field1] is not None and obj[field2] is not None:
                    field_obj1 = obj[field1]
                    field_obj2 = obj[field2]
                    return (
                        field_obj1["has_raw_value"] is not None
                        and field_obj2["has_raw_value"]
                    )
            else:
                return False
        else:
            # check that properties exist
            if hasattr(obj, field1) and hasattr(obj, field2):
                # get objects from fields and check if vals are None
                field_obj1 = getattr(obj, field1)
                field_obj2 = getattr(obj, field2)
                return (
                    getattr(field_obj1, "has_raw_value") is not None
                    and getattr(field_obj2, "has_raw_value") is not None
                )
            else:
                return False

    def get_obj_field_values(obj, field1, field2):
        if isinstance(obj, dict):
            return obj[field1], obj[field2]
        else:
            field_obj1 = getattr(obj, field1)
            field_obj2 = getattr(obj, field2)
            return getattr(field_obj1, "has_raw_value"), getattr(
                field_obj2, "has_raw_value"
            )

    def format_val(val: str):
        # if val is negative, put it in parens
        return f"({val})" if val[0] == "-" else val

    def add_min_max(obj, field, val1, val2):
        # merge vals
        merge_val = f"{format_val(val1)}-{format_val(val2)}"

        if isinstance(obj, dict):
            pass
        else:
            # set value range and min/max numeric values
            field_obj = getattr(obj, field)
            setattr(field_obj, "has_raw_value", merge_val)  # e.g., {va1}-{val2}
            setattr(field_obj, "has_minimum_numeric_value", float(val1))
            setattr(field_obj, "has_maximum_numeric_value", float(val2))

            # remove simple number value
            if hasattr(field_obj, "has_numeric_value"):
                delattr(field_obj, "has_numeric_value")

        return obj

    print(f"*** executing merge_value_range_fields for attributes {tx_attributes}")

    if len(tx_attributes) != 2:
        raise Exception("This function only accepts two arguments.")

    # get fields to be merged
    field1 = tx_attributes[0]
    field2 = tx_attributes[1]

    for obj in nmdc_objs:
        # test if fields exist
        if has_range_fields(obj, field1, field2):
            # get values from fields and merge
            val1, val2 = get_obj_field_values(obj, field1, field2)

            # modify obj's field1 to hold min/max ranges
            obj = add_min_max(obj, field1, val1, val2)

            # remove field2, no long needed
            if isinstance(obj, dict):
                obj.pop(field2, None)
            else:
                delattr(obj, field2)

    return nmdc_objs