<commit_before>"""Module containing element dict, species and reaction classes, and constants.

"""

# Python 2 compatibility
from __future__ import division

# Standard libraries
import math
import numpy as np

__all__ = ['RU', 'RUC', 'RU_JOUL', 'PA', 'get_elem_wt',
           'ReacInfo', 'SpecInfo', 'calc_spec_smh']

# universal gas constants, SI units
RU = 8314.4621  # J/(kmole * K)
RU_JOUL = 8.3144621
RUC = (RU / 4.18400)  # cal/(mole * K)

# Avogadro's number
AVAG = 6.0221367e23

# pressure of one standard atmosphere [Pa]
PA = 101325.0


class CommonEqualityMixin(object):
    """Base class for `ReacInfo` and `SpecInfo` classes for equality comparison
    """
    def __eq__(self, other):
        try:
            for key, value in self.__dict__.items():
                if not key in other.__dict__:
                    return False
                if isinstance(value, np.ndarray):
                    if not np.array_equal(value, other.__dict__[key]):
                        return False
                elif value != other.__dict__[key]:
                    return False
            return True<commit_msg>minor fix for equlity comparison of objects<commit_after>"""Module containing element dict, species and reaction classes, and constants.

"""

# Python 2 compatibility
from __future__ import division

# Standard libraries
import math
import numpy as np

__all__ = ['RU', 'RUC', 'RU_JOUL', 'PA', 'get_elem_wt',
           'ReacInfo', 'SpecInfo', 'calc_spec_smh']

# universal gas constants, SI units
RU = 8314.4621  # J/(kmole * K)
RU_JOUL = 8.3144621
RUC = (RU / 4.18400)  # cal/(mole * K)

# Avogadro's number
AVAG = 6.0221367e23

# pressure of one standard atmosphere [Pa]
PA = 101325.0


class CommonEqualityMixin(object):
    """Base class for `ReacInfo` and `SpecInfo` classes for equality comparison
    """
    def __eq__(self, other):
        try:
            for key, value in self.__dict__.items():
                if not key in other.__dict__:
                    return False
                if isinstance(value, np.ndarray):
                    if not np.array_equal(value, other.__dict__[key]):
                        return False
                elif isinstance(value, list):
                    if not all([any(x == y for y in other.__dict__[key]) for x in value]):
                        return False
                elif value != other.__dict__[key]:
                    return False
            return True
{'fraction_non_alphanumeric': 0.10040816326530612, 'fraction_numerical': 0.0326530612244898, 'mean_word_length': 2.216535433070866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1436240', 'n_tokens_mistral': 789, 'n_tokens_neox': 703, 'n_words': 234}