Changeset 364 for branches

Show
Ignore:
Timestamp:
12/16/08 09:10:42 (3 years ago)
Author:
brizzi
Message:

Update of HDF5Tools and PythonObjects?. Before PIL and pyTables were considered as modules of NeuroTools. Now they are considered as independent packages in order to avoid imports like 'from NeuroTools.PIL import ...' or 'from NeuroTools.tables import ...'.

Location:
branches/packaged_tools/NeuroTools
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/__init__.py

    r162 r364  
    1 __path__.append('/home/thierry/NeuroTools_Project/NeuroTools/HDF5Tools') 
     1__path__.append('H:/Thierry/NeuroTools_Project/NeuroTools/HDF5Tools') 
    22__all__ = ['highlevel', 'generator', 'navigator', 'structure', 'randomizer'] 
    33 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/generator.py

    r162 r364  
    1414""" 
    1515 
    16 from ..tables.parameters import EXPECTED_ROWS_TABLE 
    17 from ..tables.file import _checkfilters 
     16from tables.parameters import EXPECTED_ROWS_TABLE 
     17from tables.file import _checkfilters 
    1818from NeuroTools.PythonObjects.spikes import SpikeTrain, SpikeList 
    1919from NeuroTools.HDF5Tools.HDF5Objects import h5spiketrain, h5spikelist, h5serializer, h5image, h5movie 
    20 from ..tables import File, Node, Atom, Filters 
     20from tables import File, Node, Atom, Filters 
    2121 
    2222class HDF5Object(File) : 
     
    6060            for tag in tags : 
    6161                setattr(group, tag, tags[tag]) 
    62         return tables 
     62        return table 
    6363 
    6464    def createArray(self, where, name, object, tags=None, title='',  
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/highlevel.py

    r162 r364  
    1616""" 
    1717 
    18 from ..tables.parameters import NODE_MAX_SLOTS, METADATA_CACHE_SIZE 
     18from tables.parameters import NODE_MAX_SLOTS, METADATA_CACHE_SIZE 
    1919from randomizer import * 
    2020from structure import *  
    2121import urllib 
    2222from numpy import ndarray, array, dtype 
    23 from ..tables import Atom 
     23from tables import Atom 
    2424from NeuroTools.HDF5Tools.HDF5Objects.h5serializer import H5Serializer 
    2525import os.path 
     
    9191    """ 
    9292    assert mode in ['a', 'w', 'r', 'r+'], "mode must be chosen from : 'a', 'w', 'r', 'r+'" 
    93     assert len(url.split('//')) > 1, "wrong url format." 
    94     try : 
    95         file = urllib.urlretrieve(url)[0] 
    96     except : 
     93    #assert len(url.split('//')) > 1, "wrong url format." 
     94    url_split = url.split('//') 
     95    if len(url_split) > 1 : 
     96        try : 
     97            file = urllib.urlretrieve(url)[0] 
     98        except : 
     99            file = url_split[-1] 
     100            if mode in ['r', 'r+'] : 
     101                assert os.path.exists(file), "The file must at least exist locally in r and r+ modes." 
     102    else : 
     103        file = url 
    97104        if mode in ['r', 'r+'] : 
    98             raise Exception("The file must at least exist locally in r and r+ modes.") 
    99         else : 
    100             file = url.split('//')[-1] 
    101 ##        raise Exception("Cannot open the specified url.") 
     105            assert os.path.exists(file), "The file must at least exist locally in r and r+ modes." 
    102106    # Expand the form '~user' 
    103107    path = os.path.expanduser(file) 
     
    105109    path = os.path.expandvars(path) 
    106110    # Finally, create the File instance, and return it 
     111    print path 
    107112    return HDF5File(path, mode, title, trMap, rootUEP, filters, METADATA_CACHE_SIZE, nodeCacheSize) 
    108113 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/navigator.py

    r136 r364  
    1515 
    1616from .generator import HDF5Object 
    17 from ..tables import Group 
     17from tables import Group 
    1818import time 
    1919import os 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/randomizer.py

    r136 r364  
    1717from math import log 
    1818from time import time 
    19 from ..tables import Filters 
    20 from ..tables.atom import Int64Atom, Float64Atom, BoolAtom, StringAtom 
    21 from ..tables import StringCol, BoolCol, Int64Col, Float64Col, Int32Col 
     19from tables import Filters 
     20from tables.atom import Int64Atom, Float64Atom, BoolAtom, StringAtom 
     21from tables import StringCol, BoolCol, Int64Col, Float64Col, Int32Col 
    2222from numpy import array 
    2323from NeuroTools.PythonObjects.spikes import SpikeTrain, SpikeList 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Factory/structure.py

    r136 r364  
    1414""" 
    1515 
    16 from ..tables import Group, Leaf, Filters, Node 
     16from tables import Group, Leaf, Filters, Node 
    1717from NeuroTools.PythonObjects.spikes import SpikeTrain, SpikeList 
    1818from NeuroTools.HDF5Tools.HDF5Objects import h5spiketrain, h5spikelist, h5image, h5movie,h5serializer 
    19 from NeuroTools.PIL import Image 
     19from PIL import Image 
    2020from navigator import * 
    2121from os.path import exists 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Objects/__init__.py

    r162 r364  
    1 __path__.append('/home/thierry/NeuroTools_Project/NeuroTools/HDF5Tools') 
     1__path__.append('H:/Thierry/NeuroTools_Project/NeuroTools/HDF5Tools') 
    22__all__ = ['h5spiketrain', 'h5spikelist', 'h5serializer', 'h5image', 'h5movie'] 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Objects/h5image.py

    r136 r364  
    1212""" 
    1313 
    14 from ..tables import CArray, Table, VLArray, Atom 
    15 from ..tables import UInt8Atom, Filters 
    16 from ..PIL import Image 
     14from tables import CArray, Table, VLArray, Atom 
     15from tables import UInt8Atom, Filters 
     16from PIL import Image 
    1717import urllib 
    1818 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Objects/h5movie.py

    r162 r364  
    1313 
    1414from numpy import array, around, newaxis 
    15 from ..tables import Table, CArray, UInt8Atom, Filters, VLArray, Atom, Float64Atom 
    16 from ..PIL import Image 
     15from tables import Table, CArray, UInt8Atom, Filters, VLArray, Atom, Float64Atom 
     16from PIL import Image 
    1717import os 
    1818import os.path 
  • branches/packaged_tools/NeuroTools/HDF5Tools/HDF5Objects/h5spiketrain.py

    r136 r364  
    1414#TODO : work on data precision 
    1515 
    16 from ..tables import Filters 
    17 from ..tables import CArray 
     16from tables import Filters 
     17from tables import CArray 
    1818##from tables.description import IsDescription, Int64Col, UInt8Col, UInt64Col, Float64Col 
    19 from ..tables import Int64Atom 
     19from tables import Int64Atom 
    2020#from numpy import rand, floor, log #TODO use numpy instead 
    2121#from random import randint 
  • branches/packaged_tools/NeuroTools/HDF5Tools/__init__.py

    r162 r364  
    1 __path__.append('/home/thierry/NeuroTools_Project/NeuroTools') 
     1__path__.append('H:/Thierry/NeuroTools_Project/NeuroTools') 
    22__all__ = ['HDF5Objects', 'HDF5Factory'] 
    33 
  • branches/packaged_tools/NeuroTools/HDF5Tools/h5objects_tests.py

    r162 r364  
    11import sys 
    2 sys.path.append('/home/thierry/NeuroTools_Project') 
     2sys.path.append('H:/Thierry/NeuroTools_Project') 
    33from NeuroTools.HDF5Tools.HDF5Factory.highlevel import openH5File, HDF5File 
    4 from NeuroTools.PIL import Image 
     4from PIL import Image 
    55from tables import Leaf, CArray, Group 
    66from NeuroTools.PythonObjects.spikes import SpikeTrain, SpikeList 
  • branches/packaged_tools/NeuroTools/PythonObjects/__init__.py

    r162 r364  
    1 __path__.append('/home/thierry/NeuroTools_Project/NeuroTools') 
     1__path__.append('H:/Thierry/NeuroTools_Project/NeuroTools') 
    22__all__ = ['spikes'] 
  • branches/packaged_tools/NeuroTools/__init__.py

    r162 r364  
    1 __path__.append('/home/thierry/NeuroTools_Project') 
    2 __path__.append('/usr/lib/python2.5/site-packages') 
    3 __all__ = ['PIL', 'tables', 'PythonObjects', 'HDF5Tools'] 
     1__path__.append('H:/Thierry/NeuroTools_Project') 
     2__all__ = ['PythonObjects', 'HDF5Tools']