Hello everyone,
The Cpickle converts your object to a byte stream, which achieve fast speed for data processing. In PyFR, the pickle procedure is defined in following class memoize() and acts as a wrapper **@**memoize to handle the data. The resultant file of .vtu can be post-precessed with paraview, but its data is unable to visualize with a common text editor. So far I have not reached such a strong level of programming, is it possible to unpickle the files of .vtu? And can it be commented out to facilitate debugging? Any tips are appreciated.
class memoize(object):
def __init__(self, func):
self.func = func
def __get__(self, instance, owner):
return self.func if instance is None else ft.partial(self, instance)
def __call__(self, *args, **kwargs):
instance = args[0]
try:
cache = instance._memoize_cache
except AttributeError:
cache = instance._memoize_cache = {}
key = (self.func, **pickle****.dumps**(args[1:], 1), **pickle.dumps**(kwargs, 1))
try:
res = cache[key]
except KeyError:
res = cache[key] = self.func(*args, **kwargs)
return res
Thanks,
Kiny