-
-
Notifications
You must be signed in to change notification settings - Fork 572
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
Issue 1230 simplify #1252
Issue 1230 simplify #1252
Conversation
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.
Looks good to me, just a typo to fix. Thanks Tino!
@@ -457,6 +456,15 @@ def test_x_average(self): | |||
self.assertEqual(av_a.children[0].integration_variable[0].domain, x.domain) | |||
self.assertEqual(av_a.domain, []) | |||
|
|||
# whole electrode domain is different as the divisioni by 1 gets simplified out |
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.
Typo in "divisioni"
Codecov Report
@@ Coverage Diff @@
## develop #1252 +/- ##
===========================================
+ Coverage 97.99% 98.05% +0.05%
===========================================
Files 264 264
Lines 14748 14841 +93
===========================================
+ Hits 14453 14552 +99
+ Misses 295 289 -6
Continue to review full report at Codecov.
|
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.
Looks great, thanks Tino! Great job :)
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.
thanks @tinosulzer !
pybamm/expression_tree/symbol.py
Outdated
else: | ||
return False | ||
return self.shape_for_testing == () | ||
# result = self.evaluate_ignoring_errors() |
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.
can this commented code be removed?
Description
Automatically simplify expressions that can be simplified, e.g.
1*x
becomesx
.This can be bypassed by creating the binary operator explicitly, e.g.
pybamm.Multiplication(1, x)
Fixes #1230
Fixes #986
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: