# Path: csc/divisi/pt_ordered_set.py
# class PTOrderedSet(OrderedSet):
#     @classmethod
#     def create(cls, filename, pt_path, pt_name, filters=None):
#         fileh = get_pyt_handle(filename)
#         array = fileh.createVLArray(pt_path, pt_name, tables.ObjectAtom(), filters=filters)
#         return cls(array)
# 
#     @classmethod
#     def open(cls, filename, pt_path, pt_name):
#         fileh = get_pyt_handle(filename)
#         array = fileh.getNode(pt_path, pt_name)
#         return cls(array)
# 
# 
#     def __init__(self, array):
#         self.items = array
#         self.indices = dict((item, idx) for idx, item in enumerate(array))
#         self._setup_quick_lookup_methods()
# 
#     def __setitem__(self, n, newkey):
#         raise TypeError('Existing items in a PTOrderedSet cannot be changed.')
#     def __delitem__(self, n):
#         raise TypeError('Existing items in a PTOrderedSet cannot be changed.')
# 
#     #def __del__(self):
#      #   self.array._


from csc.divisi.pt_ordered_set import PTOrderedSet
from nose.tools import eq_
import tempfile, os.path
def test_pt_ordered_set():
    tmpdir = tempfile.mkdtemp()
    tfile = os.path.join(tmpdir, 'pttensor.h5')


# Path: csc/divisi/pt_ordered_set.py
# class PTOrderedSet(OrderedSet):
#     @classmethod
#     def create(cls, filename, pt_path, pt_name, filters=None):
#         fileh = get_pyt_handle(filename)
#         array = fileh.createVLArray(pt_path, pt_name, tables.ObjectAtom(), filters=filters)
#         return cls(array)
# 
#     @classmethod
#     def open(cls, filename, pt_path, pt_name):
#         fileh = get_pyt_handle(filename)
#         array = fileh.getNode(pt_path, pt_name)
#         return cls(array)
# 
# 
#     def __init__(self, array):
#         self.items = array
#         self.indices = dict((item, idx) for idx, item in enumerate(array))
#         self._setup_quick_lookup_methods()
# 
#     def __setitem__(self, n, newkey):
#         raise TypeError('Existing items in a PTOrderedSet cannot be changed.')
#     def __delitem__(self, n):
#         raise TypeError('Existing items in a PTOrderedSet cannot be changed.')
# 
#     #def __del__(self):
#      #   self.array._


# Path: test/test_pt_orderedset.py
from csc.divisi.pt_ordered_set import PTOrderedSet
from nose.tools import eq_
import tempfile, os.path

def test_pt_ordered_set():
    tmpdir = tempfile.mkdtemp()
    tfile = os.path.join(tmpdir, 'pttensor.h5')


    ordered_set = PTOrderedSet.create(tfile, '/', 'labels_0')