mcstasscript.helper.unpickler.CustomMcStasUnpickler

mcstasscript.helper.unpickler.CustomMcStasUnpickler

class mcstasscript.helper.unpickler.CustomMcStasUnpickler(file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=())

Helps pickle find dynamic classes on users computer, McStas version

Usage: pickle_data = CustomUnpickler(open(‘filename.dill’, ‘rb’)).load()

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

find_class(module, name)

Return an object from a specified module.

load()

Load a pickle.

Attributes

memo

persistent_load

find_class(module, name)

Return an object from a specified module.

If necessary, the module will be imported. Subclasses may override this method (e.g. to restrict unpickling of arbitrary classes and functions).

This method is called whenever a class or a function object is needed. Both arguments passed are str objects.