def test09a(self):

        if verbose:
            print('\n', '-=' * 30)
            print("Running %s.test09a..." % self.__class__.__name__)

        table1 = self.h5file.root.table1
        table2 = self.h5file.root.table2

        table1._disable_indexing_in_queries()

        # Convert the limits to the appropriate type
        il = str(self.il).encode('ascii')
        sl = str(self.sl).encode('ascii')

        # Do some selections and check the results
        t1col = table1.cols.var1
        self.assertTrue(t1col is not None)

        # First selection
        condition = 't1col<=sl'
        self.assertTrue(not table1.will_query_use_indexing(condition))
        results1 = [p['var1'] for p in table1.where(
            condition, start=2, stop=10)]
        results2 = [p["var1"] for p in table2.iterrows(2, 10)
                    if p["var1"] <= sl]
        if verbose:
            print("Limit:", sl)
            print("Length results:", len(results1))
            print("Should be:", len(results2))
        self.assertEqual(len(results1), len(results2))
        self.assertEqual(results1, results2)

        # Second selection
        condition = '(il<t1col)&(t1col<sl)'
        self.assertTrue(not table1.will_query_use_indexing(condition))
        results1 = [p['var1'] for p in
                    table1.where(condition, start=2, stop=30, step=2)]
        results2 = [p["var1"] for p in table2.iterrows(2, 30, 2)
                    if il < p["var1"] < sl]
        if verbose:
            print("Limits:", il, sl)
            print("Length results:", len(results1))
            print("Should be:", len(results2))
        self.assertEqual(len(results1), len(results2))
        self.assertEqual(results1, results2)

        # Third selection
        condition = '(il>t1col)&(t1col>sl)'
        self.assertTrue(not table1.will_query_use_indexing(condition))
        results1 = [
            p['var1'] for p in table1.where(condition, start=2, stop=-5)
        ]
        results2 = [
            p["var1"] for p in table2.iterrows(2, -5)  # Negative indices
            if (il > p["var1"] > sl)
        ]
        if verbose:
            print("Limits:", il, sl)
            print("Limit:", sl)
            print("Length results:", len(results1))
            print("Should be:", len(results2))
        self.assertEqual(len(results1), len(results2))
        self.assertEqual(results1, results2)

        # This selection to be commented out
#         condition = 't1col>=sl'
#         self.assertTrue(not table1.will_query_use_indexing(condition))
#         results1 = [p['var1'] for p in table1.where(condition,start=2,
#                                                     stop=-1,step=1)]
#         results2 = [p["var1"] for p in table2.iterrows(2, -1, 1)
#                     if p["var1"] >= sl]
#         if verbose:
#             print "Limit:", sl
#             print "Selection results (in-kernel):", results1
#             print "Should look like:", results2
#             print "Length results:", len(results1)
#             print "Should be:", len(results2)
#         self.assertEqual(len(results1), len(results2))
#         self.assertEqual(results1, results2)

        # Fourth selection
        # results1 = [p['var1'] for p in
        # table1.where(condition,start=2,stop=-1,step=3)]
        condition = 't1col>=sl'
        self.assertTrue(not table1.will_query_use_indexing(condition))
        results1 = [p['var1'] for p in
                    table1.where(condition, start=2, stop=-1, step=3)]
        results2 = [p["var1"] for p in table2.iterrows(2, -1, 3)
                    if p["var1"] >= sl]
        if verbose:
            print("Limits:", il, sl)
            print("Length results:", len(results1))
            print("Should be:", len(results2))
        self.assertEqual(len(results1), len(results2))
        self.assertEqual(results1, results2)

        # Re-enable the indexing in queries basically to unnail the
        # condition cache and not raising the performance warning
        # about some indexes being dirty
        table1._enable_indexing_in_queries()
Checking non-indexed where() (string flavor)
dataset/ETHPy150Open PyTables/PyTables/tables/tests/test_indexvalues.py/SelectValuesTestCase.test09a