Skip to content

Commit f14375b

Browse files
committed
#2358 fixed flake8 issues
1 parent 7ab0f5e commit f14375b

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

pybamm/experiments/experiment.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ class Experiment:
3333
list of operating conditions should be passed in. Each operating condition should
3434
be of the form "Do this for this long" or "Do this until this happens". For example,
3535
"Charge at 1 C for 1 hour", or "Charge at 1 C until 4.2 V", or "Charge at 1 C for 1
36-
hour or until 4.2 V at 25oC". The instructions can be of the form
37-
"(Dis)charge at x A/C/W", "Rest", or "Hold at x V until y A at z degC". The running
36+
hour or until 4.2 V at 25oC". The instructions can be of the form
37+
"(Dis)charge at x A/C/W", "Rest", or "Hold at x V until y A at z degC". The running
3838
time should be a time in seconds, minutes or
3939
hours, e.g. "10 seconds", "3 minutes" or "1 hour". The stopping conditions should be
4040
a circuit state, e.g. "1 A", "C/50" or "3 V". The parameter drive_cycles is
4141
mandatory to run drive cycle. For example, "Run x", then x must be the key
42-
of drive_cycles dictionary. The temperature should be provided after the stopping
43-
condition but before the period, e.g. "1 A at 25 degC (1 second period)". It is
42+
of drive_cycles dictionary. The temperature should be provided after the stopping
43+
condition but before the period, e.g. "1 A at 25 degC (1 second period)". It is
4444
not essential to provide a temperature and a global temperature can be set either
45-
from within the paramter values of passing a temperature to this experiment class.
46-
If the temperature is not specified in a line, then the global temperature is used,
45+
from within the paramter values of passing a temperature to this experiment class.
46+
If the temperature is not specified in a line, then the global temperature is used,
4747
even if another temperature has been set in an earlier line.
4848
4949
Parameters
@@ -217,7 +217,7 @@ def read_string(self, cond, drive_cycles):
217217
# Read instructions
218218
if "Run" in cond:
219219
cond_list = cond.split()
220-
if not "degC" in cond and not "oC" in cond:
220+
if "degC" not in cond and "oC" not in cond:
221221
if "at" in cond:
222222
raise ValueError(f"Instruction must be of the form: {examples}")
223223
dc_types = ["(A)", "(V)", "(W)"]

pybamm/parameters/ecm_parameters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def _set_initial_condition_parameters(self):
4747
self.initial_T_jig = pybamm.Parameter("Initial temperature [K]") - 273.15
4848

4949
def T_amb(self, t):
50-
ambient_temperature_K = pybamm.FunctionParameter("Ambient temperature [K]", {"Time [s]": t})
50+
ambient_temperature_K = pybamm.FunctionParameter(
51+
"Ambient temperature [K]", {"Time [s]": t}
52+
)
5153
return ambient_temperature_K - 273.15
5254

5355
def ocv(self, soc):

pybamm/simulation.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,12 @@ def get_experiment_parameter_values(self, op, op_number):
370370
experiment_parameter_values.update(
371371
{"Ambient temperature [K]": ambient_temperature}
372372
)
373-
if op_number == 0:
374-
experiment_parameter_values.update({
375-
"Initial temperature [K]": ambient_temperature,
376-
})
373+
if op_number == 0:
374+
experiment_parameter_values.update(
375+
{
376+
"Initial temperature [K]": ambient_temperature,
377+
}
378+
)
377379
else:
378380
experiment_parameter_values.update(
379381
{"Ambient temperature [K]": self._original_temperature}

tests/unit/test_experiments/test_experiment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ def test_read_strings_cccv_combined(self):
243243
"period": 60.0,
244244
"temperature": 32.0,
245245
"dc_data": None,
246-
"string": "Charge at 0.5 C until 1V at 32 degC then hold at 1V until C/50 at 32 degC",
246+
"string": "Charge at 0.5 C until 1V at 32 degC "
247+
"then hold at 1V until C/50 at 32 degC",
247248
"events": {"C-rate input [-]": 0.02, "type": "C-rate"},
248249
},
249250
{

0 commit comments

Comments
 (0)