Skip to content

Commit

Permalink
fix linting complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed Apr 2, 2024
1 parent c6c5380 commit 8e6e76f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions chempy/chemistry.py
Expand Up @@ -456,9 +456,8 @@ def _init_stoich(container):
if isinstance(container, set):
container = {k: 1 for k in container}
container = container or {}
if (
type(container) == dict
): # we don't want isinstance here in case of OrderedDict
if type(container) == dict: # noqa
# we don't want isinstance here in case of OrderedDict
container = OrderedDict(sorted(container.items(), key=lambda kv: kv[0]))
return container

Expand Down Expand Up @@ -1456,11 +1455,10 @@ def balance_stoichiometry(
substances = OrderedDict(
[(k, substance_factory(k)) for k in substances.split()]
)
if (
type(reactants) == set
): # we don't want isinstance since it might be "OrderedSet"
if type(reactants) == set: # noqa
# we don't want isinstance since it might be "OrderedSet"
reactants = sorted(reactants)
if type(products) == set:
if type(products) == set: # noqa
products = sorted(products)
subst_keys = list(reactants) + list(products)

Expand Down

0 comments on commit 8e6e76f

Please sign in to comment.