Skip to content

Commit

Permalink
#1194 coverage and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Dec 7, 2020
1 parent 5dc53c4 commit 2012162
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

- Added functionality to initialize a model using the solution from another model ([#1278](https://github.com/pybamm-team/PyBaMM/pull/1278))
- Added submodels for active material ([#1262](https://github.com/pybamm-team/PyBaMM/pull/1262))
- Added composite surface form electrolyte models: `CompositeDifferential` and `CompositeAlgebraic` ([#1207](https://github.com/pybamm-team/PyBaMM/issues/1207))

Expand All @@ -11,6 +12,7 @@

## Bug fixes

- Fixed `Simulation` and `model.new_copy` to fix a bug where changes to the model were overwritten ([#1278](https://github.com/pybamm-team/PyBaMM/pull/1278))
## Breaking changes

- Operations such as `1*x` and `0+x` now directly return `x`. This can be bypassed by explicitly creating the binary operators, e.g. `pybamm.Multiplication(1, x)` ([#1252](https://github.com/pybamm-team/PyBaMM/pull/1252))
Expand Down
19 changes: 6 additions & 13 deletions pybamm/expression_tree/operations/replace_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def process_boundary_conditions(self, model):
if err.args[0] in side:
pass
# do raise error otherwise (e.g. can't process symbol)
else:
else: # pragma: no cover
raise KeyError(err)

return new_boundary_conditions
Expand Down Expand Up @@ -170,11 +170,6 @@ def process_symbol(self, symbol):

def _process_symbol(self, symbol):
""" See :meth:`Simplification.process_symbol()`. """
if not any(
x.id in self._symbol_replacement_map_ids.keys() for x in symbol.pre_order()
):
return symbol.new_copy()

if symbol.id in self._symbol_replacement_map_ids.keys():
return self._symbol_replacement_map_ids[symbol.id]

Expand Down Expand Up @@ -202,10 +197,8 @@ def _process_symbol(self, symbol):
return symbol._concatenation_new_copy(new_children)

else:
if not any(
x.id in self._symbol_replacement_map_ids.keys()
for x in symbol.pre_order()
):
return symbol.new_copy()
else:
raise NotImplementedError
# Only other option is that the symbol is a leaf (doesn't have children)
# In this case, since we have already ruled out that the symbol is one of
# the symbols that needs to be replaced, we can just return a new copy of
# the symbol
return symbol.new_copy()

0 comments on commit 2012162

Please sign in to comment.