<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

from nose.tools import assert_equal
from nose_parameterized import parameterized
import itertools
import unittest
from rmgpy.molecule.molecule import Molecule

################################################################################

def load_test_cases():
    allowed_charges = ['0', '+1', '-1']
    return list(itertools.combinations_with_replacement(allowed_charges, 2))

class TestIsomorphism(unittest.TestCase):
    def create(self, adjlist):
        return Molecule().fromAdjacencyList(adjlist, saturateH=True)
    
    '''
    requires:
    
    https://github.com/wolever/nose-parameterized
    
    Install via:
    
    pip install nose-parameterized
    
    '''
    @parameterized.expand(load_test_cases)
    def testIsomorphism_with_charge(self, charge_mol_1, charge_mol_2):
        '''
        Check whether isomorphism sees difference in charge
        '''
        base = "1 C u0 p0 c"
        mol1 = self.create(base+charge_mol_1)
        mol2 = self.create(base+charge_mol_2)<commit_msg>added a permutation through some elements in isomorphismTest.py<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

from nose.tools import assert_equal
try:
    from nose_parameterized import parameterized
except:
    print 'Install nose-parameterized via: "pip install nose-parametrized" !'
import itertools
import unittest
from rmgpy.molecule.molecule import Molecule

################################################################################

def load_test_cases():
    charges  = list(itertools.combinations_with_replacement(['0', '+1', '-1'], 2))
    elements = list(itertools.combinations(['C', 'O', 'N', 'S'], 1)) 
    input_test = []
    for el in elements:
        for charge_combo in charges:#prepend element to tuple
            input_test.append(el+charge_combo)
    
    return input_test

class TestIsomorphism(unittest.TestCase):
    def create(self, adjlist):
        return Molecule().fromAdjacencyList(adjlist, saturateH=True)
    
    '''
    requires:
    
    https://github.com/wolever/nose-parameterized
    
    Install via:
    
    pip install nose-parameterized
    
    '''
    @parameterized.expand(load_test_cases)
    def testIsomorphism_with_charge(self, element, charge_mol_1, charge_mol_2):
        '''
        Check whether isomorphism sees difference in charge
        '''
        base = "1 "+element+" u0 p0 c"
        mol1 = self.create(base+charge_mol_1)
        mol2 = self.create(base+charge_mol_2)
{'fraction_non_alphanumeric': 0.1619047619047619, 'fraction_numerical': 0.011507936507936509, 'mean_word_length': 3.5587703435804703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '4020215', 'n_tokens_mistral': 777, 'n_tokens_neox': 736, 'n_words': 165}