-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add __str__ methods for actions #26
Conversation
fault/actions.py
Outdated
|
||
class Step(Action): | ||
def __init__(self, steps, clock): | ||
super().__init__() | ||
self.steps = steps | ||
self.clock = clock | ||
|
||
def __str__(self): | ||
return f"Step({self.steps}, {self.clock.debug_name})" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe Step({self.clock.debug_name}, steps={self.steps})
to make it more clear? Idk how standard the 'steps' argument is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I was having it match the __init__
call, so if we go with this, I'd want to update the __init__
to match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. If it's not too much refactoring that seems more uniform. Otherwise, it is fine as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Pull Request Test Coverage Report for Build 188
💛 - Coveralls |
fault/tester.py
Outdated
@@ -1,4 +1,4 @@ | |||
import magma | |||
iclockmport magma |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, that's what I get for no tests. Fixed, and pushed a test for the string methods.
Oh, forgot to update the Step references in the tests directory |
Convenience methods for debugging.
For example, with this change
You get a nice printout, such as