Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Aug 10, 2023
1 parent d65e68e commit 0eb38ba
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions openff/evaluator/attributes/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UndefinedAttribute:
and an undeclared optional value."""

def __eq__(self, other):
return type(other) == UndefinedAttribute
return type(other) is UndefinedAttribute

def __ne__(self, other):
return not self.__eq__(other)
Expand Down Expand Up @@ -72,7 +72,7 @@ def validate(self, attribute_type=None):
attribute = getattr(self.__class__, name)
attribute_value = getattr(self, name)

if attribute_type is not None and type(attribute) != attribute_type:
if attribute_type is not None and type(attribute) is not attribute_type:
continue

if not attribute.optional and attribute_value == UNDEFINED:
Expand Down Expand Up @@ -131,7 +131,7 @@ def get_attributes(cls, attribute_type=None):
found_attributes = [
name
for name in found_attributes
if type(base_class.__dict__[name]) == attribute_type
if type(base_class.__dict__[name]) is attribute_type
]

attribute_names.extend(found_attributes)
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def add_schema(self, layer_type, property_type, schema):
# Make sure the schema is compatible with the layer.
assert layer_type in registered_calculation_layers
calculation_layer = registered_calculation_layers[layer_type]
assert type(schema) == calculation_layer.required_schema_type()
assert type(schema) is calculation_layer.required_schema_type()

if isinstance(property_type, type):
property_type = property_type.__name__
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/protocols/forcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _append_system(existing_system, system_to_append, cutoff, index_map=None):
f"of force: {type(force)}."
)

if type(force_to_append) != type(force):
if type(force_to_append) is not type(force):
continue

if isinstance(
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/protocols/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Type(Enum):

def __eq__(self, other):
return (
type(self) == type(other)
type(self) is type(other)
and self.left_hand_value == other.left_hand_value
and self.right_hand_value == other.right_hand_value
and self.type == other.type
Expand Down
4 changes: 2 additions & 2 deletions openff/evaluator/storage/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class HashableStoredData(BaseStoredData, abc.ABC):
"""

def __eq__(self, other):
return type(self) == type(other) and hash(self) == hash(other)
return type(self) is type(other) and hash(self) == hash(other)

def __ne__(self, other):
return not self.__eq__(other)
Expand Down Expand Up @@ -150,7 +150,7 @@ def most_information(cls, stored_data_1, stored_data_2):
"""

assert isinstance(stored_data_1, ReplaceableData)
assert type(stored_data_1) == type(stored_data_2)
assert type(stored_data_1) is type(stored_data_2)

# Make sure the two objects are compatible.
data_query = stored_data_1.to_storage_query()
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/storage/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _match_substance(self, data_object):
iter(self.substance.get_amounts(component.identifier))
)

if type(data_amount) != type(query_amount):
if type(data_amount) is not type(query_amount):
continue

if isinstance(data_amount, ExactAmount) and data_amount != query_amount:
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/substances/amounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __repr__(self):
return f"<{self.__class__.__name__} {str(self)}>"

def __eq__(self, other):
return type(self) == type(other) and np.isclose(self.value, other.value)
return type(self) is type(other) and np.isclose(self.value, other.value)

def __ne__(self, other):
return not (self == other)
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/substances/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __hash__(self):
return hash(self.identifier)

def __eq__(self, other):
return type(self) == type(other) and self.identifier == other.identifier
return type(self) is type(other) and self.identifier == other.identifier

def __ne__(self, other):
return not (self == other)
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/substances/substances.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def __hash__(self):
return hash(self.identifier)

def __eq__(self, other):
return type(self) == type(other) and hash(self) == hash(other)
return type(self) is type(other) and hash(self) == hash(other)

def __ne__(self, other):
return not (self == other)
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/workflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def __hash__(self):
return hash(self._full_path)

def __eq__(self, other):
return type(self) == type(other) and self._full_path == other.full_path
return type(self) is type(other) and self._full_path == other.full_path

def __ne__(self, other):
return not (self == other)
Expand Down
2 changes: 1 addition & 1 deletion openff/evaluator/workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def label_molecules(force_field, topology):
current_molecule_labels = dict()
param_is_list = False
for tag, parameter_handler in force_field._parameter_handlers.items():
if type(parameter_handler) == VirtualSiteHandler:
if type(parameter_handler) is VirtualSiteHandler:
param_is_list = True

matches = parameter_handler.find_matches(top_mol, unique=True)
Expand Down

0 comments on commit 0eb38ba

Please sign in to comment.