コード例 #1
0
 def test_pickler_save_and_load_key(self):
     input_key = {'test_key': 'key_val'}
     Pickler.save(self.image1,
                  'test_pickler_save_and_load_data.hvz',
                  key=input_key)
     key = Unpickler.key('test_pickler_save_and_load_data.hvz')
     self.assertEqual(key, input_key)
コード例 #2
0
ファイル: progress.py プロジェクト: philippjfr/PhDThesis-Code
import os
import re
import time
import glob as glob
import datetime as dt
from dateutil import tz
from functools import partial

import numpy as np
import param
import lancet
from lancet.filetypes import FileType, CustomFile
from holoviews.core.io import Unpickler
import holoviews as hv

custom=CustomFile(metadata_fn=lambda f: Unpickler.key(f),
                  data_fn = lambda f: {e: Unpickler.load(f, [e])
                                       for e in Unpickler.entries(f)})

def load_table(path):
    date = re.search("([0-9]{4}\-[0-9]{2}\-[0-9]{2}\_[0-9]{4})", path).group(1)
    dirs = glob.glob(os.path.join(path, date+'*'))
    if not dirs:
        raise Exception('No data found in directory.')
    dir_suffix = dirs[0].split(date)[-1]
    match = re.search('\_t\d{1,}\_', dir_suffix)
    if not match:
        raise Exception('No directories indexed by tid found.')
    file_pattern = ''.join(['*', dir_suffix[:match.start(0)], '_t{tid:d}_*/*.hvz'])
    viewfnames = lancet.FilePattern('filename', os.path.join(path, file_pattern))
    filedata = lancet.FileInfo(viewfnames, 'filename', custom)
コード例 #3
0
ファイル: testimportexport.py プロジェクト: sehahn/holoviews
 def test_pickler_save_and_load_key(self):
     input_key = {'test_key':'key_val'}
     Pickler.save(self.image1, 'test_pickler_save_and_load_data.hvz', key=input_key)
     key = Unpickler.key('test_pickler_save_and_load_data.hvz')
     self.assertEqual(key, input_key)
コード例 #4
0
 def hvz_metadata_fn(f):
     from holoviews.core.io import Unpickler
     return Unpickler.key(f)
コード例 #5
0
ファイル: filetypes.py プロジェクト: eackermann/lancet
 def hvz_metadata_fn(f):
     from holoviews.core.io import Unpickler
     return Unpickler.key(f)