Skip to content

Commit 5fcc60b

Browse files
committed
Merge branch 'issue-2358-add-temperature-to-experiment' of https://github.com/pybamm-team/PyBaMM into issue-2358-add-temperature-to-experiment
2 parents f64a3fa + d6a61bf commit 5fcc60b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

examples/scripts/run_ecm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pybamm
2+
23
pybamm.set_logging_level("INFO")
34

45
model = pybamm.equivalent_circuit.Thevenin()

pybamm/experiments/experiment.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,14 @@ def convert_electric(self, electric):
418418
)
419419

420420
def _detect_mistyped_temperatures(self, cond):
421-
422-
mistype = False
423-
424421
if "oC" in cond:
425-
mistype = True
426-
427-
if mistype:
428422
raise ValueError(f"Temperature not written correctly on step: '{cond}'")
429423

430424
def _read_and_drop_temperature(self, cond):
431425

432426
matches = re.findall(r"at\s-*\d+\.*\d*\s*oC", cond)
427+
if len(matches) == 0 and "oC" in cond:
428+
raise ValueError(f"Temperature not written " f"correctly on step: '{cond}'")
433429

434430
if len(matches) == 0:
435431

0 commit comments

Comments
 (0)