Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement GainData as dataclass #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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.

None yet

1 participant