Skip to content

Commit

Permalink
#880 fix tino comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Scottmar93 committed Mar 30, 2020
1 parent 0dcfd4a commit 2a4f792
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pybamm/expression_tree/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def __init__(

@property
def input_names(self):
return self._input_names

def print_input_names(self):
if self._input_names:
for inp in self._input_names:
print(inp)
Expand Down
2 changes: 1 addition & 1 deletion pybamm/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def info(self, symbol_name):
if isinstance(symbol, pybamm.FunctionParameter):
print("")
print("Inputs:")
symbol.input_names
symbol.print_input_names()

print(div)

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_expression_tree/test_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def test_copy(self):
func = pybamm.FunctionParameter("func", {"2a": 2 * a})

new_func = func.new_copy()
self.assertEqual(func._input_names, new_func._input_names)
self.assertEqual(func.input_names, new_func.input_names)

def test_print_input_names(self):
var = pybamm.Variable("var")
func = pybamm.FunctionParameter("a", {"var": var})
func.input_names
func.print_input_names()

def test_get_children_domains(self):
var = pybamm.Variable("var", domain=["negative electrode"])
Expand All @@ -64,7 +64,7 @@ def test_set_input_names(self):
new_input_names = ["first", "second"]
func.input_names = new_input_names

self.assertEqual(func._input_names, new_input_names)
self.assertEqual(func.input_names, new_input_names)

with self.assertRaises(TypeError):
new_input_names = {"wrong": "input type"}
Expand Down

0 comments on commit 2a4f792

Please sign in to comment.