Skip to content

Commit

Permalink
Merge pull request #1632 from glotzerlab/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
joaander authored Oct 3, 2023
2 parents d6b9707 + 90e59d6 commit 17527cd
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ repos:
hooks:
- id: nbstripout
- repo: https://github.com/google/yapf
rev: 'v0.40.0'
rev: 'v0.40.2'
hooks:
- id: yapf
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
rev: '6.1.0'
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion hoomd/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def check_item(x, y, attr):

if not isinstance(a, hoomd.operation._HOOMDGetSetAttrBase):
return a == b
assert type(a) == type(b)
assert type(a) is type(b)

_check_obj_attr_compatibility(a, b)

Expand Down
2 changes: 1 addition & 1 deletion hoomd/data/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def __array_function__(self, func, types, args, kwargs):
"""
new_inputs = [coerce_mock_to_array(val) for val in args]
for key, value in kwargs.items():
if type(value) == tuple:
if type(value) is tuple:
kwargs[key] = tuple(
[coerce_mock_to_array(val) for val in value])
else:
Expand Down
2 changes: 1 addition & 1 deletion hoomd/filter/all_.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __hash__(self):

def __eq__(self, other):
"""Test for equality between two particle filters."""
return type(self) == type(other)
return type(self) is type(other)

def __reduce__(self):
"""Enable (deep)copying and pickling of `All` particle filters."""
Expand Down
2 changes: 1 addition & 1 deletion hoomd/filter/null.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def __hash__(self):

def __eq__(self, other):
"""Test for equality between two particle filters."""
return type(self) == type(other)
return type(self) is type(other)
2 changes: 1 addition & 1 deletion hoomd/filter/rigid.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __hash__(self):

def __eq__(self, other):
"""Test for equality between two particle filters."""
return type(self) == type(other) and self._flags == other._flags
return type(self) is type(other) and self._flags == other._flags

def __reduce__(self):
"""Enable (deep)copying and pickling of `Rigid` particle filters."""
Expand Down
4 changes: 2 additions & 2 deletions hoomd/filter/set_.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def __hash__(self):

def __eq__(self, other):
if self._symmetric:
return type(self) == type(other) and \
return type(self) is type(other) and \
(self._f == other._f or self._f == other._g) and \
(self._g == other._g or self._g == other._f)
else:
return type(self) == type(other) and \
return type(self) is type(other) and \
self._f == other._f and self._g == other._g

def __reduce__(self):
Expand Down
2 changes: 1 addition & 1 deletion hoomd/filter/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __hash__(self):

def __eq__(self, other):
"""Test for equality between two particle filters."""
return type(self) == type(other) and np.array_equal(
return type(self) is type(other) and np.array_equal(
self.tags, other.tags)

@property
Expand Down
2 changes: 1 addition & 1 deletion hoomd/filter/type_.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __hash__(self):

def __eq__(self, other):
"""Test for equality between two particle filters."""
return type(self) == type(other) and self._types == other._types
return type(self) is type(other) and self._types == other._types

@property
def types(self):
Expand Down
4 changes: 2 additions & 2 deletions hoomd/md/pytest/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def external_params(request):

def _assert_correct_params(external_obj, param_attr, params):
"""Assert the params of the external object match whats in the dict."""
if type(params) == dict:
if type(params) is dict:
for param in params.keys():
npt.assert_allclose(
getattr(external_obj, param_attr)['A'][param], params[param])
if type(params) == tuple:
if type(params) is tuple:
npt.assert_allclose(getattr(external_obj, param_attr)['A'], params)


Expand Down
2 changes: 1 addition & 1 deletion hoomd/md/pytest/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_attach_detach(simulation_factory, two_particle_snapshot_factory):
# make sure quantities are computable without failure
for qty, typ in _thermo_qtys:
calc_qty = getattr(thermo, qty)
assert type(calc_qty) == typ
assert type(calc_qty) is typ

# detach from simulation and test properties again
sim.operations.remove(thermo)
Expand Down
6 changes: 3 additions & 3 deletions hoomd/pytest/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _assert_common_properties(dev,
assert dev.num_cpu_threads == num_cpu_threads
else:
assert dev.num_cpu_threads == 1
assert type(dev.communicator) == hoomd.communicator.Communicator
assert type(dev.communicator) is hoomd.communicator.Communicator


def test_common_properties(device, tmp_path):
Expand Down Expand Up @@ -82,9 +82,9 @@ def test_other_gpu_specifics(device):

def _assert_list_str(values):
"""Asserts the input is a list of strings."""
assert type(values) == list
assert type(values) is list
if len(values) > 0:
assert type(values[0]) == str
assert type(values[0]) is str


@pytest.mark.gpu
Expand Down
4 changes: 2 additions & 2 deletions hoomd/pytest/test_local_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ class TestLocalSnapshots:
@staticmethod
def check_box(local_snapshot, global_box, ranks):
"""General check that ``box`` and ``local_box`` properties work."""
assert type(local_snapshot.global_box) == hoomd.Box
assert type(local_snapshot.local_box) == hoomd.Box
assert type(local_snapshot.global_box) is hoomd.Box
assert type(local_snapshot.local_box) is hoomd.Box

assert local_snapshot.global_box == global_box
# The local box and global box are equal if and only if
Expand Down
2 changes: 1 addition & 1 deletion hoomd/pytest/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def full_op(base_op, params, type_param):


def test_getattr(full_op, params, type_param):
assert type(full_op.type_param) == TypeParameter
assert type(full_op.type_param) is TypeParameter
assert full_op.type_param['A'] == type_param["A"]
for key, param in params.items():
assert getattr(full_op, key) == param
Expand Down

0 comments on commit 17527cd

Please sign in to comment.