- 
                Notifications
    
You must be signed in to change notification settings  - Fork 191
 
Added Repr Tests #1615
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
Added Repr Tests #1615
Conversation
f149005    to
    65d2c5f      
    Compare
  
    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.
This LGTM! I made a few nitpicky changes in d05b5b9, specifically:
- Putting the space on the first line of a string split into two lines
 - Using floats in the Piecewise instances (the strings don't raise an error when instantiating the object, but they will give an error if you use them in a simulation)
 - Removing the double 
pytest.importorskipcalls (the more specific one,scipy.optimize, will cover both) - Instantiating some instances with keyword arguments rather than positional for readability
 - Using lists instead of tuples in some places
 
I then made a new commit (65d2c5f) to simplify some of the repr generation code. In that old PR, we made it automatic, but in several of these classes we were still doing it manually. We wouldn't have noticed it without these repr tests!
I'll merge on Monday after talking to everyone about these changes.
This commit also fixes a bug in FrozenObject.__repr__ for arguments that were being passed `Default`. previously they would always show up in the repr because the resolved default value is different from what shows up in the `defaults` dict, which will always be `nengo.Default`.
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.
OK, after adding those additional tests this LGTM again. Will merge once CI finishes.
2709029    to
    ada4393      
    Compare
  
    Added tests for process, solver, transform, and learning rule reprs. Also consolidated all repr tests in the test_reprs.py file. This commit also makes some minor fixes associated with these tests: - PiecewiseDataParam was marked equatable and made hashable - Added __eq__ method for ChannelShape - Several unused test arguments were removed Co-authored-by: Trevor Bekolay <[email protected]>
Added tests for processes, solvers, transforms, and learning rules. The reason this is a new PR is because the old one had bad names and descriptions that were throwing errors, and I couldn't seem to fix it.
Quick (less than 40 lines changed or changes are straightforward)
Non-code change (touches things like tests, documentation, build scripts)
I have read the CONTRIBUTING.rst document.
[na] I have updated the documentation accordingly.
[na] I have included a changelog entry.
[na] I have added tests to cover my changes.
I have run the test suite locally and all tests passed.