Skip to content

Commit 9ba63f6

Browse files
committed
#858 misc fixes
1 parent 5a0da61 commit 9ba63f6

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

pybamm/discretisations/discretisation.py

+4
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,10 @@ def check_initial_conditions_rhs(self, model):
10301030
y0 = model.concatenated_initial_conditions
10311031
# Individual
10321032
for var in model.rhs.keys():
1033+
print('rhs')
1034+
print(model.rhs[var])
1035+
print('init')
1036+
print(model.initial_conditions[var])
10331037
assert (
10341038
model.rhs[var].shape == model.initial_conditions[var].shape
10351039
), pybamm.ModelError(

pybamm/expression_tree/symbol.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,7 @@ def shape(self):
713713
try:
714714
y = np.linspace(0.1, 0.9, int(1e4))
715715
evaluated_self = self.evaluate(0, y, y, u="shape test")
716+
print('evaluated self is ',evaluated_self)
716717
# If that fails, fall back to calculating how big y should really be
717718
except ValueError:
718719
state_vectors_in_node = [
@@ -726,7 +727,7 @@ def shape(self):
726727
)
727728
# Pick a y that won't cause RuntimeWarnings
728729
y = np.linspace(0.1, 0.9, min_y_size)
729-
evaluated_self = self.evaluate(0, y)
730+
evaluated_self = self.evaluate(0, y, y)
730731

731732
# Return shape of evaluated object
732733
if isinstance(evaluated_self, numbers.Number):

pybamm/solvers/base_solver.py

-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ def report(string):
194194
else:
195195
# Process with CasADi
196196
report(f"Converting {name} to CasADi")
197-
print(u_casadi)
198197
func = func.to_casadi(t_casadi, y_casadi, u=u_casadi)
199198
if use_jacobian:
200199
report(f"Calculating jacobian for {name} using CasADi")

tests/unit/test_parameters/test_parameters_cli.py

+8
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,11 @@ def test_list_params(self):
119119
# ./input/parameters/lithium-ion/cathodes/tmp_dir
120120
# but must not intefere with existing input dir if it exists
121121
# in the current dir...
122+
123+
if __name__ == "__main__":
124+
print("Add -v for more debug output")
125+
import sys
126+
127+
if "-v" in sys.argv:
128+
debug = True
129+
unittest.main()

tests/unit/test_solvers/test_casadi_solver.py

-1
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,4 @@ def test_model_solver_with_dvdt(self):
337337
if "-v" in sys.argv:
338338
debug = True
339339
pybamm.settings.debug_mode = True
340-
pybamm.set_logging_level("DEBUG")
341340
unittest.main()

0 commit comments

Comments
 (0)