Skip to content

Commit

Permalink
fix ruff errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Aug 22, 2023
1 parent b28f2fd commit 16cb21f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pybamm/geometry/battery_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def battery_geometry(
A geometry class for the battery
"""
if options is None or type(options) == dict:
if options is None or isinstance(options, dict):
options = pybamm.BatteryModelOptions(options)
geo = pybamm.GeometricParameters(options)
L_n = geo.n.L
Expand Down
2 changes: 1 addition & 1 deletion pybamm/models/full_battery_models/base_battery_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def options(self, extra_options):
# if extra_options is a dict then process it into a BatteryModelOptions
# this does not catch cases that subclass the dict type
# so other submodels can pass in their own options class if needed
if extra_options is None or type(extra_options) == dict:
if extra_options is None or isinstance(extra_options, dict):
options = BatteryModelOptions(extra_options)
else:
options = extra_options
Expand Down
2 changes: 1 addition & 1 deletion pybamm/models/submodels/base_submodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(

self.external = external

if options is None or type(options) == dict:
if options is None or isinstance(options, dict):
options = pybamm.BatteryModelOptions(options)

self.options = options
Expand Down
2 changes: 1 addition & 1 deletion pybamm/parameters/base_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def options(self):

@options.setter
def options(self, extra_options):
if extra_options is None or type(extra_options) == dict:
if extra_options is None or isinstance(extra_options, dict):
self._options = pybamm.BatteryModelOptions(extra_options)
else:
self._options = extra_options
Expand Down

0 comments on commit 16cb21f

Please sign in to comment.