'Compute the duration ratio of the note as a Python Fraction.
Examples:
- Whole Note = 1
- Quarter Note = 1/4
- Dotted Quarter Note = 3/8
- Triplet eighth note = 1/12
Returns:
The duration ratio as a Python Fraction.'

def duration_ratio(self):

    duration_ratio = Fraction(1, 1)
    type_ratio = self._convert_type_to_ratio()
    duration_ratio /= self.tuplet_ratio
    type_ratio /= self.tuplet_ratio
    one_half = Fraction(1, 2)
    dot_sum = Fraction(0, 1)
    for dot in range(self.dots):
        dot_sum += ((one_half ** (dot + 1)) * type_ratio)
    duration_ratio = (type_ratio + dot_sum)
    if self.is_grace_note:
        duration_ratio = Fraction(0, 1)
    return duration_ratio
