Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AlexEliasmith
Copy link
Contributor

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.

Copy link
Member

@tbekolay tbekolay left a 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.importorskip calls (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.

tbekolay added 2 commits May 27, 2020 14:02
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`.
Copy link
Member

@tbekolay tbekolay left a 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.

@tbekolay tbekolay force-pushed the Repr-Tests branch 3 times, most recently from 2709029 to ada4393 Compare May 27, 2020 21:02
tbekolay and others added 2 commits May 27, 2020 18:30
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]>
@tbekolay tbekolay merged commit 414915a into master May 28, 2020
@tbekolay tbekolay deleted the Repr-Tests branch May 28, 2020 03:15
@tbekolay tbekolay mentioned this pull request May 28, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants