-
Notifications
You must be signed in to change notification settings - Fork 78
Retain unary nodes with simplify() #143
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
Conversation
jeromekelleher
left a comment
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 looks like very good progress @gtsambos, I think you're definitely on the right track. A few minor points:
- Can you delete the
.logfiles please? - It's worth while running flake8 on your code on your computer before committing, as this will save some hassle with failed tests on CircleCI (we check for style conformance automatically as part of the tests to keep the code reasonably uniform). See here for how to invoke it.
Overall: looking good!
|
Cool, thanks @jeromekelleher! Just to clarify: should flake8 return no warnings/errors at all? I'm only checking for line length, like this: |
Yep, flake8 should be perfectly happy with the code. It's useful to add the check to your git pre-commit hook. Here's the last few lines of my pre-commit: |
Codecov Report
@@ Coverage Diff @@
## master #143 +/- ##
==========================================
- Coverage 85.95% 85.93% -0.02%
==========================================
Files 16 16
Lines 8707 8718 +11
Branches 1670 1674 +4
==========================================
+ Hits 7484 7492 +8
- Misses 732 733 +1
- Partials 491 493 +2
Continue to review full report at Codecov.
|
jeromekelleher
left a comment
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 looks very good, thanks @gtsambos! My only request would be to change the visual indents to hanging indents, but it's a question of taste so I won't push too hard.
The next step is to work on the C code I think.
d29a554 to
c3f3dad
Compare
a3f22b5 to
04ca0de
Compare
b5ac851 to
f62f9e9
Compare
|
OK, I think this is ready to go! Thanks for some really excellent work @gtsambos, everything worked perfectly. The only change I had to make is to rename the feature @petrelharp, would you mind taking one last look and merging if you're happy? |
|
Bumping this; @petrelharp, are you happy for us to merge? |
|
Hey @jeromekelleher, when I run the tests in |
|
It looks to be something to do with the inputs you're allowed to make to the implementations of simplify in the other libraries that are compared with |
|
The issue here is that your low-level C module is out of date and needs to be rebuilt @gtsambos, as I've updated the C code and this isn't compiled automatically. Try running 'make'; this should recompile everything and resolve the problems. (You might need to 'make clean' first). |
|
Ah, right 😅 |
Tests have been updated
f62f9e9 to
7ca4cce
Compare
|
Merging this; thanks @gtsambos! |
simplify() now takes a filter_unary argument (default: True). If False, all unary nodes are retained in the simplification.
The Python implementation in
python/tests/simplify.pyis now more or less finished; the tests inpython/tests/test_topology.pyare still under heavy development.