Skip to content

Commit

Permalink
A couple extra fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kratman committed Jan 3, 2024
1 parent f304eb7 commit 4f61f06
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pybamm/experiment/experiment.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#
# Experiment class
#

from __future__ import annotations
import pybamm
from .step._steps_util import (
Expand Down Expand Up @@ -84,6 +80,8 @@ def __init__(
processed_step = pybamm.step.string(step)
elif isinstance(step, pybamm.step._Step):
processed_step = step
else:
raise TypeError("Operating conditions must be a Step object or string.")

Check warning on line 84 in pybamm/experiment/experiment.py

View check run for this annotation

Codecov / codecov/patch

pybamm/experiment/experiment.py#L84

Added line #L84 was not covered by tests

if processed_step.period is None:
processed_step.period = self.period
Expand Down Expand Up @@ -125,7 +123,8 @@ def copy(self):
def __repr__(self):
return f"pybamm.Experiment({self!s})"

def read_termination(self, termination):
@staticmethod
def read_termination(termination):
"""
Read the termination reason. If this condition is hit, the experiment will stop.
"""
Expand Down Expand Up @@ -184,7 +183,8 @@ def search_tag(self, tag):

return cycles

def _set_next_start_time(self, operating_conditions):
@staticmethod
def _set_next_start_time(operating_conditions):
if all(isinstance(i, str) for i in operating_conditions):
return operating_conditions

Expand All @@ -194,7 +194,7 @@ def _set_next_start_time(self, operating_conditions):
for op in reversed(operating_conditions):
if isinstance(op, str):
op = pybamm.step.string(op)
elif not isinstance(op, pybamm.step._Step):
if not isinstance(op, pybamm.step._Step):
raise TypeError(
"Operating conditions should be strings or _Step objects"
)
Expand Down

0 comments on commit 4f61f06

Please sign in to comment.