Skip to content

Implement GainData as dataclass#39

Open
chaudum wants to merge 1 commit intomainfrom
gaindata-dataclass
Open

Implement GainData as dataclass#39
chaudum wants to merge 1 commit intomainfrom
gaindata-dataclass

Conversation

@chaudum
Copy link
Owner

@chaudum chaudum commented Mar 31, 2021

This fixes on the one hand a syntax error in the string formatting
performed within the __str__ method by removing it and relying on the
method provided by the dataclass.
On the other hand, this change allowed to remove also the __repr__,
__eq__ and __ne__ methods, which are also provided by the dataclass
wrapper.

This fixes on the one hand a syntax error in the string formatting
performed within the `__str__` method by removing it and relying on the
method provided by the dataclass.
On the other hand, this change allowed to remove also the `__repr__`,
`__eq__` and `__ne__` methods, which are also provided by the dataclass
wrapper.
self.gain_type = gain_type

def __str__(self):
return "gain={.2f} dB; peak={.8f}; reference-level={} dB".format(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax error was caused by the float fomatting, which misses the colon and should be {:2f}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant